diff options
Diffstat (limited to 'db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb')
-rw-r--r-- | db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb new file mode 100644 index 00000000000..c9eda410b34 --- /dev/null +++ b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ScheduleFkIndexToCiJobArtifactsOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :index_ci_job_artifacts_on_partition_id_job_id + TABLE_NAME = :ci_job_artifacts + COLUMNS = [:partition_id, :job_id] + + def up + prepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME) + end +end |