Commit5214d1aunknown_key
Fix migration 0087: pr_previews FK columns must be uuid, not text
Fix migration 0087: pr_previews FK columns must be uuid, not text repositories.id and pull_requests.id are uuid, so the text-typed repo_id/pr_id columns made the CREATE TABLE fail with 'foreign key constraint cannot be implemented' on every migration run since the file shipped (2026-06-07). The runner halts at the first failure, so migrations 0088-0104 never applied — including 0099, which adds users.notify_smart_digest. Code newer than 0099 selects that column on every user/session lookup, which is what turned /login (and every authed request) into a 500 on a database stuck before 0099. Verified by initializing a fresh Postgres 16, running the full chain (0000-0104 now apply cleanly), then exercising register, login, session-authed pages, and the Google OAuth admin + redirect flow against the live server. https://claude.ai/code/session_01BCaibgckcvsuGmByyn8d8L
1 file changed+2−25214d1ac962ea31f4c5c9520dadbea3e3c07e45a
1 changed file+2−2
Modifieddrizzle/0087_pr_preview_builder.sql+2−2View fileUnifiedSplit
@@ -17,8 +17,8 @@ ALTER TABLE repositories ADD COLUMN IF NOT EXISTS preview_output_dir text DEFAUL
1717-- ── pr_previews ─────────────────────────────────────────────────────────────
1818CREATE TABLE IF NOT EXISTS pr_previews (
1919 id serial PRIMARY KEY,
20 repo_id text NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
21 pr_id text NOT NULL REFERENCES pull_requests(id) ON DELETE CASCADE,
20 repo_id uuid NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
21 pr_id uuid NOT NULL REFERENCES pull_requests(id) ON DELETE CASCADE,
2222 branch_name text NOT NULL,
2323 head_sha text NOT NULL,
2424 status text NOT NULL DEFAULT 'building', -- building | ready | failed
2525