On Jun 21, 12:46 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 9:14 PM, Jeff FW <[EMAIL PROTECTED]> wrote: > > > I haven't yet used Django's dumpdata and loaddata, but I've used > > mysqldump about a million times. (That's mostly what we use at my > > job, though I've been slowly pushing us towards postgres.) Try > > adding: > > > /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, > > FOREIGN_KEY_CHECKS=0 */; > > > at the top of the file, and: > > > /*!40014 SET [EMAIL PROTECTED] */; > > > at the bottom. That *should* do it. Sorry if I'm suggesting > > something you've tried already. > > AFAICT, that's the same idea suggested on #3615. The discussion on > that ticket describes why it's not the final solution. > > Yours, > Russ Magee %-)
Ah, I didn't see that ticket link there. Good call. Assuming the data in a dumpfile is correct (which, of course, I know you can't), it is a valid solution. Meaning, maybe it could be a command-line flag for the loaddata command. If I *know* my data is valid, (say I just dumped it from a working database using foreign keys), then why not let me disable the checks when I load in the data? Running the script linked in the ticket afterwards would certainly be an improvement, but not essential in all cases. As for ordering the tables in the dumpfile: I agree that it might not be a general solution, as couldn't there be cycles in the foreign keys? Or is that not allowed? Anyway, it's certainly a better quickfix for AmanKow's situation than editing the dumpfile and rearranging the order of tables. -Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---