From fa6b5b5ba3223d9fea8d693d48e7ae3fadecd9fe Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Thu, 26 Mar 2026 17:17:23 +0800 Subject: [PATCH] fix(db): make inbox_actor migration idempotent The renumbered 012_inbox_actor migration fails on databases where the old 009_inbox_actor was already applied, since actor_type and actor_id columns already exist. Use IF NOT EXISTS to handle both cases. Co-Authored-By: Claude Opus 4.6 --- server/migrations/012_inbox_actor.up.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/migrations/012_inbox_actor.up.sql b/server/migrations/012_inbox_actor.up.sql index 81afe758..5784870b 100644 --- a/server/migrations/012_inbox_actor.up.sql +++ b/server/migrations/012_inbox_actor.up.sql @@ -1,2 +1,2 @@ -ALTER TABLE inbox_item ADD COLUMN actor_type TEXT; -ALTER TABLE inbox_item ADD COLUMN actor_id UUID; +ALTER TABLE inbox_item ADD COLUMN IF NOT EXISTS actor_type TEXT; +ALTER TABLE inbox_item ADD COLUMN IF NOT EXISTS actor_id UUID;