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