From f7b04c05439a28ab92977a8df778f2d250bed2ed Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Thu, 16 Apr 2026 23:40:22 -0700 Subject: [PATCH] =?UTF-8?q?fix(migrations):=20TEXT=E2=86=92UUID=20FK=20typ?= =?UTF-8?q?e=20mismatch=20blocking=20all=20E2E=20runs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrations 025 + 026 declared workspace_id/org_id as TEXT but workspaces.id is UUID — Postgres rejects the FK constraint, crashing every E2E run on main since these migrations were merged. Co-Authored-By: Claude Opus 4.6 (1M context) --- platform/migrations/025_workspace_token_usage.up.sql | 2 +- platform/migrations/026_org_plugin_allowlist.up.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/migrations/025_workspace_token_usage.up.sql b/platform/migrations/025_workspace_token_usage.up.sql index acec2090..e396356d 100644 --- a/platform/migrations/025_workspace_token_usage.up.sql +++ b/platform/migrations/025_workspace_token_usage.up.sql @@ -4,7 +4,7 @@ -- (default: Claude Sonnet input $3/1M, output $15/1M). CREATE TABLE IF NOT EXISTS workspace_token_usage ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - workspace_id TEXT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE, + workspace_id UUID NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE, period_start TIMESTAMPTZ NOT NULL, input_tokens BIGINT NOT NULL DEFAULT 0, output_tokens BIGINT NOT NULL DEFAULT 0, diff --git a/platform/migrations/026_org_plugin_allowlist.up.sql b/platform/migrations/026_org_plugin_allowlist.up.sql index f2d12353..d7728e32 100644 --- a/platform/migrations/026_org_plugin_allowlist.up.sql +++ b/platform/migrations/026_org_plugin_allowlist.up.sql @@ -7,7 +7,7 @@ -- enabled_by records the workspace ID of the admin who added the entry. CREATE TABLE IF NOT EXISTS org_plugin_allowlist ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - org_id TEXT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE, + org_id UUID NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE, plugin_name TEXT NOT NULL, enabled_by TEXT NOT NULL, enabled_at TIMESTAMPTZ NOT NULL DEFAULT NOW()