Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-21 18:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-21 18:09:01 +0300
commitc39e93b52ed569635a9ae178115f77ae563b3332 (patch)
treed58e66290883100d57dc95bdb39a6169f90a0490 /db
parent0c4570435d417b69efd433057f95f01810618837 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb23
-rw-r--r--db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb15
-rw-r--r--db/schema_migrations/202306220737521
-rw-r--r--db/schema_migrations/202306230739061
4 files changed, 40 insertions, 0 deletions
diff --git a/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb b/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb
new file mode 100644
index 00000000000..56aeafc0a66
--- /dev/null
+++ b/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class EnsureBackfillCiPipelinesBigintIdIsCompleted < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_pipelines
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
+ table_name: TABLE_NAME,
+ column_name: 'id',
+ job_arguments: [['id'], ['id_convert_to_bigint']]
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb b/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb
new file mode 100644
index 00000000000..57d4e37ca7c
--- /dev/null
+++ b/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class PrepareAsyncIndexForCiPipelinesBigintId < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_pipelines
+ INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint"
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/397000
+ 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
diff --git a/db/schema_migrations/20230622073752 b/db/schema_migrations/20230622073752
new file mode 100644
index 00000000000..5dcd11379dc
--- /dev/null
+++ b/db/schema_migrations/20230622073752
@@ -0,0 +1 @@
+0bf41a90a42bd448727459b22f94b24f78e933fc2f5d1f4b27cf37c40cc7bbe6 \ No newline at end of file
diff --git a/db/schema_migrations/20230623073906 b/db/schema_migrations/20230623073906
new file mode 100644
index 00000000000..0783428a741
--- /dev/null
+++ b/db/schema_migrations/20230623073906
@@ -0,0 +1 @@
+d76cadfee80a039889d8abe1a0d62f37db683d7c82f7b2bc9a5882af6c65cdf9 \ No newline at end of file