summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-01-22 15:58:40 -0600
committerAlex Gleason <alex@alexgleason.me>2022-01-22 15:58:40 -0600
commitc368078cd0e09f3d1cc95ecba96cf42d460e1469 (patch)
treec84b52c352e2b2f4f366ff2e78c0ffefb4e40e62
parenta126a893582da7f7f78382bcba938a82ed26041b (diff)
ChangeObjectIdToFlake: lock tables
-rw-r--r--priv/repo/migrations/20211218181632_change_object_id_to_flake.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/priv/repo/migrations/20211218181632_change_object_id_to_flake.exs b/priv/repo/migrations/20211218181632_change_object_id_to_flake.exs
index 117579052..bc6f920b0 100644
--- a/priv/repo/migrations/20211218181632_change_object_id_to_flake.exs
+++ b/priv/repo/migrations/20211218181632_change_object_id_to_flake.exs
@@ -33,6 +33,13 @@ defmodule Pleroma.Repo.Migrations.ChangeObjectIdToFlake do
"""
def up do
+ # Lock tables to avoid a running server meddling with our transaction
+ execute("LOCK TABLE objects")
+ execute("LOCK TABLE data_migration_failed_ids")
+ execute("LOCK TABLE chat_message_references")
+ execute("LOCK TABLE deliveries")
+ execute("LOCK TABLE hashtags_objects")
+
# Switch object IDs to FlakeIds
execute(fn ->
try do