diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-07-29 22:06:50 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-29 22:06:50 +0300 |
commit | 576b397de9f9962f7de7304600e13107f24edcef (patch) | |
tree | 9f689c48f162967283bcf113fe208c59ab070050 /db/migrate/20190729090456_add_index_on_environments_with_state.rb | |
parent | 0a0b442f149334c970cb45387467c2ec6ea484a7 (diff) |
Create index on environments by state
Diffstat (limited to 'db/migrate/20190729090456_add_index_on_environments_with_state.rb')
-rw-r--r-- | db/migrate/20190729090456_add_index_on_environments_with_state.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20190729090456_add_index_on_environments_with_state.rb b/db/migrate/20190729090456_add_index_on_environments_with_state.rb new file mode 100644 index 00000000000..9a8d8391415 --- /dev/null +++ b/db/migrate/20190729090456_add_index_on_environments_with_state.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnEnvironmentsWithState < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :environments, [:project_id, :state] + end + + def down + remove_concurrent_index :environments, [:project_id, :state] + end +end |