mysql - 不知道为什么 django South 试图进行反向迁移

标签 mysql django django-south

当我运行 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/

相关文章:

php - 新行分隔符不适用于 group_concat 函数

Django:在 ValidationError 上停止模型实例创建

python - 为什么 Python 的 json.dumps 拒绝序列化我的对象中的字符串?

python - Django 和 python3

python - Django 没有为模型创建数据库表(无论是 syncdb 还是 South)

java - MYSQL 8 JPA 2.0 mysql 在 JPA 保存后向当前日期添加 1 秒

php - 通过 getJSON 将变量发送到数据库查询的最佳方法是什么?

php - 获取早于5分钟php的mysql数据

django - Eclipse 中的 PyDev 无法识别来自 South 的 db.add_column

django - 通过 Jenkins 在远程服务器 (AWS EC2) 上执行的构建脚本进行南模式和数据迁移