Seed Resources with many-to-many relationships
Hello, I want to seed resources with many-to-many relationships. How would I accomplish this?
I am thinking of doing something silly, just reference the rows that were inserted, considering that I don't know the actual IDs, and then read them appropriately and bulk-create them.
Any ideas are welcome!
I am thinking of doing something silly, just reference the rows that were inserted, considering that I don't know the actual IDs, and then read them appropriately and bulk-create them.
Any ideas are welcome!
Solution
changeset generators. ended up doing what I said above, I basically created my own structs with the indices that I am interested in, and then just used
I also had to make the relationships on the many-to-many public so that I can
Anywho, thanks for the help!
Enum.at(foos, foo_index) to create the correct references.I also had to make the relationships on the many-to-many public so that I can
create them.Anywho, thanks for the help!
