1.

Explain The Migration In Django And How You Can Do In Sql?

Answer»

Migration in Django is to make changes to your models like deleting a model, adding a field, etc. into your database SCHEMA. There are several COMMANDS you USE to interact with migrations.

  • Migrate
  • Makemigrations
  • Sqlmigrate

To do the migration in SQL, you have to print the SQL statement for resetting sequences for a given app name.
django-admin.py sqlsequencreset
Use this COMMAND to generate SQL that will fix cases where a sequence is out sync with its AUTOMATICALLY incremented field data.

Migration in Django is to make changes to your models like deleting a model, adding a field, etc. into your database schema. There are several commands you use to interact with migrations.

To do the migration in SQL, you have to print the SQL statement for resetting sequences for a given app name.
django-admin.py sqlsequencreset
Use this command to generate SQL that will fix cases where a sequence is out sync with its automatically incremented field data.



Discussion

No Comment Found