Lock activities/users table during flake migration.

This commit is contained in:
href 2019-01-21 13:10:48 +01:00
parent 973c9eed18
commit 465fb4327d
No known key found for this signature in database
GPG key ID: EE8296C1A152C325

View file

@ -15,6 +15,10 @@ def change do
#execute "update activities set external_id = CAST( LPAD( TO_HEX(id), 32, '0' ) AS uuid);" #execute "update activities set external_id = CAST( LPAD( TO_HEX(id), 32, '0' ) AS uuid);"
#execute "update users set external_id = CAST( LPAD( TO_HEX(id), 32, '0' ) AS uuid);" #execute "update users set external_id = CAST( LPAD( TO_HEX(id), 32, '0' ) AS uuid);"
# Lock both tables to avoid a running server to meddling with our transaction
execute "LOCK TABLE activities;"
execute "LOCK TABLE users;"
execute "ALTER TABLE activities DROP CONSTRAINT activities_pkey CASCADE;" execute "ALTER TABLE activities DROP CONSTRAINT activities_pkey CASCADE;"
execute "ALTER TABLE users DROP CONSTRAINT users_pkey CASCADE;" execute "ALTER TABLE users DROP CONSTRAINT users_pkey CASCADE;"