把数据库的的表全部删除,再重新 migrate
报错信息如下:
Traceback (most recent call last):File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 43, in run_module(manage_file, None, '__main__', True)File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 205, in run_modulereturn _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_codemod_name, mod_spec, pkg_name, script_name)File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_codeexec(code, run_globals)File "/Users/h/Desktop/py/MxOnline/manage.py", line 15, in 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_lineutility.execute()File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in executeself.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_argvself.execute(*args, **cmd_options)File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/base.py", line 335, in executeoutput = self.handle(*args, **options)File "/Users/h/Desktop/pyenv/h1/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 82, in handleexecutor.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_historyconnection.alias,
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.