This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
Feature request: In-Database migration lock #425
Labels
datamodel-migrations
kind/feature
A request for a new feature.
team/migrations
Issue for team Migrations.
Problem
Consider deploying a Node.js server twice (because of horizontal scaling; maybe load balancing), and both of them would call a
prisma migrate up
while deploying. What could happen now is that Node.js server 1 tries to migrate while Node.js server 2 also tries the same. This could maybe result in conflicts within the database.Solution
A "In-Database" migration lock on a table designed specifically for locking.
Workflow would be as follows:
prisma migrate up
tries to create special table and maybe sets a boolean value indicating that a migration is runningprisma migrate up
sees the lock in the table and skips the migrationprisma migrate up
finishes, the lock within the database "unlocks"The text was updated successfully, but these errors were encountered: