About django database migration, and show no problems are detected changes

No changes detected display this reason

Code database migration steps:


Today, the database while the database of all the deleted, re-mapping database migration, but only to find the terminal gives such information.

'>>>No changes detected'

Usually such a field generally occurs in the case of models.py unsaved, then after I have checked various data, look for the various aspects of possible errors

  • settings database-related information DATABASESas well as unregistered app
  • models.py file was not saved
  • Database generates records to upload data files to be deleted completely under migrations

So I try to generate an empty record in the file migrations, I want to migrate the database to the app name booktest

python manage.py makemigrations --empty booktest

The following code may be used directly or, where the mobility database specified app

python manage.py makemigrations booktest

生成记录数据的代码后我就成功看到数据库了,希望对你们也能有帮助

Guess you like

Origin www.cnblogs.com/gz18221/p/11918156.html