diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-31 03:10:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-31 03:10:33 +0300 |
commit | 13ddda5208f9175e822af6d05a32600bc9cad091 (patch) | |
tree | d0dede48f80b34cfbf326d9539edc2e2addf4398 /db | |
parent | dd8c199e989482245c58ee49b5f7169bdd9073eb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
9 files changed, 63 insertions, 2 deletions
diff --git a/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb b/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb new file mode 100644 index 00000000000..e330ecfdae8 --- /dev/null +++ b/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddUrlHashToWebHookLogs < Gitlab::Database::Migration[2.1] + def change + # limit is added in 20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb + add_column :web_hook_logs, :url_hash, :text # rubocop:disable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb b/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb new file mode 100644 index 00000000000..28e719b0a0f --- /dev/null +++ b/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToWebHookLogsUrlHash < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :web_hook_logs, :url_hash, 44, validate: false + end + + def down + remove_text_limit :web_hook_logs, :url_hash + end +end diff --git a/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb b/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb new file mode 100644 index 00000000000..1b16ac5c187 --- /dev/null +++ b/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddHostedPlanIdAndTrialIndexToGitlabSubscriptions < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id_and_trial' + + disable_ddl_transaction! + + def up + add_concurrent_index :gitlab_subscriptions, [:hosted_plan_id, :trial], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :gitlab_subscriptions, INDEX_NAME + end +end diff --git a/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb b/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb new file mode 100644 index 00000000000..6cc21920748 --- /dev/null +++ b/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveHostedPlanIdIndexFromGitlabSubscriptions < Gitlab::Database::Migration[2.1] + OLD_INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id' + NEW_INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id_and_trial' + TABLE = :gitlab_subscriptions + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name TABLE, OLD_INDEX_NAME if index_exists_by_name?(TABLE, NEW_INDEX_NAME) + end + + def down + add_concurrent_index TABLE, :hosted_plan_id, name: OLD_INDEX_NAME + end +end diff --git a/db/schema_migrations/20230119151636 b/db/schema_migrations/20230119151636 new file mode 100644 index 00000000000..8cc012ec6f1 --- /dev/null +++ b/db/schema_migrations/20230119151636 @@ -0,0 +1 @@ +18054d43494d8870295c5eb6fca2498625c10cad2d040b209c4d235ae08d6480
\ No newline at end of file diff --git a/db/schema_migrations/20230119151940 b/db/schema_migrations/20230119151940 new file mode 100644 index 00000000000..c0a4d78421f --- /dev/null +++ b/db/schema_migrations/20230119151940 @@ -0,0 +1 @@ +c8040984273d168b3a41b3d09d8745b80c4045a0230e1917df277cc9a5b4ca71
\ No newline at end of file diff --git a/db/schema_migrations/20230127115607 b/db/schema_migrations/20230127115607 new file mode 100644 index 00000000000..48b062249e1 --- /dev/null +++ b/db/schema_migrations/20230127115607 @@ -0,0 +1 @@ +d0d4a09ec220c34da584f5119435c0c782f32d78dd3cf9b864b444ccdb77041e
\ No newline at end of file diff --git a/db/schema_migrations/20230127125018 b/db/schema_migrations/20230127125018 new file mode 100644 index 00000000000..21d47c4e8d7 --- /dev/null +++ b/db/schema_migrations/20230127125018 @@ -0,0 +1 @@ +3be83793807d10ef26eb5adbfcfb47efee04d6aa3b3fde84467a69db0fb3d422
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6b4861110c4..9ecd0e460fd 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -475,7 +475,8 @@ CREATE TABLE web_hook_logs ( execution_duration double precision, internal_error_message character varying, updated_at timestamp without time zone NOT NULL, - created_at timestamp without time zone NOT NULL + created_at timestamp without time zone NOT NULL, + url_hash text ) PARTITION BY RANGE (created_at); @@ -25804,6 +25805,9 @@ ALTER TABLE group_import_states ALTER TABLE sprints ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID; +ALTER TABLE web_hook_logs + ADD CONSTRAINT check_df72cb58f5 CHECK ((char_length(url_hash) <= 44)) NOT VALID; + ALTER TABLE projects ADD CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL)) NOT VALID; @@ -29806,7 +29810,7 @@ CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gi CREATE INDEX index_gitlab_subscriptions_on_end_date_and_namespace_id ON gitlab_subscriptions USING btree (end_date, namespace_id); -CREATE INDEX index_gitlab_subscriptions_on_hosted_plan_id ON gitlab_subscriptions USING btree (hosted_plan_id); +CREATE INDEX index_gitlab_subscriptions_on_hosted_plan_id_and_trial ON gitlab_subscriptions USING btree (hosted_plan_id, trial); CREATE INDEX index_gitlab_subscriptions_on_max_seats_used_changed_at ON gitlab_subscriptions USING btree (max_seats_used_changed_at, namespace_id); |