diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-21 15:08:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-21 15:08:33 +0300 |
commit | 6c44b676312eb6cdffadef45f9ca3e29a8cc92ab (patch) | |
tree | 06666cd369ac9ad0533cec689f2c2b4fb826f797 /db | |
parent | c1cea595b6a9b4d85424e9afd2cb765101ee04bf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 39 insertions, 0 deletions
diff --git a/db/post_migrate/20230701043315_ensure_backfill_for_ci_pipeline_variables_pipeline_id_is_finished.rb b/db/post_migrate/20230701043315_ensure_backfill_for_ci_pipeline_variables_pipeline_id_is_finished.rb new file mode 100644 index 00000000000..723b074a898 --- /dev/null +++ b/db/post_migrate/20230701043315_ensure_backfill_for_ci_pipeline_variables_pipeline_id_is_finished.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class EnsureBackfillForCiPipelineVariablesPipelineIdIsFinished < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + disable_ddl_transaction! + + TABLE_NAME = :ci_pipeline_variables + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'pipeline_id', + job_arguments: [['pipeline_id'], ['id_convert_to_bigint']] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230702053002_create_async_index_for_ci_pipline_variables_pipeline_id.rb b/db/post_migrate/20230702053002_create_async_index_for_ci_pipline_variables_pipeline_id.rb new file mode 100644 index 00000000000..0919dceed7e --- /dev/null +++ b/db/post_migrate/20230702053002_create_async_index_for_ci_pipline_variables_pipeline_id.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateAsyncIndexForCiPiplineVariablesPipelineId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipeline_variables + INDEX_NAME = "index_ci_pipeline_variables_on_pipeline_id_bigint_and_key" + + def up + prepare_async_index TABLE_NAME, [:pipeline_id_convert_to_bigint, :key], unique: true, name: INDEX_NAME + end + + def down + unprepare_async_index TABLE_NAME, [:pipeline_id_convert_to_bigint, :key], unique: true, name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20230701043315 b/db/schema_migrations/20230701043315 new file mode 100644 index 00000000000..15a1fd9cbfe --- /dev/null +++ b/db/schema_migrations/20230701043315 @@ -0,0 +1 @@ +e2a7487d4da68819a1bdde6626b32ef8399a917a75d4cbc8ecf2fa140ba1ff16
\ No newline at end of file diff --git a/db/schema_migrations/20230702053002 b/db/schema_migrations/20230702053002 new file mode 100644 index 00000000000..a2eb709cd56 --- /dev/null +++ b/db/schema_migrations/20230702053002 @@ -0,0 +1 @@ +54ac5a22e121379b1ffcefc7b4c1f26cadd15a9b0cabfd0d9e3cba3886777d46
\ No newline at end of file |