gpt4 book ai didi

mysql - 不确定为什么 django South 试图运行反向迁移

转载 作者:行者123 更新时间:2023-11-29 01:44:36 26 4
gpt4 key购买 nike

当我运行 python manage.py migrate api 时,它失败并显示“RuntimeError:无法撤消此迁移。”

问题是,我不确定为什么它甚至会尝试运行反向迁移?失败的文件是0025,MySQL数据库的south_migrationhistory表中没有提到。

知道为什么 South 会尝试使用此命令运行反向迁移吗?

谢谢!

编辑:

完整的堆栈跟踪是:

Running migrations for api:
- Migrating forwards to 0026_auto.
> api:0025_auto__chg_field_article_curator_response_comment__chg_field_article_cu
Traceback (most recent call last):
File "manage.py", line 14, in <module> execute_manager(settings)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager utility.execute()
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(*args, **options)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle ignore_ghosts = ignore_ghosts,
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/__init__.py", line 191, in migrate_app success = migrator.migrate_many(target, workplan, database)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many result = self.migrate(migration, database)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate result = self.run(migration)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run return self.run_migration(migration)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 86, in run_migration print self.run_migration_error(migration)
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 286, in run_migration_error (self.format_backwards(migration), extra_info))
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 273, in format_backwards self.backwards(migration)()
File "/home/ubuntu/fake-env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 57, in <lambda> return (lambda: direction(orm))
File "/home/ubuntu/fakeapi/fakeapi/../fakeapi/api/migrations/0025_auto__chg_field_article_curator_response_comment__chg_field_article_cu.py", line 42, in backwards raise RuntimeError("Cannot reverse this migration. 'Image.article' and its values cannot be restored.")
RuntimeError: Cannot reverse this migration. 'Image.article' and its values cannot be restored.

最佳答案

它遇到了一个迁移错误,并试图回滚它。您可以暂时清理向后迁移并查看真正的错误是什么。

关于mysql - 不确定为什么 django South 试图运行反向迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10289106/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com