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())`,