Ash FrameworkAF
Ash Framework5mo ago
4 replies
theopechli

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!
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 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!
Was this page helpful?