Add placeholder-references expires_at index synchronously

What does this MR do and why?

Stacked on !253935 (merged). Adds the synchronous follow-up migration for the import_source_user_placeholder_references.expires_at index that !253935 (merged) schedules asynchronously (via prepare_async_index, per adding_database_indexes.md#create-indexes-asynchronously - that table is ~52M rows, too large to safely CREATE INDEX CONCURRENTLY in the deploy path).

add_concurrent_index checks for the index's existence before creating one, so this migration is a no-op once GitLab.com's weekend async-index job has already built it, and a real synchronous creation as a fallback if it somehow hasn't.

Do not merge until:

  1. !253935 (merged) has merged and deployed to GitLab.com.
  2. A weekend has passed so the async-index job (runs every 12 min, Sat/Sun) has had a chance to run.
  3. The index is verified to actually exist (postgres_async_indexes table, or \d+ import_source_user_placeholder_references on a thin clone).

Full context: #576118 (async-index follow-up section).

Migration timestamp will need scripts/refresh-migrations-timestamps if this sits long enough to go stale relative to its actual merge date (per .ai/git.md's three-week guidance).

References

Database review data

Not applicable pre-merge — the index this creates already went through database review in !253935 (merged) (see that MR's Database review data section). This MR is mechanical: no query changes, just registering the async-created index synchronously so self-managed instances and fresh schema loads get it too.

Screenshots or screen recordings

Not applicable — database schema change, no UI changes.

How to set up and validate locally

  1. Merge/rebase on top of the latest georgekoltsov/add-placeholder-references-db-columns.
  2. bundle exec rails db:migrate (regenerates db/structure.sql).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Blocked until the three conditions above are met - do not merge on review approval alone.

Merge request reports

Loading
Loading