diff options
author | Alex Gleason <alex@alexgleason.me> | 2022-01-22 15:58:40 -0600 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2022-01-22 15:58:40 -0600 |
commit | c368078cd0e09f3d1cc95ecba96cf42d460e1469 (patch) | |
tree | c84b52c352e2b2f4f366ff2e78c0ffefb4e40e62 | |
parent | a126a893582da7f7f78382bcba938a82ed26041b (diff) | |
download | pleroma-c368078cd0e09f3d1cc95ecba96cf42d460e1469.tar.gz |
ChangeObjectIdToFlake: lock tables
-rw-r--r-- | priv/repo/migrations/20211218181632_change_object_id_to_flake.exs | 7 |
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 |