Add status column to items table

Items now have a status column ('pass' or 'fail', default 'pass') to
control publishing eligibility. Includes migration for existing databases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-02-02 15:46:33 -05:00
parent 6eaa39f9db
commit 26de5d3753
+6
View File
@@ -92,6 +92,9 @@ CREATE TABLE IF NOT EXISTS items (
image_urls JSONB, image_urls JSONB,
tags JSONB, tags JSONB,
-- Item status: 'pass' (default, eligible for publishing), 'fail' (rejected)
status TEXT NOT NULL DEFAULT 'pass',
-- Publishing to PDS -- Publishing to PDS
published_at TIMESTAMP, published_at TIMESTAMP,
published_uri TEXT, published_uri TEXT,
@@ -328,6 +331,9 @@ func OpenDatabase(connString string) (*DB, error) {
pool.Exec(ctx, "ALTER TABLE short_urls ADD COLUMN IF NOT EXISTS item_guid TEXT") pool.Exec(ctx, "ALTER TABLE short_urls ADD COLUMN IF NOT EXISTS item_guid TEXT")
} }
// Migration: add status column to items table (pass/fail for publishing)
pool.Exec(ctx, "ALTER TABLE items ADD COLUMN IF NOT EXISTS status TEXT NOT NULL DEFAULT 'pass'")
fmt.Println(" Schema OK") fmt.Println(" Schema OK")
// Run stats and background index creation // Run stats and background index creation