OK, I solved it. 

Migrations attempted to modify auth.user, but it seems MYSQL checks the 
referential integrity of any child table with a FK to the table being 
modified. My child table had bad foreign keys, hence the error during 
migration.

Side note: whe way I got these foreign key errors was not because of a 
failure to cascade, or a glitch in the app, but rather because of how I 
initially populated my tests database using an SQL dump of various tables 
from the live database (but not the user table). It just so happens this 
particular table is used for quite generic records (user=null) as well as 
user-specific records, and I'd imported the whole lot. 

It makes sense that MYSQL allows you to import whatever you like in this 
fashion, but it means you need to be careful what you import. If you need 
to do an ad-hoc referential integrity check, here's a 
sproc: https://forums.mysql.com/read.php?20,137634

So this glitch doesn't/won't happen in the live database.

Anyway, back to resolving the myriad other things that are breaking due to 
the migration, yay!

Thanks for chipping in Dylan, it did actually help.

Andrew



 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ad673cc8-8676-4721-88e3-588aff7a3fe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to