Skip to content

Commit

Permalink
Add lock to tracks table for migration (#6998)
Browse files Browse the repository at this point in the history
  • Loading branch information
theoilie authored Dec 20, 2023
1 parent 9e3dd6e commit b2c900e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
begin;

SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE state = 'active' and pid <> pg_backend_pid();
lock table tracks in access exclusive mode;

UPDATE tracks
SET release_date = created_at
WHERE release_date IS NULL;
Expand Down

0 comments on commit b2c900e

Please sign in to comment.