执行 Python manage.py makemigrations 报这错。除了删数据库重建外还有别的办法吗?

执行 Python manage.py makemigrations 报这错。除了删数据库重建外还有别的办法吗?

情况是这样的,
以前执行过 migrate
现在数据库里有数据了
我转移了一台云服务器

mysqldump xxx 备份的数据库

再执行 pythonmanage.pymakemigrations 报下面的错,查了一下大部分都是说删除数据库重建。除此外还有别的办法吗?

centos7.4 + python2.2 + mysql5.7

Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py", line 101, in handle
loader.check_consistent_history(connection)
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 299, in check_consistent_history
connection.alias,
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration users.0001_initial is applied before its dependency auth.0011_update_proxy_permissions on database 'default'.

以上是 执行 Python manage.py makemigrations 报这错。除了删数据库重建外还有别的办法吗? 的全部内容, 来源链接: utcz.com/p/937763.html

回到顶部