summaryrefslogtreecommitdiff
path: root/db/post_migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-25 23:00:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-25 23:00:08 +0000
commitffd073a49240263b25ef98867bea6cc261bf7909 (patch)
treec43de093fdcd39657e5782c5ce1be79622b74fd8 /db/post_migrate
parent0ce33bd2eaa8fe22ad59d7c198bb700f80503db9 (diff)
downloadgitlab-ce-ffd073a49240263b25ef98867bea6cc261bf7909.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-ee
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb18
-rw-r--r--db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb22
2 files changed, 34 insertions, 6 deletions
diff --git a/db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb b/db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
index f11c0bbe33a..1ffe9abbc58 100644
--- a/db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
+++ b/db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
@@ -24,12 +24,18 @@ class ScheduleBackfillingArtifactExpiryMigration < ActiveRecord::Migration[6.0]
# Needs to be removed in a later migration
add_concurrent_index(:ci_job_artifacts, %i(id created_at), where: INDEX_CONDITION, name: INDEX_NAME)
- queue_background_migration_jobs_by_range_at_intervals(
- JobArtifact.without_expiry_date.before_switch,
- ::Gitlab::BackgroundMigration::BackfillArtifactExpiryDate,
- 2.minutes,
- batch_size: 200_000
- )
+ # queue_background_migration_jobs_by_range_at_intervals(
+ # JobArtifact.without_expiry_date.before_switch,
+ # ::Gitlab::BackgroundMigration::BackfillArtifactExpiryDate,
+ # 2.minutes,
+ # batch_size: 200_000
+ # )
+ # The scheduling code was using the full class symbol
+ # (`::Gitlab::BackgroundMigration::BackfillArtifactExpiryDate`) instead of a
+ # string with the class name (`BackfillArtifactExpiryDate`) by mistake,
+ # which resulted in an error. It is commented out so it's a no-op to prevent
+ # errors and will be reintroduced with
+ # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51822.
end
def down
diff --git a/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb b/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb
new file mode 100644
index 00000000000..8a03a90a1c5
--- /dev/null
+++ b/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class CancelArtifactExpiryBackfill < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ MIGRATION = 'BackfillArtifactExpiryDate'
+
+ disable_ddl_transaction!
+
+ def up
+ Gitlab::BackgroundMigration.steal(MIGRATION) do |job|
+ job.delete
+
+ false
+ end
+ end
+
+ def down
+ # no-op
+ end
+end