Lock issues / deadlock during postgres migration

The CREATE TABLE IF NOT EXISTS drizzle.__drizzle_migrations command that runs at the start of every drizzle migration creates a lock, and then my ALTER TABLE command inside the migration is unable to obtain the AccessExclusiveLock it requires.

Is there a way to run these in separate transactions? Or is there another approach to get around this?

Attached a pic of the db logs showing the lock, and my migration code. Using postgres-js
Logs-lock-beingheld.png
image.png
Was this page helpful?