django.db.migrations.exceptions.InconsistentMigrationHistory django报错

把数据库的的表全部删除,再重新 migrate

报错信息如下:

Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 43, in <module>
    run_module(manage_file, None, '__main__', True)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/h/Desktop/py/MxOnline/manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 82, in handle
    executor.loader.check_consistent_history(connection)
  File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/db/migrations/loader.py", line 291, in check_consistent_history
    connection.alias,
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.

 

posted @ 2018-05-28 16:00  今晚打老虎i2016  阅读(1585)  评论(0编辑  收藏  举报