プロファイル モデルのセットアップから、ユーザー モデルの拡張に変更しています。このガイドに従って南部への移行を設定しようとしています。User モデルを参照するモデルが他にもいくつかあるため、スキーマの移行を自動生成すると、次のような行が表示されます。
db.alter_column(u'app_model', 'user',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['app.user']))
問題は、これらの移行により、移行しようとすると South が壊れることです。
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
移行から行を削除すると、すべてが引き続き機能するようです。これはひどい、ひどい考えですか、それとも大丈夫ですか?