Ask Your Question
1

database migration failure

asked 2011-11-24 11:56:01 -0600

hjwp gravatar image

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]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-11-24 12:02:37 -0600

Evgeny gravatar image

updated 2011-11-24 12:03:20 -0600

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-11-24 11:56:01 -0600

Seen: 1,669 times

Last updated: Nov 24 '11