diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-06 22:34:29 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-07 13:38:01 +0900 |
commit | 12a73596cc0afe883cf983d675a2d9243253988f (patch) | |
tree | 0cb128482fe74e4c7ffdc93f81aaca5c460d59b9 /db/migrate/20181106135939_add_index_to_deployments.rb | |
parent | 065af93d6ba94555857e7e9f2b55c5fba44ed302 (diff) | |
download | gitlab-ce-12a73596cc0afe883cf983d675a2d9243253988f.tar.gz |
Fix the index for finished at
Diffstat (limited to 'db/migrate/20181106135939_add_index_to_deployments.rb')
-rw-r--r-- | db/migrate/20181106135939_add_index_to_deployments.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/db/migrate/20181106135939_add_index_to_deployments.rb b/db/migrate/20181106135939_add_index_to_deployments.rb index b29c6766b11..41ea75f9d37 100644 --- a/db/migrate/20181106135939_add_index_to_deployments.rb +++ b/db/migrate/20181106135939_add_index_to_deployments.rb @@ -4,6 +4,7 @@ class AddIndexToDeployments < ActiveRecord::Migration include Gitlab::Database::MigrationHelpers DOWNTIME = false + SHORT_INDEX_NAME = 'index_deployments_on_deployed_for_finished_at' disable_ddl_transaction! @@ -11,13 +12,13 @@ class AddIndexToDeployments < ActiveRecord::Migration add_concurrent_index :deployments, [:project_id, :action, :status] add_concurrent_index :deployments, [:environment_id, :action, :status] add_concurrent_index :deployments, [:environment_id, :action, :sha] - add_concurrent_index :deployments, [:finished_at] + add_concurrent_index :deployments, [:project_id, :action, :status, :finished_at], name: SHORT_INDEX_NAME end def down remove_concurrent_index :deployments, [:project_id, :action, :status] remove_concurrent_index :deployments, [:environment_id, :action, :status] remove_concurrent_index :deployments, [:environment_id, :action, :sha] - remove_concurrent_index :deployments, [:finished_at] + remove_concurrent_index_by_name(:deployments, SHORT_INDEX_NAME) end end |