0
我正在从配置文件模型设置更改为扩展用户模型。我试图根据this guide设置我的南迁。我有一个用户参考模型中的其他几个车型,所以当我自动生成我的架构迁移我相处的线线:alter_column迁移失败,我关心吗?
db.alter_column(u'app_model', 'user',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['app.user']))
的问题是这些迁移的原因南部打破当我尝试迁移:
FATAL ERROR - The following SQL query failed: INSERT INTO "_south_new_app_model"() SELECT FROM "app_model";
The error was: near ")": syntax error
! 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:
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: app:0018_auto__chg_field_model_user.py
DatabaseError: near ")": syntax error
注:这是./manage.py schemamigration app --auto
创建的迁移。我没有编辑它。
事情是,我关心吗?存储在数据库中的引用类型是相同的,我已经完成了重命名表的步骤。如果我从迁移中删除alter_table
行,似乎所有东西都会继续工作。这是一个可怕的,可怕的想法,还是可以吗?
你在使用什么数据库引擎?我认为是的,当有错误时,您应该始终关心。也许它现在的作品,但后来有明星出现的错误,你甚至不记得你忽略了过去的错误:) – 2013-04-29 15:31:14
@Paulo这只是在一个测试数据库运行sqlite3(我猜是一部分问题)。我的生产数据库是MySQL。我可以用另一个mysql实例进行测试,但如果可能的话,我宁愿避免它。 – fredley 2013-04-29 15:55:45