diff --git a/db/migrate/20250616135700_add_index_to_workspace_tokens_on_token_encrypted.rb b/db/migrate/20250616135700_add_index_to_workspace_tokens_on_token_encrypted.rb new file mode 100644 index 0000000000000000000000000000000000000000..ac7add7f6f813f816397de62df55ec35d70c0cc8 --- /dev/null +++ b/db/migrate/20250616135700_add_index_to_workspace_tokens_on_token_encrypted.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexToWorkspaceTokensOnTokenEncrypted < Gitlab::Database::Migration[2.3] + milestone '18.2' + + disable_ddl_transaction! + + TABLE_NAME = :workspace_tokens + INDEX_NAME = "index_workspace_tokens_on_token_encrypted" + + def up + add_concurrent_index TABLE_NAME, :token_encrypted, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/schema_migrations/20250616135700 b/db/schema_migrations/20250616135700 new file mode 100644 index 0000000000000000000000000000000000000000..1f798180372cccba5880e946c0c85fb56b1177cb --- /dev/null +++ b/db/schema_migrations/20250616135700 @@ -0,0 +1 @@ +de34af2cf70fdbc5ce241b6c5f5c0d12e0c92ab5d85649828b03ccd65dbc53b8 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9d54a43e43acda34bb6a537d06c6dcb54bdcbbb0..1eb363eb4d9a2874a2911bd140d688b1f2887ca4 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -38479,6 +38479,8 @@ CREATE UNIQUE INDEX index_workspace_agentk_states_on_workspace_id ON workspace_a CREATE INDEX index_workspace_tokens_on_project_id ON workspace_tokens USING btree (project_id); +CREATE INDEX index_workspace_tokens_on_token_encrypted ON workspace_tokens USING btree (token_encrypted); + CREATE UNIQUE INDEX index_workspace_tokens_on_workspace_id ON workspace_tokens USING btree (workspace_id); CREATE INDEX index_workspace_variables_on_project_id ON workspace_variables USING btree (project_id);