diff options
Diffstat (limited to 'db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb')
-rw-r--r-- | db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb b/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb new file mode 100644 index 00000000000..55b46369870 --- /dev/null +++ b/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexForCiPipelineVariablesBigintId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipeline_variables + INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint" + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/408936 + def up + prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME + end + + def down + unprepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME + end +end |