From 8b4b54400948ce06b68166cdc2c8e0a1e23374af Mon Sep 17 00:00:00 2001 From: scanash00 Date: Thu, 13 Aug 2026 13:44:17 -0800 Subject: [PATCH] fix migrations --- migrations/20260813_record_blobs_backfill_marker.sql | 10 +++++++++- migrations/20260814_database_hot_path_indexes.sql | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/migrations/20260813_record_blobs_backfill_marker.sql b/migrations/20260813_record_blobs_backfill_marker.sql index b667851..6c5f1e8 100644 --- a/migrations/20260813_record_blobs_backfill_marker.sql +++ b/migrations/20260813_record_blobs_backfill_marker.sql @@ -2,4 +2,12 @@ ALTER TABLE repos 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 index eeb9a46..f8e2be6 100644 --- 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_comms_jobs_stale_processing 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 -- 2.51.2