diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-13 15:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-13 15:08:49 +0300 |
commit | 988424215cf104d9ee24bb1751141424cffb32d1 (patch) | |
tree | 9d2525571ecc693902b949ac8441e8c97b299c3c /db | |
parent | 2705a15deaef07b1a38a53b9539d02f8ad499ce3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
9 files changed, 76 insertions, 16 deletions
diff --git a/db/post_migrate/20220422121443_add_async_index_for_group_activity_events.rb b/db/post_migrate/20220422121443_add_async_index_for_group_activity_events.rb new file mode 100644 index 00000000000..92b97203eed --- /dev/null +++ b/db/post_migrate/20220422121443_add_async_index_for_group_activity_events.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAsyncIndexForGroupActivityEvents < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_events_for_group_activity' + + def up + prepare_async_index :events, %I[group_id target_type action id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end + + def down + unprepare_async_index :events, %I[group_id target_type action id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end +end diff --git a/db/post_migrate/20220425111114_add_async_index_for_project_activity_events.rb b/db/post_migrate/20220425111114_add_async_index_for_project_activity_events.rb new file mode 100644 index 00000000000..b203ceca976 --- /dev/null +++ b/db/post_migrate/20220425111114_add_async_index_for_project_activity_events.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAsyncIndexForProjectActivityEvents < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_events_for_project_activity' + + def up + prepare_async_index :events, %I[project_id target_type action id], name: INDEX_NAME + end + + def down + unprepare_async_index :events, %I[project_id target_type action id], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220425111453_add_async_index_to_events_on_group_id_and_id.rb b/db/post_migrate/20220425111453_add_async_index_to_events_on_group_id_and_id.rb new file mode 100644 index 00000000000..313a31d8964 --- /dev/null +++ b/db/post_migrate/20220425111453_add_async_index_to_events_on_group_id_and_id.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAsyncIndexToEventsOnGroupIdAndId < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_events_on_group_id_and_id' + + def up + prepare_async_index :events, %I[group_id id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end + + def down + unprepare_async_index :events, %I[group_id id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end +end diff --git a/db/post_migrate/20220428133724_schedule_expire_o_auth_tokens.rb b/db/post_migrate/20220428133724_schedule_expire_o_auth_tokens.rb index ef76a097b49..3e0e9b8af0e 100644 --- a/db/post_migrate/20220428133724_schedule_expire_o_auth_tokens.rb +++ b/db/post_migrate/20220428133724_schedule_expire_o_auth_tokens.rb @@ -1,25 +1,11 @@ # frozen_string_literal: true class ScheduleExpireOAuthTokens < Gitlab::Database::Migration[2.0] - MIGRATION = 'ExpireOAuthTokens' - INTERVAL = 2.minutes.freeze - - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - def up - queue_batched_background_migration( - MIGRATION, - :oauth_access_tokens, - :id, - job_interval: INTERVAL - ) + # reschedulled with db/post_migrate/20220513043344_reschedule_expire_o_auth_tokens.rb end def down - Gitlab::Database::BackgroundMigration::BatchedMigration - .for_configuration(MIGRATION, :oauth_access_tokens, :id, []) - .delete_all + # reschedulled with db/post_migrate/20220513043344_reschedule_expire_o_auth_tokens.rb end end diff --git a/db/post_migrate/20220513043344_reschedule_expire_o_auth_tokens.rb b/db/post_migrate/20220513043344_reschedule_expire_o_auth_tokens.rb new file mode 100644 index 00000000000..0c8a2386583 --- /dev/null +++ b/db/post_migrate/20220513043344_reschedule_expire_o_auth_tokens.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class RescheduleExpireOAuthTokens < Gitlab::Database::Migration[2.0] + MIGRATION = 'ExpireOAuthTokens' + INTERVAL = 2.minutes.freeze + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # remove the original migration from db/post_migrate/20220428133724_schedule_expire_o_auth_tokens.rb + Gitlab::Database::BackgroundMigration::BatchedMigration + .for_configuration(MIGRATION, :oauth_access_tokens, :id, []) + .delete_all + + # reschedule + queue_batched_background_migration( + MIGRATION, + :oauth_access_tokens, + :id, + job_interval: INTERVAL + ) + end + + def down + Gitlab::Database::BackgroundMigration::BatchedMigration + .for_configuration(MIGRATION, :oauth_access_tokens, :id, []) + .delete_all + end +end diff --git a/db/schema_migrations/20220422121443 b/db/schema_migrations/20220422121443 new file mode 100644 index 00000000000..79a69c6af87 --- /dev/null +++ b/db/schema_migrations/20220422121443 @@ -0,0 +1 @@ +5febc5341ccfd930c8dbc77ca2b2bbadb351444a616e657f8ce8cd477c73280f
\ No newline at end of file diff --git a/db/schema_migrations/20220425111114 b/db/schema_migrations/20220425111114 new file mode 100644 index 00000000000..ca0b2c6f908 --- /dev/null +++ b/db/schema_migrations/20220425111114 @@ -0,0 +1 @@ +a9ba21d5f1fcff29b0f14d5bab99dd867ec101667f021914da845e286aabe2a5
\ No newline at end of file diff --git a/db/schema_migrations/20220425111453 b/db/schema_migrations/20220425111453 new file mode 100644 index 00000000000..45326d41fdd --- /dev/null +++ b/db/schema_migrations/20220425111453 @@ -0,0 +1 @@ +30d5d5538f965562f594a78b9430a11ea87ea900216ee9c03df422ea47de8f0c
\ No newline at end of file diff --git a/db/schema_migrations/20220513043344 b/db/schema_migrations/20220513043344 new file mode 100644 index 00000000000..af72eebc3b9 --- /dev/null +++ b/db/schema_migrations/20220513043344 @@ -0,0 +1 @@ +33928e6cb39e42efae6c8bc12291317a08197c0fe5a1f912aac8972eabc96de7
\ No newline at end of file |