From 86d669e08e06d3faceba06d7a24a4460d15bcbd1 Mon Sep 17 00:00:00 2001 From: primal Date: Mon, 2 Feb 2026 00:35:53 -0500 Subject: [PATCH] Make oauth_sessions.access_token nullable Session is created before tokens are obtained during OAuth flow. Co-Authored-By: Claude Opus 4.5 --- db.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db.go b/db.go index 611afd0..b3a2993 100644 --- a/db.go +++ b/db.go @@ -225,6 +225,8 @@ func OpenDatabase(connString string) (*DB, error) { } // Add token_expiry column if missing (used by OAuth library) pool.Exec(ctx, "ALTER TABLE oauth_sessions ADD COLUMN IF NOT EXISTS token_expiry TIMESTAMP") + // Make access_token nullable (session created before tokens obtained) + pool.Exec(ctx, "ALTER TABLE oauth_sessions ALTER COLUMN access_token DROP NOT NULL") // Migration: rename feed columns for consistent terminology // last_crawled_at -> last_checked_at (feed_check = checking feeds for new items)