Short Answer
Hard switch. Drizzle reads the live Postgres schema, not Prisma's migration history โ but if your schema is already correct, you can adopt Drizzle without losing data.
Detailed Answer
There is no automated Prisma โ Drizzle migration tool that's production-safe. What works in practice is: 1. Make sure your current Prisma migrations have produced the schema you actually want in production. 2. Hand-write a Drizzle `schema.ts` that matches the live DB. 3. Mark all existing tables as 'managed externally' in Drizzle's migration config (so Drizzle Kit doesn't try to drop them). 4. Switch the application code over and use Drizzle Kit only for new migrations going forward. Expect 2โ3 days of work for a medium-sized schema. The good news is that the data itself never moves โ Postgres doesn't care who is talking to it.
No answers yet
Be the first to answer this question!
Sign in to post an answer