If I add code to my seed file to seed more tables,...
# orm-help
c
If I add code to my seed file to seed more tables, then re-run
prisma db seed --preview-feature
is that going to add duplicate seed data to previously seeded tables?
r
@Chris Tsongas 👋 Yes. You would need to add a check for the records if those are already added. Best to split those into separate functions and only call what’s needed for the latest migration.
c
@Ryan thanks. Seems like it would be ideal to also share those functions with integration tests that need seed data...know of any examples I could reference?
r
I would need to check if there are any examples, but you can always run
prisma db seed
before the test.
c
I just set up Apollo Server but have yet to start setting up tests. I remember reading about people generating random test database names so multiple tests can run in parallel, each against their own test database...would be amazing to see an example of that!
r
Ohh I do have an example for that here!
🙌 1