Commit aac228bb authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add migration and feature in licence

Add migration that adds new settings to application settings
parent 6a1ec074
# 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 AddFieldsToApplicationSettingsForMergeRequestsApprovals < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default(:application_settings, :disable_overriding_approvers_per_merge_request,
:boolean,
default: false,
allow_null: false)
add_column_with_default(:application_settings, :prevent_merge_requests_author_approval,
:boolean,
default: false,
allow_null: false)
add_column_with_default(:application_settings, :prevent_merge_requests_committers_approval,
:boolean,
default: false,
allow_null: false)
end
def down
remove_column(:application_settings, :disable_overriding_approvers_per_merge_request)
remove_column(:application_settings, :prevent_merge_requests_author_approval)
remove_column(:application_settings, :prevent_merge_requests_committers_approval)
end
end
......@@ -346,6 +346,9 @@ ActiveRecord::Schema.define(version: 2020_02_12_052620) do
t.integer "elasticsearch_indexed_field_length_limit", default: 0, null: false
t.integer "elasticsearch_max_bulk_size_mb", limit: 2, default: 10, null: false
t.integer "elasticsearch_max_bulk_concurrency", limit: 2, default: 10, null: false
t.boolean "disable_overriding_approvers_per_merge_request", default: false, null: false
t.boolean "prevent_merge_requests_author_approval", default: false, null: false
t.boolean "prevent_merge_requests_committers_approval", default: false, null: false
t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id"
t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id"
t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id"
......
......@@ -93,6 +93,9 @@ module EE
default_project_deletion_protection
deletion_adjourned_period
updating_name_disabled_for_users
disable_overriding_approvers_per_merge_request
prevent_merge_requests_author_approval
prevent_merge_requests_committers_approval
]
end
end
......
......@@ -80,6 +80,7 @@ class License < ApplicationRecord
ldap_group_sync_filter
merge_pipelines
merge_request_performance_metrics
merge_request_approvers_rules
merge_trains
metrics_reports
multiple_approval_rules
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment