diff --git a/changelogs/unreleased/211944-provide-instance-level-setting-to-enable-or-disable-default-branch.yml b/changelogs/unreleased/211944-provide-instance-level-setting-to-enable-or-disable-default-branch.yml new file mode 100644 index 0000000000000000000000000000000000000000..51dd436e2a375cc65c3f5ef7f297bd764d64ffa1 --- /dev/null +++ b/changelogs/unreleased/211944-provide-instance-level-setting-to-enable-or-disable-default-branch.yml @@ -0,0 +1,6 @@ +--- +title: Add a database column to enable or disable group owners from changing the default + branch protection setting of a group +merge_request: 29397 +author: +type: added diff --git a/db/migrate/20200413072059_add_group_owners_can_manage_default_branch_protection_to_application_settings.rb b/db/migrate/20200413072059_add_group_owners_can_manage_default_branch_protection_to_application_settings.rb new file mode 100644 index 0000000000000000000000000000000000000000..eea564d00f439de51ef4d362879d86bacf6d40f4 --- /dev/null +++ b/db/migrate/20200413072059_add_group_owners_can_manage_default_branch_protection_to_application_settings.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddGroupOwnersCanManageDefaultBranchProtectionToApplicationSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + disable_ddl_transaction! + + def up + add_column_with_default(:application_settings, + :group_owners_can_manage_default_branch_protection, + :boolean, + default: true) + end + + def down + remove_column :application_settings, :group_owners_can_manage_default_branch_protection + end +end diff --git a/db/structure.sql b/db/structure.sql index 15d9631e984bf5cce517bf7a6daf7401fa2462ed..2430df7984914ac28ca3fa5bbcf2b47f42d0a55f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -400,7 +400,8 @@ CREATE TABLE public.application_settings ( seat_link_enabled boolean DEFAULT true NOT NULL, container_expiration_policies_enable_historic_entries boolean DEFAULT false NOT NULL, issues_create_limit integer DEFAULT 300 NOT NULL, - push_rule_id bigint + push_rule_id bigint, + group_owners_can_manage_default_branch_protection boolean DEFAULT true NOT NULL ); CREATE SEQUENCE public.application_settings_id_seq @@ -13198,6 +13199,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200408175424 20200409211607 20200410232012 +20200413072059 20200414144547 20200415160722 20200415161021