I've only used `prisma db push` so far, now `prism...
# orm-help
r
I've only used
prisma db push
so far, now
prisma migrate dev
wants to reset the database but I already have data in it. How can I keep it or easily copy it?
d
prisma migrate dev --create-only
&&
prisma migrate resolve --applied {{name of migration}}
if your database is in sync with your schema then you should have no issues
r
--create-only also wants to reset it
it is in sync, just never ran migrate before
d
point it at an empty database to generate the migration
then apply it to your current database
it should be happy
r
ok, it generated the migration, but still wants to reset the non-empty db
d
can you commit everything and run
yarn db introspect
your db may be out of sync with your schema
r
npx prisma db push --preview-feature
says The database is already in sync with the Prisma schema.
d
did you apply the migration to the non-empty db?
r
no
d
prisma migrate resolve --applied {{name of migration}}
🙌 2
r
Already in sync, no schema change or pending migration was found.
Thanks!
d
no problem