diff --git a/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb b/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb new file mode 100644 index 0000000000000000000000000000000000000000..b590598f6e964106008c9e03f65aa70c7a610c08 --- /dev/null +++ b/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnRunnersToken < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_runners_token + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :runners_token, unique: true, name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20230928024357 b/db/schema_migrations/20230928024357 new file mode 100644 index 0000000000000000000000000000000000000000..ef98266b60292b65a5759054023932e2724aedd8 --- /dev/null +++ b/db/schema_migrations/20230928024357 @@ -0,0 +1 @@ +230cf1f339827016f9382c97983e78646d01f53f1023cf0030fac35e5a94666f \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index b1efda5adc79bc2fac70fe638777ff4536473002..5a70531f5925944786e9fd33c11d151cba1818f0 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -33121,8 +33121,6 @@ CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON namespaces USING btree ( CREATE INDEX index_namespaces_on_require_two_factor_authentication ON namespaces USING btree (require_two_factor_authentication); -CREATE UNIQUE INDEX index_namespaces_on_runners_token ON namespaces USING btree (runners_token); - CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces USING btree (runners_token_encrypted); CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON namespaces USING btree (shared_runners_minutes_limit, extra_shared_runners_minutes_limit);