No migrations to apply

PS C:\Users\Administrator\Desktop\04作业\day4> .\manage.py makemigrations
Migrations for 'index':
index\migrations\0001_initial.py
- Create model Author
- Create model Book
- Create model Publisher
PS C:\Users\Administrator\Desktop\04作业\day4> .\manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, index, sessions
Running migrations:
No migrations to apply.

解决方案:
delete from django_migrations where app='index' index即为对应的app应用
执行这句删除后,再将已导入的table删除
drop table 表名
然后再执行.\manage.py makemigrations .\manage.py migrate
问题解决

猜你喜欢

转载自www.cnblogs.com/mzy1111/p/9262779.html
今日推荐