Can anyone tell if there is a difference between
>manage.py flush # or reset
and
>manage.py sqlclear appname | python manage.py dbshell
>manage.py syncdb
makemigrations : It is used to create a migration file that contains code for the tabled schema of a model. migrate : It creates table according to the schema defined in the migration file. sqlmigrate : It is used to show a raw SQL query of the applied migration.
One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin's recommended use is limited to an organization's internal management tool.
flush will truncate (delete data)
sqlclear will drop (delete table, thus data too)
=> if you have structural modifications in your db, you have to do sqlclear (but better use south)
Update:
South has been deprecated.
From Django 1.7 upwards, migrations are built into the core of Django. If you are running a previous version, you can use South.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With