First time here? Check out the FAQ!
1

database migration failure

syncdb works fine, but ./manage.py migrate fails at

askbot:0012_delete_some_unused_models

with error:

django.db.utils.IntegrityError: (1217, 'Cannot delete or update a parent row: a foreign key constraint fails')

This is with askbot running as an app alongside our own django app. We also use south, our own migrations work fine.

One worry is that, even during the syncdb, django was reporting:

(1146, "Table 'anywhere.askbot_badgedata' doesn't exist")

But it didn't stop it from doing the syncdb, or the first few migrations. More possibly pertinent traceback:

! 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:   = CREATE TABLE `askbot_authkeyuserassociation`
 [etc etc]
hjwp's avatar
31
hjwp
asked 2011-11-24 11:56:01 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Looks like you are using MySQL. Could you check whether your tables use InnoDB storage, if so - please switch to MyISAM, this is the only constraint with MySQL we have currently and actually plan to just say that we do not support InnoDB.

Would it be a big problem to switch the storage engine for you?

Another actually better option is to switch to Postgres.

Evgeny's avatar
13.2k
Evgeny
updated 2011-11-24 12:03:20 -0600, answered 2011-11-24 12:02:37 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments