问题描述
$ py manage.py migrate turkey
Running migrations for turkey:
- Migrating forwards to 0001_initial.
> turkey:0001_initial
! 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: = DROP TABLE `turkey_demorecs` CASCADE; []
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS.
! NOTE: The error which caused the migration to fail is further up.
由于某些原因,我尝试了这个。
但我的其他设置在MyISAM中。
For some reason I get this when I try it.But my other setups are in MyISAM.
为什么Innodb不起作用?
Why doesn't it work in Innodb?
推荐答案
InnoDB对外键具有约束,确保在进行迁移时不会破坏数据库模型。 (请参阅)
InnoDB has constraints on Foreign Keys which ensure you are not breaking the database model when doing a migration. (see http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html)
MyISAM没有对约束的本机支持(尽管似乎如果您选择做)
MyISAM does not have native support for constraints (although it seems you can implement this if you choose to do do http://dev.mysql.com/tech-resources/articles/mysql-enforcing-foreign-keys.html)
由于MyISAM没有检查您的FK关系,你没有得到错误。 InnoDB正在做一个支票,似乎您的迁移有问题。
Because MyISAM is not checking your FK relationships, you do not get the error. InnoDB however is doing a check and it seems that you have a problem with your migration.
这篇关于Django的南部(迁移工具)是否适用于innodb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!