#Migration issue with development & production DB(MySql)

5 messages · Page 1 of 1 (latest)

languid sail
#

Can we add/remove column/table into development DB directly and pull changes to schema and generate migration without Data loss of development DB and as well as migration applies to production DB

Whenever we RUN npx prisma migrate dev to generate migration from direct change of development DB

Its always shows drift and data loss warning

molten rapids
languid sail
#

by npx prisma db pull its update the schem.prisma file in development database But we want to add thoes development DB changes to production DB so for that we should require migration so when we run npx prisma db migrate dev in development DB its warn for Data Loss

so is there any way to generate migration in development DB without DATA LOSS and apply/deploy development DB migration to Production DB

languid sail
# molten rapids Hey 👋 If you directly make the changes to the database then you can invoke `n...

by npx prisma db pull its update the schem.prisma file in development database But we want to add thoes development DB changes to production DB so for that we should require migration so when we run npx prisma db migrate dev in development DB its warn for Data Loss

so is there any way to generate migration in development DB without DATA LOSS and apply/deploy development DB migration to Production DB

amber mortar
#

please help answer this