diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 09:07:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 09:07:27 +0300 |
commit | 510bc67dd2222ef511c08aff145cce2317d280df (patch) | |
tree | c5c60b0e824631ee576d0e15ebbf293341f53158 /db | |
parent | ed0dc960f6e0ec6d8e3de6925129b8db76647f4d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
11 files changed, 115 insertions, 5 deletions
diff --git a/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb new file mode 100644 index 00000000000..7a5f05c977c --- /dev/null +++ b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RaiseGroupAndProjectCiVariableLimits < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + create_or_update_plan_limit('project_ci_variables', 'default', 8000) + create_or_update_plan_limit('group_ci_variables', 'default', 30000) + end + + def down + create_or_update_plan_limit('project_ci_variables', 'default', 200) + create_or_update_plan_limit('group_ci_variables', 'default', 200) + end +end diff --git a/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb new file mode 100644 index 00000000000..bbfb0c90596 --- /dev/null +++ b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + change_column_null :analytics_dashboards_pointers, :project_id, true + change_column_null :analytics_dashboards_pointers, :namespace_id, true + + unless column_exists?(:analytics_dashboards_pointers, :target_project_id) + add_column :analytics_dashboards_pointers, :target_project_id, :bigint + end + + add_concurrent_foreign_key :analytics_dashboards_pointers, :projects, + column: :target_project_id, + on_delete: :cascade + + add_concurrent_index :analytics_dashboards_pointers, :target_project_id + end + + def down + change_column_null :analytics_dashboards_pointers, :project_id, false + change_column_null :analytics_dashboards_pointers, :namespace_id, false + + return unless column_exists?(:analytics_dashboards_pointers, :target_project_id) + + remove_column :analytics_dashboards_pointers, :target_project_id + end +end diff --git a/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb new file mode 100644 index 00000000000..233474d0918 --- /dev/null +++ b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class MigrateProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + execute 'UPDATE analytics_dashboards_pointers SET target_project_id = project_id' + execute 'UPDATE analytics_dashboards_pointers SET project_id = NULL' + end + + def down + execute 'UPDATE analytics_dashboards_pointers SET project_id = target_project_id' + execute 'UPDATE analytics_dashboards_pointers SET target_project_id = NULL' + end +end diff --git a/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb new file mode 100644 index 00000000000..d615185fe8a --- /dev/null +++ b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class ChangeDashboardAnalyticsProjectPointerProjectNull < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + EXISTENCE_CONSTRAINT = 'chk_analytics_dashboards_pointers_project_or_namespace' + NEW_UNIQ_INDEX = 'idx_uniq_analytics_dashboards_pointers_on_project_id' + OLD_INDEX = 'index_analytics_dashboards_pointers_on_project_id' + + def up + add_check_constraint :analytics_dashboards_pointers, + "(project_id IS NULL) <> (namespace_id IS NULL)", + EXISTENCE_CONSTRAINT + + change_column_null :analytics_dashboards_pointers, :target_project_id, false + + add_concurrent_index :analytics_dashboards_pointers, :project_id, name: NEW_UNIQ_INDEX, unique: true + remove_concurrent_index_by_name :analytics_dashboards_pointers, OLD_INDEX + end + + def down + remove_check_constraint :analytics_dashboards_pointers, EXISTENCE_CONSTRAINT + + change_column_null :analytics_dashboards_pointers, :target_project_id, true + + add_concurrent_index :analytics_dashboards_pointers, :project_id, name: OLD_INDEX + remove_concurrent_index_by_name :analytics_dashboards_pointers, NEW_UNIQ_INDEX + end +end diff --git a/db/migrate/20230131123923_raise_ci_variables_default_limits.rb b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb new file mode 100644 index 00000000000..ebe59c13e18 --- /dev/null +++ b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class RaiseCiVariablesDefaultLimits < Gitlab::Database::Migration[2.1] + def change + change_column_default(:plan_limits, :project_ci_variables, from: 200, to: 8000) + change_column_default(:plan_limits, :group_ci_variables, from: 200, to: 30000) + end +end diff --git a/db/schema_migrations/20230124173255 b/db/schema_migrations/20230124173255 new file mode 100644 index 00000000000..b1134aad384 --- /dev/null +++ b/db/schema_migrations/20230124173255 @@ -0,0 +1 @@ +e11768af160039168f1badf070a8da705660f8a3518198570a0ad4fc39913d92
\ No newline at end of file diff --git a/db/schema_migrations/20230127151529 b/db/schema_migrations/20230127151529 new file mode 100644 index 00000000000..b36a1842904 --- /dev/null +++ b/db/schema_migrations/20230127151529 @@ -0,0 +1 @@ +a3ba269ba178efa2a9025448ba9bf6cd4089484580510a1edc0aa111d5f92b23
\ No newline at end of file diff --git a/db/schema_migrations/20230127151530 b/db/schema_migrations/20230127151530 new file mode 100644 index 00000000000..35951a5aadd --- /dev/null +++ b/db/schema_migrations/20230127151530 @@ -0,0 +1 @@ +54678c1253121aaa9b3378b05621f212a6addaf88bd735c697706272a4dae2f8
\ No newline at end of file diff --git a/db/schema_migrations/20230127151531 b/db/schema_migrations/20230127151531 new file mode 100644 index 00000000000..ab576c0772d --- /dev/null +++ b/db/schema_migrations/20230127151531 @@ -0,0 +1 @@ +4403e5a0350da73dc83f6a4fd42e5e8721c3983fe8582d9df58f20b7fbc73333
\ No newline at end of file diff --git a/db/schema_migrations/20230131123923 b/db/schema_migrations/20230131123923 new file mode 100644 index 00000000000..1368a92047e --- /dev/null +++ b/db/schema_migrations/20230131123923 @@ -0,0 +1 @@ +5acafd951bd7a1a521d2b82de5e4b2146e43dab401b3bae82b3d0bb5255c3373
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 3aba342d1db..a7e230d4cf1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -10982,8 +10982,10 @@ ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY anal CREATE TABLE analytics_dashboards_pointers ( id bigint NOT NULL, - namespace_id bigint NOT NULL, - project_id bigint NOT NULL + namespace_id bigint, + project_id bigint, + target_project_id bigint NOT NULL, + CONSTRAINT chk_analytics_dashboards_pointers_project_or_namespace CHECK (((project_id IS NULL) <> (namespace_id IS NULL))) ); CREATE SEQUENCE analytics_dashboards_pointers_id_seq @@ -19660,8 +19662,8 @@ CREATE TABLE plan_limits ( security_policy_scan_execution_schedules integer DEFAULT 0 NOT NULL, web_hook_calls_mid integer DEFAULT 0 NOT NULL, web_hook_calls_low integer DEFAULT 0 NOT NULL, - project_ci_variables integer DEFAULT 200 NOT NULL, - group_ci_variables integer DEFAULT 200 NOT NULL, + project_ci_variables integer DEFAULT 8000 NOT NULL, + group_ci_variables integer DEFAULT 30000 NOT NULL, ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL, rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL, ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL, @@ -28657,6 +28659,8 @@ CREATE INDEX idx_streaming_headers_on_external_audit_event_destination_id ON aud CREATE INDEX idx_test_reports_on_issue_id_created_at_and_id ON requirements_management_test_reports USING btree (issue_id, created_at, id); +CREATE UNIQUE INDEX idx_uniq_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id); + CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id); CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha); @@ -28757,7 +28761,7 @@ CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analyti CREATE UNIQUE INDEX index_analytics_dashboards_pointers_on_namespace_id ON analytics_dashboards_pointers USING btree (namespace_id); -CREATE INDEX index_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id); +CREATE INDEX index_analytics_dashboards_pointers_on_target_project_id ON analytics_dashboards_pointers USING btree (target_project_id); CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); @@ -33483,6 +33487,9 @@ ALTER TABLE ONLY service_desk_settings ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT fk_05d96922bd FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; |