DB change for EE #15974
What does this MR do?
DB change for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15974
== 20190905233042 AddIndexToIncidentManagementSettingCreateIssue: migrating ===
-- transaction_open?()
-> 0.0000s
-- index_exists?(:project_incident_management_settings, :create_issue, {:algorithm=>:concurrently})
-> 0.0020s
-- execute("SET statement_timeout TO 0")
-> 0.0003s
-- add_index(:project_incident_management_settings, :create_issue, {:algorithm=>:concurrently})
-> 0.0075s
-- execute("RESET ALL")
-> 0.0003s
== 20190905233042 AddIndexToIncidentManagementSettingCreateIssue: migrated (0.0102s)
Database checklist
-
Conforms to the database guides
When adding migrations:
-
Updated db/schema.rb
-
Added a down
method so the migration can be reverted -
Added the output of the migration(s) to the MR body -
Added tests for the migration in spec/migrations
if necessary (e.g. when migrating data)
When adding or modifying queries to improve performance:
-
Included data that shows the performance improvement, preferably in the form of a benchmark -
Included the output of EXPLAIN (ANALYZE, BUFFERS)
of the relevant queries
When adding foreign keys to existing tables:
-
Included a migration to remove orphaned rows in the source table before adding the foreign key -
Removed any instances of dependent: ...
that may no longer be necessary
When adding tables:
-
Ordered columns based on the Ordering Table Columns guidelines -
Added foreign keys to any columns pointing to data in other tables -
Added indexes for fields that are used in statements such as WHERE
,ORDER BY
,GROUP BY
, andJOIN
s
When removing columns, tables, indexes or other structures:
-
Removed these in a post-deployment migration -
Made sure the application no longer uses (or ignores) these structures