From 4d7a68855e637561e4dadc6e21b35b523fa305d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B7=AF=E5=B0=8F=E9=B9=BF?= <1551755561@qq.com> Date: Tue, 11 Oct 2022 19:25:41 +0800 Subject: [PATCH] Add columns about MR checks to namespace_settings Add the following three columns to the table namespace_settings to support users to configure MR checks at the group level. 1. only_allow_merge_if_pipeline_succeeds 2. allow_merge_on_skipped_pipeline 3. only_allow_merge_if_all_discussions_are_resolved Changelog: changed --- ...5130_add_mr_checks_columns_to_namespace_settings.rb | 10 ++++++++++ db/schema_migrations/20221009085130 | 1 + db/structure.sql | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb create mode 100644 db/schema_migrations/20221009085130 diff --git a/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb b/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb new file mode 100644 index 00000000000000..947a662575a751 --- /dev/null +++ b/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddMrChecksColumnsToNamespaceSettings < Gitlab::Database::Migration[2.0] + def change + add_column :namespace_settings, :only_allow_merge_if_pipeline_succeeds, :boolean, default: false, null: false + add_column :namespace_settings, :allow_merge_on_skipped_pipeline, :boolean, default: false, null: false + add_column :namespace_settings, :only_allow_merge_if_all_discussions_are_resolved, \ + :boolean, default: false, null: false + end +end diff --git a/db/schema_migrations/20221009085130 b/db/schema_migrations/20221009085130 new file mode 100644 index 00000000000000..cbdfb3014cdc43 --- /dev/null +++ b/db/schema_migrations/20221009085130 @@ -0,0 +1 @@ +125ce9bf81966840774eb69be7995c1a8e2abd901fe5f19b73df43a577a9dc44 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 5db8614c868f9f..3d607b2ea405e3 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -17925,6 +17925,9 @@ CREATE TABLE namespace_settings ( include_for_free_user_cap_preview boolean DEFAULT false NOT NULL, unique_project_download_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, auto_ban_user_on_excessive_projects_download boolean DEFAULT false NOT NULL, + only_allow_merge_if_pipeline_succeeds boolean DEFAULT false NOT NULL, + allow_merge_on_skipped_pipeline boolean DEFAULT false NOT NULL, + only_allow_merge_if_all_discussions_are_resolved boolean DEFAULT false NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) ); -- GitLab