zoukankan      html  css  js  c++  java
  • 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'.
  • 相关阅读:
    配置IIS Express 7.5以允许外部访问
    免费CDN /初体验 访问量激升19%
    微软发布IIS Express:Visual Studio全新内置的Web服务器
    Visual Studio智能提示突然消失的解决办法 (vs2008 vs2010 vs2012 智能提示)
    深入理解HTTP协议
    TSO、UFO、GSO、LRO、GRO和RSS介绍
    MERGE表的问题
    使用zypper安装软件
    Mysql遇到Too many connections的解决办法
    处理SecureCRT中使用vim出现中文乱码问题
  • 原文地址:https://www.cnblogs.com/Jiangchuanwei/p/9100609.html
Copyright © 2011-2022 走看看