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