summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-06-03 15:09:49 +0900
committerShinya Maeda <shinya@gitlab.com>2018-06-04 14:14:20 +0900
commit623accf9cb3babb81d789a013e6ad87ad0bf26e5 (patch)
tree6c999d8c6c5c60fb84cff380bd15576a34cdbde1 /db
parentbcd664f53a4009bc752fbc47e1c4d6f76c0b8cc2 (diff)
downloadgitlab-ce-623accf9cb3babb81d789a013e6ad87ad0bf26e5.tar.gz
Add type_build to ScheduleToArchiveLegacyTraces::Build
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb b/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
index ea782e1596b..965cd3a8714 100644
--- a/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
+++ b/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
@@ -12,6 +12,8 @@ class ScheduleToArchiveLegacyTraces < ActiveRecord::Migration
self.table_name = 'ci_builds'
self.inheritance_column = :_type_disabled # Disable STI
+ scope :type_build, -> { where(type: 'Ci::Build') }
+
scope :finished, -> { where(status: [:success, :failed, :canceled]) }
scope :without_archived_trace, -> do
@@ -21,7 +23,7 @@ class ScheduleToArchiveLegacyTraces < ActiveRecord::Migration
def up
queue_background_migration_jobs_by_range_at_intervals(
- ::ScheduleToArchiveLegacyTraces::Build.finished.without_archived_trace,
+ ::ScheduleToArchiveLegacyTraces::Build.type_build.finished.without_archived_trace,
BACKGROUND_MIGRATION_CLASS,
5.minutes,
batch_size: BATCH_SIZE)