diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 21:07:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 21:07:33 +0300 |
commit | 9e5484cee690f8bb2c1796013345d8cbc1872d77 (patch) | |
tree | 7b5c95c7de5eaba5ebb053da65c83184af1cf74c /db | |
parent | 638e2f1c5f55988135da63c7aa57bcecb9355a2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
11 files changed, 77 insertions, 2 deletions
diff --git a/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb b/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb new file mode 100644 index 00000000000..573eccd7d12 --- /dev/null +++ b/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDefaultBranchProtectionsJsonToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :default_branch_protection_defaults, :jsonb, null: false, default: {} + end +end diff --git a/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb b/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb new file mode 100644 index 00000000000..a35effe0bb7 --- /dev/null +++ b/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDefaultBranchProtectionsJsonToNamespaceSettings < Gitlab::Database::Migration[2.1] + def change + add_column :namespace_settings, :default_branch_protection_defaults, :jsonb, null: false, default: {} + end +end diff --git a/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb b/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb new file mode 100644 index 00000000000..80d11c8aacf --- /dev/null +++ b/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSizeConstraintToNamespaceSettingsJson < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'default_branch_protection_defaults_size_constraint' + + disable_ddl_transaction! + + def up + add_check_constraint :namespace_settings, 'octet_length(default_branch_protection_defaults::text) <= 1024', + CONSTRAINT_NAME, validate: false + end + + def down + remove_check_constraint :namespace_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb b/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb new file mode 100644 index 00000000000..4bc6971edc3 --- /dev/null +++ b/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSizeConstraintToApplicationSettingsJson < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'default_branch_protection_defaults_size_constraint' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'octet_length(default_branch_protection_defaults::text) <= 1024', + CONSTRAINT_NAME, validate: false + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb b/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb new file mode 100644 index 00000000000..c74df0a5cdd --- /dev/null +++ b/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropTmpIndexOauthAccessTokensOnIdWhereExpiresInNull < Gitlab::Database::Migration[2.1] + TMP_INDEX = 'tmp_index_oauth_access_tokens_on_id_where_expires_in_null' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :oauth_access_tokens, TMP_INDEX + end + + def down + add_concurrent_index :oauth_access_tokens, :id, where: "expires_in IS NULL", name: TMP_INDEX + end +end diff --git a/db/schema_migrations/20230605192000 b/db/schema_migrations/20230605192000 new file mode 100644 index 00000000000..503275e177f --- /dev/null +++ b/db/schema_migrations/20230605192000 @@ -0,0 +1 @@ +854fe8f8aacba841ee3e7c89624bcde6951e71a936fd48e7fd871dd4232269f3
\ No newline at end of file diff --git a/db/schema_migrations/20230606124754 b/db/schema_migrations/20230606124754 new file mode 100644 index 00000000000..28485780317 --- /dev/null +++ b/db/schema_migrations/20230606124754 @@ -0,0 +1 @@ +490dc775459b89701c9531c7d10698734e47bd22a17aca07df12f8ac5a6d38e9
\ No newline at end of file diff --git a/db/schema_migrations/20230606124854 b/db/schema_migrations/20230606124854 new file mode 100644 index 00000000000..db75e3358c4 --- /dev/null +++ b/db/schema_migrations/20230606124854 @@ -0,0 +1 @@ +dd1cf7175a283e60af315372d96ea6836aff4e678830ab9b9d8e3367dc351c92
\ No newline at end of file diff --git a/db/schema_migrations/20230606124855 b/db/schema_migrations/20230606124855 new file mode 100644 index 00000000000..2d919d1a1c4 --- /dev/null +++ b/db/schema_migrations/20230606124855 @@ -0,0 +1 @@ +afe649b351bee4ec7152d465a73c35e4356d947c25fec727db2b4e38f268da41
\ No newline at end of file diff --git a/db/schema_migrations/20230606124856 b/db/schema_migrations/20230606124856 new file mode 100644 index 00000000000..1b81ad76033 --- /dev/null +++ b/db/schema_migrations/20230606124856 @@ -0,0 +1 @@ +df3b650081b827ab465aa0bf35b30a8fcb81a0c3609caecfa30e71d71761c809
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index b0a528aa8c1..371ee62067e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -11850,6 +11850,7 @@ CREATE TABLE application_settings ( instance_level_code_suggestions_enabled boolean DEFAULT false NOT NULL, delete_unconfirmed_users boolean DEFAULT false NOT NULL, unconfirmed_users_delete_after_days integer DEFAULT 7 NOT NULL, + default_branch_protection_defaults jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)), CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), @@ -18754,6 +18755,7 @@ CREATE TABLE namespace_settings ( code_suggestions boolean DEFAULT false NOT NULL, experiment_features_enabled boolean DEFAULT false NOT NULL, third_party_ai_features_enabled boolean DEFAULT true NOT NULL, + default_branch_protection_defaults jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) @@ -27096,6 +27098,12 @@ ALTER TABLE ONLY dast_site_validations ALTER TABLE ONLY dast_sites ADD CONSTRAINT dast_sites_pkey PRIMARY KEY (id); +ALTER TABLE namespace_settings + ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID; + +ALTER TABLE application_settings + ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID; + ALTER TABLE ONLY dependency_list_exports ADD CONSTRAINT dependency_list_exports_pkey PRIMARY KEY (id); @@ -33264,8 +33272,6 @@ CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (st CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); -CREATE INDEX tmp_index_oauth_access_tokens_on_id_where_expires_in_null ON oauth_access_tokens USING btree (id) WHERE (expires_in IS NULL); - CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0); |