Closed zspencer closed 1 month ago
Hmm, I don't think I've used db:seeds:replant
, mostly because the projects I've been on in the last half decade have relied (perhaps too) heavily on anonymized production data; rather than a seed file.
I can start working db:seeds:replant
into my workflow and see if that gets me out of wanting them to be idempotent.
Interesting, I believe I agree with @anaulin here because I would expect to only run the primary seed on a clean database. However, I ok with the idea of having secondary seeds for setting up the app for a particular use case. Like rails db:seed:space:marketplace:ready
that would act similar to factories in test setup. Although I don't feel like our app is complicated enough yet to warrant that. We find more bugs doing it all manually 😅
It turns out, running
rails db:seed
multiple times kept resulting in errors or duplicious data.This makes it a bit easier to run multiple times, which can be helpful when making a change that also wants to update the seeds