From 08ff9277e7dd96b1aaafa2a610ea9ff959f66615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Thu, 11 Jun 2026 18:31:24 +0200 Subject: [PATCH] Drop enrichment_attempts default after backfill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Columns must not carry DEFAULT clauses. The DEFAULT only backfills existing rows when the non-nullable column is added, so drop it in the same migration; inserts already supply enrichment_attempts explicitly. Signed-off-by: Émile Ré --- pkg/coredata/migrations/20260609T120000Z.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/coredata/migrations/20260609T120000Z.sql b/pkg/coredata/migrations/20260609T120000Z.sql index 6e86b427a..fd78379c3 100644 --- a/pkg/coredata/migrations/20260609T120000Z.sql +++ b/pkg/coredata/migrations/20260609T120000Z.sql @@ -21,6 +21,13 @@ ADD ADD COLUMN enrichment_attempts INTEGER NOT NULL DEFAULT 0; +-- The DEFAULT only backfills existing rows; drop it so inserts must +-- supply the value explicitly. +ALTER TABLE + common_third_parties +ALTER COLUMN + enrichment_attempts DROP DEFAULT; + -- Partial index backs the enrichment worker's claim query, which polls -- only rows currently queued for enrichment. CREATE INDEX common_third_parties_enrichment_requested_at_idx