我刚刚遇到了一个问题,south
似乎在两次迁移之间感到困惑。
最后 (4) 次迁移:
我有一张桌子:
class VulnFuzz(models.Model):
fuzzVector = models.CharField(max_length=200)
FkToVulnTbl = models.ForeignKey(Vuln)
我想将该表更改为其他内容:
class VulnFizz(models.Model):
fizzVector = models.CharField(max_length=200)
FkToVulnTbl = models.ForeignKey(Vuln)
问题是,当我运行时:
python manage.py schemamigration Scanner --auto
它说然后迁移它,所以我使用:
python manage.py migrate Scanner
它说:
Migrating forwards to 0041_auto__del_field_vulnfizz_FkToVulnTbl.
> Scanner:0032_auto__chg_field_vulnfuzz_FkToVulnTbl__del_index_vulnfuzz_FkToVulnTbl
FATAL ERROR - The following SQL query failed: DESCRIBE `Scanner_vulnfuzz`
The error was: (1146, "Table 'vulnawarefinal.scanner_vulnfuzz' doesn't exist")
! Error found during real run of migration! Aborting.
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
! You *might* be able to recover with: = CREATE INDEX `Scanner_vulnfuzz_30a95dc2` ON `Scanner_vulnfuzz` (`FkToVulnTbl_id`);
我已经尝试运行更改表之前的建议:
CREATE INDEX `Scanner_vulnfuzz_30a95dc2` ON `Scanner_vulnfuzz` (`FkToVulnTbl_id`)
但这并没有解决它。
我现在很茫然,我该如何解决这个问题?还是我应该重做整个数据库?
谢谢