projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
973c9ee
)
Lock activities/users table during flake migration.
author
href
<href@random.sh>
Mon, 21 Jan 2019 12:10:48 +0000
(13:10 +0100)
committer
href
<href@random.sh>
Wed, 23 Jan 2019 10:26:37 +0000
(11:26 +0100)
priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
patch
|
blob
|
history
diff --git
a/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
b/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
index 6e5dfaa7734b25a6db73dc64b1faeb5aa9f4d81a..39d45f7e8be30f09a4fe4b79c2c0db3632cd0f9d 100644
(file)
--- a/
priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
+++ b/
priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
@@
-15,6
+15,10
@@
defmodule Pleroma.Repo.Migrations.UsersAndActivitiesFlakeId do
#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);"
+ # 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 users DROP CONSTRAINT users_pkey CASCADE;"