diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 21:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 21:10:07 +0300 |
commit | bc7374e61208637f6fb116e2ca59c7162b07cba9 (patch) | |
tree | d34a9d8680f808bd327123ebb2c861071f1e7635 /db | |
parent | c48bbe6650648fa034696de25983418981e695eb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb | 30 | ||||
-rw-r--r-- | db/post_migrate/20220816075638_drop_uuid_and_id_index_from_security_findings.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20220809002011 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20220816075638 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
5 files changed, 47 insertions, 2 deletions
diff --git a/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb b/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb new file mode 100644 index 00000000000..3db21c290b9 --- /dev/null +++ b/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class ScheduleDestroyInvalidGroupMembers < Gitlab::Database::Migration[2.0] + MIGRATION = 'DestroyInvalidGroupMembers' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 2_000 + SUB_BATCH_SIZE = 50 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :members, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + gitlab_schema: :gitlab_main + ) + end + + def down + delete_batched_background_migration(MIGRATION, :members, :id, []) + end +end diff --git a/db/post_migrate/20220816075638_drop_uuid_and_id_index_from_security_findings.rb b/db/post_migrate/20220816075638_drop_uuid_and_id_index_from_security_findings.rb new file mode 100644 index 00000000000..7a41e0b7835 --- /dev/null +++ b/db/post_migrate/20220816075638_drop_uuid_and_id_index_from_security_findings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropUuidAndIdIndexFromSecurityFindings < Gitlab::Database::Migration[2.0] + INDEX_NAME = :index_on_security_findings_uuid_and_id_order_desc + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :security_findings, name: INDEX_NAME + end + + def down + add_concurrent_index :security_findings, [:uuid, :id], order: { id: :desc }, name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20220809002011 b/db/schema_migrations/20220809002011 new file mode 100644 index 00000000000..952c468b1cb --- /dev/null +++ b/db/schema_migrations/20220809002011 @@ -0,0 +1 @@ +12bc6c4a89c4362024d66a21690412f8946b8f6eaf9dc09cccaf8d54b7f45b17
\ No newline at end of file diff --git a/db/schema_migrations/20220816075638 b/db/schema_migrations/20220816075638 new file mode 100644 index 00000000000..9f4e1fbc3ee --- /dev/null +++ b/db/schema_migrations/20220816075638 @@ -0,0 +1 @@ +78e03575edb66cfaeea75f2ff653efc77156ca9e0b1ea0fa989172c3caa0b195
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index ce87cb40a0d..b9bfe44117d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -29312,8 +29312,6 @@ CREATE INDEX index_on_projects_path ON projects USING btree (path); CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); -CREATE INDEX index_on_security_findings_uuid_and_id_order_desc ON security_findings USING btree (uuid, id DESC); - CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username)::text)); |