其他分享
首页 > 其他分享> > 执行migrate报错:django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initi

执行migrate报错:django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initi

作者:互联网

报错

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency blog. 0001_initial on database 'default'.

报错原因

在数据库中已经有了django相关的依赖表

解决

ps: 慎用该方法,我这里是刚新建数据库,内无数据

  1. MySQL删除相应数据库(如:django_bbs)
drop database django_bbs;
  1. MySQL中新建数据库
create database django_bbs;
  1. pycharm中重新执行migrate
python manage.py migrate

标签:applied,database,migrate,initial,django,报错,bbs
来源: https://www.cnblogs.com/yi-chun/p/16701120.html