I am changing from a profile model setup, to extending the User model. I am trying to get my South migrations set up according to this guide. I have a few other models that reference the User model, and so when I auto-generate my schema migration I get lines along the lines of:
db.alter_column(u'app_model', 'user',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['app.user']))
The problem is these migrations cause South to break when I try and migrate:
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
Note: this is a migration created with ./manage.py schemamigration app --auto
. I haven't edited it.
The thing is, do I care? The type of the reference stored in the database is the same, and I've done the step of renaming the table. Everything seems to continue working if I remove the alter_table
lines from the migration. Is this a terrible, terrible idea, or is it ok?