2019-11-21 12:06:40 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
|
|
|
class DropMergeRequestsRequireCodeOwnerApprovalFromProjects < ActiveRecord::Migration[5.2]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
remove_column :projects, :merge_requests_require_code_owner_approval, :boolean
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2020-03-30 15:07:51 +00:00
|
|
|
add_column :projects, :merge_requests_require_code_owner_approval, :boolean # rubocop:disable Migration/AddColumnsToWideTables
|
2019-11-21 12:06:40 +00:00
|
|
|
|
|
|
|
add_concurrent_index(
|
|
|
|
:projects,
|
|
|
|
%i[archived pending_delete merge_requests_require_code_owner_approval],
|
|
|
|
name: 'projects_requiring_code_owner_approval',
|
|
|
|
where: '((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|