Files
archie/internal/infrastructure/postgres/queries/import.sql
T
sam cea88060b1 feat(archied): serve the State Store, event store and Gateway conversations from Postgres
The State Store's task and event-capture stores and the conversation store
read by archied and served by archie-gateway now open on database_url.
Every serving process refuses to start when legacy SQLite data exists and no
import completion is recorded, naming archie-state-store import; a fresh
install records completion itself. The Gateway holds its Postgres serve
claim for its lifetime and releases it before the pool closes.
2026-09-24 10:01:54 +10:00

12 lines
416 B
SQL

-- The one-time legacy import's completion record.
-- name: InsertImportCompletion :exec
INSERT INTO import_completion (id, sources, report) VALUES (1, $1, $2);
-- name: ImportCompleted :one
SELECT EXISTS (SELECT 1 FROM import_completion);
-- name: InsertFreshInstallCompletion :exec
INSERT INTO import_completion (id, sources, report) VALUES (1, '', 'fresh install: no legacy data')
ON CONFLICT (id) DO NOTHING;