Adding an index may leave it behind in INVALID state (postgresql only)
Adding indexes in PostgreSQL with CONCURRENTLY
may create and leave behind an index in INVALID
state. The migration fails. On the second run, the index already exists and the migration succeeds but without fixing the INVALID
state of the index.
Code: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/database/migration_helpers.rb#L52
Docs: https://www.postgresql.org/docs/9.5/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY
/cc @NikolayS