Hi all, looking to confirm this question for deplo...
# prisma-migrate
j
Hi all, looking to confirm this question for deployment to production: From the docs:
Prisma Migrate makes use of advisory locking when you run production commands like: prisma migrate deploy
. Therefore, if I call
prisma migrate deploy
when my application is started, and there are multiple containers being deployed at the same time, other containers will sit on that advisory lock and not try to run migrations concurrently. Is that accurate?
p
Wouldn't it be more safe if you had one something like a container/deployment with env vars/Config specifying that this is the one that should run the migrations and take that in account in the deployment pipeline?
j
We do use that process for our other applications, but I wanted to explore streamlining deployment. If the migration fails, I'd prefer it also failed deployment altogether. Knex provides similar functionality for just this purpose.
Ah i just ran two migrations at the same time with just
SELECT sleep(15)
to confirm. Prisma will raise an error if a migration waits to acquire the advisory lock for more than 10 seconds. I think your right - these errors will confuse us in the long run, better to have a dedicated deployment for this.
👍 1