From a411134409a19fd867f39dc7a886beeffe4b3dbc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 16 May 2023 15:51:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-11-stable-ee --- ...21082255_add_unique_index_on_ci_runners_token.rb | 20 -------------------- ...inish_reset_duplicate_ci_runners_token_values.rb | 21 +++++++++++++++++++++ ...21082257_add_unique_index_on_ci_runners_token.rb | 18 ++++++++++++++++++ ...dd_unique_index_on_ci_runners_token_encrypted.rb | 20 -------------------- ...t_duplicate_ci_runners_token_encrypted_values.rb | 21 +++++++++++++++++++++ ...dd_unique_index_on_ci_runners_token_encrypted.rb | 18 ++++++++++++++++++ db/schema_migrations/20221021082255 | 1 - db/schema_migrations/20221021082256 | 1 + db/schema_migrations/20221021082257 | 1 + db/schema_migrations/20221021082312 | 1 - db/schema_migrations/20221021082313 | 1 + db/schema_migrations/20221021082314 | 1 + 12 files changed, 82 insertions(+), 42 deletions(-) delete mode 100644 db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb create mode 100644 db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb create mode 100644 db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb delete mode 100644 db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb create mode 100644 db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb create mode 100644 db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb delete mode 100644 db/schema_migrations/20221021082255 create mode 100644 db/schema_migrations/20221021082256 create mode 100644 db/schema_migrations/20221021082257 delete mode 100644 db/schema_migrations/20221021082312 create mode 100644 db/schema_migrations/20221021082313 create mode 100644 db/schema_migrations/20221021082314 diff --git a/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb b/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb deleted file mode 100644 index 3dfa44f9615..00000000000 --- a/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexOnCiRunnersToken < Gitlab::Database::Migration[2.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_uniq_ci_runners_on_token' - - def up - finalize_background_migration 'ResetDuplicateCiRunnersTokenValues' - - add_concurrent_index :ci_runners, - :token, - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb b/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb new file mode 100644 index 00000000000..4e6195bb3c8 --- /dev/null +++ b/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinishResetDuplicateCiRunnersTokenValues < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'ResetDuplicateCiRunnersTokenValues', + table_name: :ci_runners, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb b/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb new file mode 100644 index 00000000000..3858c0efe06 --- /dev/null +++ b/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnCiRunnersToken < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_uniq_ci_runners_on_token' + + def up + add_concurrent_index :ci_runners, + :token, + name: INDEX_NAME, + unique: true + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb deleted file mode 100644 index 8728c0ff20e..00000000000 --- a/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexOnCiRunnersTokenEncrypted < Gitlab::Database::Migration[2.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_uniq_ci_runners_on_token_encrypted' - - def up - finalize_background_migration 'ResetDuplicateCiRunnersTokenEncryptedValues' - - add_concurrent_index :ci_runners, - :token_encrypted, - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb b/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb new file mode 100644 index 00000000000..ba08322b1ff --- /dev/null +++ b/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinishResetDuplicateCiRunnersTokenEncryptedValues < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'ResetDuplicateCiRunnersTokenEncryptedValues', + table_name: :ci_runners, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb new file mode 100644 index 00000000000..12fc6a72e84 --- /dev/null +++ b/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnCiRunnersTokenEncrypted < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_uniq_ci_runners_on_token_encrypted' + + def up + add_concurrent_index :ci_runners, + :token_encrypted, + name: INDEX_NAME, + unique: true + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/schema_migrations/20221021082255 b/db/schema_migrations/20221021082255 deleted file mode 100644 index afb266271d4..00000000000 --- a/db/schema_migrations/20221021082255 +++ /dev/null @@ -1 +0,0 @@ -10caa548bccc134775ed14f85eae2b2063e83afe4a932982c353ecf1549a557d \ No newline at end of file diff --git a/db/schema_migrations/20221021082256 b/db/schema_migrations/20221021082256 new file mode 100644 index 00000000000..0074889957f --- /dev/null +++ b/db/schema_migrations/20221021082256 @@ -0,0 +1 @@ +48c2eca5f5feea194eadc9d259f83e54fecbc7be1d219647d0b09ce4e5410eb4 \ No newline at end of file diff --git a/db/schema_migrations/20221021082257 b/db/schema_migrations/20221021082257 new file mode 100644 index 00000000000..43ca84c0427 --- /dev/null +++ b/db/schema_migrations/20221021082257 @@ -0,0 +1 @@ +1f3bf844501eee018b9594b447e55fac6c4628a22a9070cd95f37398067b03d6 \ No newline at end of file diff --git a/db/schema_migrations/20221021082312 b/db/schema_migrations/20221021082312 deleted file mode 100644 index 26007002f54..00000000000 --- a/db/schema_migrations/20221021082312 +++ /dev/null @@ -1 +0,0 @@ -86d979a179c504508fd2e9c1a62e935884297054b13b78a4c1460679d75f5b96 \ No newline at end of file diff --git a/db/schema_migrations/20221021082313 b/db/schema_migrations/20221021082313 new file mode 100644 index 00000000000..5c70993f0b4 --- /dev/null +++ b/db/schema_migrations/20221021082313 @@ -0,0 +1 @@ +9383e4f5ec51cf2971c98b4575546099c551b2a9f328f081c57866dc91838896 \ No newline at end of file diff --git a/db/schema_migrations/20221021082314 b/db/schema_migrations/20221021082314 new file mode 100644 index 00000000000..c35ab7664ef --- /dev/null +++ b/db/schema_migrations/20221021082314 @@ -0,0 +1 @@ +2711e477b81213c7221001a9c75dde169a5b8f2cc2a05534dcdae16ace9231a9 \ No newline at end of file -- cgit v1.2.1