epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.47k stars 368 forks source link

Vitest fails after Prisma migration #674

Closed andrecasal closed 4 months ago

andrecasal commented 6 months ago

I migrated the DB to a simpler format.

Naturally, this got the testing database at ./tests/prisma/base.db out of sync with the Prisma client and most Vitest tests fail.

It would be nice if, everytime we run a migration, we also delete the test database so that Vitest setup re-runs the setup and copies ./prisma/data.db over to ./tests/prisma/base.db.

kentcdodds commented 6 months ago

Running migrations just takes a while so we cache it. We could add logic that checks the modified time of the schema to determine whether the database should be updated. Shouldn't be super complicated. PRs welcome!