blob: 15debddb9cceb11441e7fe796c244e27c032ba13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# frozen_string_literal: true
class AddIndexOnShaForInitialDeployments < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
NEW_INDEX_NAME = 'index_deployments_on_environment_status_sha'
OLD_INDEX_NAME = 'index_deployments_on_environment_id_and_status'
disable_ddl_transaction!
def up
add_concurrent_index :deployments, %i[environment_id status sha], name: NEW_INDEX_NAME
remove_concurrent_index_by_name :deployments, OLD_INDEX_NAME
end
def down
add_concurrent_index :deployments, %i[environment_id status], name: OLD_INDEX_NAME
remove_concurrent_index_by_name :services, NEW_INDEX_NAME
end
end
|