DT
Drizzle Team•3w ago
Jack

Complex seeding tasks

Heyo, I am just transitioning to drizzle-seed, but I am struggling to replicate the power I had with my monolithic file of for loops. One example is we have a table called week_number_systems which holds things like ISO 8601, US Sunday etc. Then, we run a task to populate another table called week_definitions. The week definitions table has each row represent a week, and a week number system can have many week definitions (one to many). This is so that our app's schedule is dynamic, and can support any type of week. The week definition has a starts_at and ends_at, as well as a year and week (because 1 day, can have have a different week number or year as per ISO 8601 or US Sunday). I am thinking, with Drizzle seed (which is an amazing package by the way) is it possible to seed things like the week definition, where the week numbering system is ISO 8601, and as such each week starts on a monday? 😅
2 Replies
Jack
JackOP•3w ago
I have the utilities to generate as many weeks, I guess all I need is a way to say "this array of weeks is ISO 8601, so the foreign key relates to the ISO 8601 row. And this array of weeks is US Sunday, so these relate to the US Sunday row"
chawn
chawn•3d ago
What were you using before drizzle-seed? I'm new to drizzle and it feels like I'm better off just using the ORM with faker over drizzle-seed in its current state.

Did you find this page helpful?