debian-mirror-gitlab/db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb

28 lines
903 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# 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-04-22 19:07:51 +05:30
add_column :projects, :merge_requests_require_code_owner_approval, :boolean # rubocop:disable Migration/AddColumnsToWideTables
2020-01-01 13:55:28 +05:30
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