summaryrefslogtreecommitdiff
path: root/db/post_migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-25 15:10:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-25 15:10:55 +0000
commitc59393a068f9d0113cc10ca8798d333d6a0e3d53 (patch)
tree57de87b7bb6206957fa0359551a50661d44bf594 /db/post_migrate
parentf471d836199c3e35a80769a6daa5c4b6a52be8d7 (diff)
downloadgitlab-ce-c59393a068f9d0113cc10ca8798d333d6a0e3d53.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb20
-rw-r--r--db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb20
-rw-r--r--db/post_migrate/20221021082720_drop_index_on_ci_runners_token.rb17
-rw-r--r--db/post_migrate/20221021082734_drop_index_on_ci_runners_token_encrypted.rb17
4 files changed, 74 insertions, 0 deletions
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
new file mode 100644
index 00000000000..3dfa44f9615
--- /dev/null
+++ b/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb
@@ -0,0 +1,20 @@
+# 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/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb
new file mode 100644
index 00000000000..8728c0ff20e
--- /dev/null
+++ b/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb
@@ -0,0 +1,20 @@
+# 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/20221021082720_drop_index_on_ci_runners_token.rb b/db/post_migrate/20221021082720_drop_index_on_ci_runners_token.rb
new file mode 100644
index 00000000000..9125831fbf3
--- /dev/null
+++ b/db/post_migrate/20221021082720_drop_index_on_ci_runners_token.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class DropIndexOnCiRunnersToken < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_runners_on_token'
+
+ def up
+ remove_concurrent_index_by_name :ci_runners, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :ci_runners,
+ :token,
+ name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20221021082734_drop_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082734_drop_index_on_ci_runners_token_encrypted.rb
new file mode 100644
index 00000000000..39771fb5f85
--- /dev/null
+++ b/db/post_migrate/20221021082734_drop_index_on_ci_runners_token_encrypted.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class DropIndexOnCiRunnersTokenEncrypted < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_runners_on_token_encrypted'
+
+ def up
+ remove_concurrent_index_by_name :ci_runners, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :ci_runners,
+ :token_encrypted,
+ name: INDEX_NAME
+ end
+end