seed_dump icon indicating copy to clipboard operation
seed_dump copied to clipboard

Doesn't handle foreign keys.

Open cjheath opened this issue 10 years ago • 6 comments

Needs to delay emitting any record that has a foreign key to another one which hasn't yet been dumped. In the case of circular associations this means it may need to insert multiple separate batches of the same record type.

cjheath avatar Jun 17 '15 02:06 cjheath

True, this is affecting me too, would be nice to see it solved.

eduwass avatar Nov 30 '15 16:11 eduwass

For googlers The temporary fix is to copy-paste the blocks into an order so that no records depend on a record that doesn't exist yet. Unfortunately, circular associations don't seem to work whatsoever at this time

kieraneglin avatar Apr 11 '16 15:04 kieraneglin

Copy-pasting blocks around only works if you've never deleted any records from the database. Otherwise, the id's of items created after any deletes will no longer be the same after seeding (since seeding it just auto-incrementing the id's).

misha-velichansky avatar May 12 '16 14:05 misha-velichansky

Pull request submitted.

GarthSnyder avatar May 17 '16 23:05 GarthSnyder

I'm also looking for this support. Thanks.

rxaviers avatar Sep 11 '16 18:09 rxaviers

+1

mvastola avatar Aug 18 '17 03:08 mvastola