From c368078cd0e09f3d1cc95ecba96cf42d460e1469 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 22 Jan 2022 15:58:40 -0600 Subject: ChangeObjectIdToFlake: lock tables --- priv/repo/migrations/20211218181632_change_object_id_to_flake.exs | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3