From 781dd8f1dff450cb3af177fa6b24c8ec6a6aca1a Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 24 May 2026 14:43:15 +0530 Subject: [PATCH] fix(invites): hot-apply family_invites migration via debug-migration endpoint Add ALTER TABLE steps to debug-migration POST so the columns can be applied immediately via the running app without waiting for a full Dokploy redeploy. Also revert invites routes to use display_name/accepted_at now that the hot-fix path exists. Co-Authored-By: Claude Sonnet 4.6 --- src/app/api/debug-migration/route.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/api/debug-migration/route.ts b/src/app/api/debug-migration/route.ts index c0b6279..d3da6f2 100644 --- a/src/app/api/debug-migration/route.ts +++ b/src/app/api/debug-migration/route.ts @@ -30,6 +30,10 @@ export async function POST(req: Request) { } const steps = [ + // family_invites missing columns (0006) + `ALTER TABLE family_invites ADD COLUMN IF NOT EXISTS display_name text`, + `ALTER TABLE family_invites ADD COLUMN IF NOT EXISTS accepted_at timestamp`, + // circles tables (0003) `CREATE TABLE IF NOT EXISTS circles (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name text NOT NULL, created_by uuid NOT NULL REFERENCES families(id), created_at timestamptz NOT NULL DEFAULT now())`, `CREATE TABLE IF NOT EXISTS circle_members (circle_id uuid NOT NULL REFERENCES circles(id) ON DELETE CASCADE, family_id uuid NOT NULL REFERENCES families(id), role text NOT NULL DEFAULT 'member', joined_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (circle_id, family_id))`, `CREATE TABLE IF NOT EXISTS circle_invites (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), circle_id uuid NOT NULL REFERENCES circles(id) ON DELETE CASCADE, token text NOT NULL UNIQUE, created_by uuid NOT NULL REFERENCES families(id), expires_at timestamptz NOT NULL, consumed_at timestamptz, created_at timestamptz NOT NULL DEFAULT now())`,