url:http://my.oschina.net/u/862582/blog/355421
Because the operation of SQL database is not standardized, or when multiple people develop synchronization problems, it may lead to formal migrate can not be completed.
It is better to run after generating SQL directly than it has modified.
Remember the grammar ...
Python manage.py sqlmigrate app 0002_auto_20141212_1323 (SQL numbered file not executed)
~~~~~~~~~~~~~~
django>=1.7 Database Migration only three commands
Migrate, used to migrate the database.
Usage: Migrate App
Makemigrations, used to detect database changes and generate database migration files.
Usage: Makemigratioins app
Sqlmigrate, used to convert a database migration file into a database language (displays the SQL statements for a migratioin.)
Usage: Sqlmigrate app migration, such as makemigrations generated 0001_initial.py, just use Sqlmigrate app 0001_intial, here 0001_ Initial is the migration parameter.
Generally, if a migration uses sqlmigrate without prompting for errors, it can succeed at migrate.
When you don't succeed with Django's migrate ....