Better migration locking behaviour

This commit is contained in:
2019-10-22 13:41:21 +02:00
parent 5aced1b8b1
commit 6ab4c1e4d3
6 changed files with 32 additions and 2 deletions

3
sql/migrations/lock.sql Normal file
View File

@@ -0,0 +1,3 @@
WITH rows as (
UPDATE migrations_lock SET is_locked = true WHERE is_locked = false RETURNING 1
) SELECT COUNT(*) FROM rows;