Skip to content

Fix namespace async index creation

Adam Hegyi requested to merge 402737-fix-async-namespace-index-creation into master

What does this MR do and why?

This MR fixes the async index creation merged a few days ago: !117638 (merged)

The async index will not be created because the index definition is invalid. It looks like rails adds an extra () around the columns:

CREATE INDEX CONCURRENTLY "index_on_namespaces_namespaces_by_top_level_namespace" ON "namespaces" (((traversal_ids[1]), type, id));
ERROR:  syntax error at or near ","
LINE 1: ...el_namespace" ON "namespaces" (((traversal_ids[1]), type, id...

SQL doesn't like the double parentheses. Fix:

  • Nullify the old migration.
  • Re-create the migration with the correct syntax.
  • Fix the down method (another bug, it was referencing a different table)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #402737 (closed)

Edited by Adam Hegyi

Merge request reports