remix-run / blues-stack

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
961 stars 236 forks source link

Fix prisma seed #13

Closed sync closed 2 years ago

sync commented 2 years ago

I noticed that seeding wasn't working, fixed it following this guide.

Also rewrote it to do upsert so subsequent seeds would not fail.

Before:

➜  blues-stack git:(main) npx prisma db seed
Environment variables loaded from .env
Running seed command `node --require esbuild-register prisma/seed.ts` ...

🌱  The seed command has been executed.

After:

➜  blues-stack git:(fix/non-functional-prisma-seed) npx prisma db seed     
Environment variables loaded from .env
Running seed command `node --require esbuild-register prisma/seed.ts` ...
Database has been seeded. 🌱

🌱  The seed command has been executed.