Search code examples
postgresqlprisma

Is there a way to use prisma and do a live migration without data loss


Is there a way to use Prisma ORM to do a database migration (either when adding a new column, adding a new constraint etc.) in production without data loss. I know that when you apply a new column change, that that will break SQL's constraints since the column will be required.

Is there a better approach to this than just creating a script and manually reapplying everything and writing SQL yourself as this post says. A simple "no" with an argument is acceptable, just want to make sure I am not missing anything.


Solution

  • I've searched far and wide and it seems that there is no way to do this with prisma, rather by using the migration command and using the generated sql script (and modifying them) on the production database. Seems like we don't have everything automated.