From 05b0cdbbaf2019daa4bebb74987132e2767c8497 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Fri, 15 Nov 2024 06:13:19 +1300 Subject: [PATCH] tweak migration --- migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py b/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py index ce8aac50..cf84f9e2 100644 --- a/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py +++ b/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py @@ -72,7 +72,9 @@ def upgrade(): conn.execute(text('DELETE FROM "instance_role" WHERE user_id = :old_id'), {"old_id": old_id}) conn.execute(text('DELETE FROM "mod_log" WHERE user_id = :old_id'), {"old_id": old_id}) conn.execute(text('UPDATE "chat_message" SET sender_id = :new_id WHERE sender_id = :old_id'), {"new_id": new_id, "old_id": old_id}) + conn.execute(text('UPDATE "conversation" SET user_id = :new_id WHERE user_id = :old_id'), {"new_id": new_id, "old_id": old_id}) conn.execute(text('UPDATE "chat_message" SET recipient_id = :new_id WHERE recipient_id = :old_id'), {"new_id": new_id, "old_id": old_id}) + conn.execute(text('DELETE FROM "conversation_member" WHERE user_id = :old_id'), {"new_id": new_id, "old_id": old_id}) conn.execute(text('UPDATE "community" SET user_id = :new_id WHERE user_id = :old_id'), {"new_id": new_id, "old_id": old_id}) conn.execute(text('UPDATE "domain_block" SET user_id = :new_id WHERE user_id = :old_id'), {"new_id": new_id, "old_id": old_id}) conn.execute(text('UPDATE "community_block" SET user_id = :new_id WHERE user_id = :old_id'), {"new_id": new_id, "old_id": old_id})