Skip to content

Fix regular expression used for opclasses to not be confused by partial index clause

Gregory Stark requested to merge fix-rails-migrations-for-partial-indexes into master

What does this MR do?

Fixes a bug in the schema dump which causes broken index definitions whenever a partial index is present.

For example in schema.rb on CE it results in this change:

-  add_index "ci_builds", ["id"], name: "index_for_ci_builds_retried_migration", where: "(retried IS NULL)", using: :btree, opclasses: {"id)"=>"WHERE"}
+  add_index "ci_builds", ["id"], name: "index_for_ci_builds_retried_migration", where: "(retried IS NULL)", using: :btree

Does this MR meet the acceptance criteria?

Edited by yorickpeterse-staging

Merge request reports