Shane
03/24/2021, 2:59 PMprisma migrate
with an existing DB (without resetting/losing my data), and finding the docs quite confusing -> https://www.prisma.io/docs/guides/application-lifecycle/add-prisma-migrate-to-a-project#baseline-your-production-environment
It suggests using prisma migrate dev
to establish a new migration history, but this tries to run a migration -- and fails, saying it's out of sync.
Anyone able to show me the way? 🙏Ryan
03/24/2021, 3:01 PMShane
03/24/2021, 3:03 PMprisma migrate dev
command, and it wants to reset the db 😕Shane
03/24/2021, 3:03 PM› npx prisma migrate dev
Environment variables loaded from ../.env
Prisma schema loaded from schema.prisma
Datasource "db": MySQL database "appdb" at "127.0.0.1:3306"
? Drift detected: Your database schema is not in sync with your migration history.
We need to reset the MySQL database "appdb" at "127.0.0.1:3306".
Do you want to continue? All data will be lost. › (y/N)
Ryan
03/24/2021, 3:05 PMShane
03/24/2021, 3:06 PMRyan
03/24/2021, 3:07 PMprisma migrate dev
on dev and then Baselining on prod.Shane
03/24/2021, 3:07 PMRyan
03/24/2021, 3:07 PMprisma introspect
before dev as per the docs to get the schema in place 🙂Shane
03/24/2021, 3:08 PM