我有一个名为“robots”的应用程序并使用了它的 0.9 版本
后来我发现 0.9 有一个我不想要的功能并降级到 0.8
一段时间后,我尝试对我的项目进行南迁移并遇到错误south.exceptions.NoMigrations: Application '<module 'robots' from '/home/ubuntu/virtualenvs/codingqna/local/lib/python2.7/site-packages/robots/__init__.pyc'>' has no migrations.
我猜 0.9 有迁移文件,但 0.8 没有,而南正在提示它。
我如何从南方的历史中删除它,就像它从未存在过一样? (就像我从一开始就使用 0.8 没有迁移文件)
或者我可以在这里使用任何其他方式?
最佳答案
delete from south_migrationhistory where app_name='robots';
South_migrationhistory 表只跟踪已应用的迁移和尚未应用的迁移。由于 0.8 的机器人没有任何迁移文件,因此可以删除表 south_migrationhistory 中的任何条目,并且不会影响其他任何内容。
关于django - 从南迁移历史中删除迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17586144/