Use django
In the process , Found missing migrate The problem of , When updating the database , need migrate Error reporting solution
Here under migrate Reset problem
1. View local migrate history
python3 manage.py showmigrations
action_backend
[X] 0001_initial
[X] 0002_auto_20180228_0136
[X] 0003_magnetdata_reading_time
[X] 0004_auto_20180302_0650
[X] 0005_auto_20180510_0812
admin
[X] 0001_initial
[X] 0002_logentry_remove_auto_add
auth
[X] 0001_initial
[X] 0002_alter_permission_name_max_length
[X] 0003_alter_user_email_max_length
[X] 0004_alter_user_username_opts
[X] 0005_alter_user_last_login_null
[X] 0006_require_contenttypes_0002
[X] 0007_alter_validators_add_error_messages
2. Reset
python3 manage.py migrate --fake action_backend zero
// see
python3 manage.py showmigrations
action_backend
[ ] 0001_initial
[ ] 0002_auto_20180228_0136
[ ] 0003_magnetdata_reading_time
[ ] 0004_auto_20180302_0650
[ ] 0005_auto_20180510_0812
admin
[X] 0001_initial
[X] 0002_logentry_remove_auto_add
auth
[X] 0001_initial
[X] 0002_alter_permission_name_max_length
[X] 0003_alter_user_email_max_length
[X] 0004_alter_user_username_opts
[X] 0005_alter_user_last_login_null
[X] 0006_require_contenttypes_0002
[X] 0007_alter_validators_add_error_messages
3.makemigrations
Delete , migrate Files in the folder ,
python3 manage.py makemigrations
No changes detected
4.initial
To regenerate the 0001_initial.py
python3 manage.py migrate --fake-initial