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'.
  • 相关阅读:
    javascript 杂记
    Sublime Text 3 杂记
    Visual Studio命令行工具
    iOS Crash日志
    Cocos引擎开发者指南(1-5)
    Linux防火墙配置(iptables, firewalld)
    jenkins使用git SCM时changelog乱码(Jenkins部署在Linux上,任务在Windows Slave上构建)
    C#枚举类型
    Java 实现大转盘抽奖
    HaspMap和ConcurrentHashMap
  • 原文地址:https://www.cnblogs.com/Jiangchuanwei/p/9100609.html
Copyright © 2011-2022 走看看