From 8b4b54400948ce06b68166cdc2c8e0a1e23374af Mon Sep 17 00:00:00 2001 From: scanash00 Date: Thu, 13 Aug 2026 21:44:17 +0000 Subject: [PATCH] fix migrations --- migrations/20260813_record_blobs_backfill_marker.sql | 10 +++++++++- migrations/20260814_database_hot_path_indexes.sql | 5 ++++- 2 file(s) changed, 13 insertion(s)(+), 2 deletion(s)(-) diff --git a/migrations/20260813_record_blobs_backfill_marker.sql b/migrations/20260813_record_blobs_backfill_marker.sql --- a/migrations/20260813_record_blobs_backfill_marker.sql +++ b/migrations/20260813_record_blobs_backfill_marker.sql @@ -2,4 +2,12 @@ ADD COLUMN record_blobs_backfilled_at TIMESTAMPTZ; ALTER TABLE repos - ALTER COLUMN record_blobs_backfilled_at SET DEFAULT NOW(); \ No newline at end of file + ALTER COLUMN record_blobs_backfilled_at SET DEFAULT NOW(); + +UPDATE repos r +SET record_blobs_backfilled_at = NOW() +WHERE EXISTS ( + SELECT 1 + FROM record_blobs rb + WHERE rb.repo_id = r.user_id +); \ No newline at end of file diff --git a/migrations/20260814_database_hot_path_indexes.sql b/migrations/20260814_database_hot_path_indexes.sql --- a/migrations/20260814_database_hot_path_indexes.sql +++ b/migrations/20260814_database_hot_path_indexes.sql @@ -7,4 +7,7 @@ CREATE INDEX IF NOT EXISTS idx_users_lower_email ON users (LOWER(email)) - WHERE email IS NOT NULL; \ No newline at end of file + WHERE email IS NOT NULL; + +UPDATE repos +SET record_blobs_backfilled_at = NULL; \ No newline at end of file -- tangled.sh