diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-28 12:01:52 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-07 15:07:29 +0200 |
commit | b7d672328db358690d043aae8b5fc24c358a52ab (patch) | |
tree | c3c79c0c0e39a93e8475d88cd8190a98e65cfe17 /db | |
parent | 16ae7b7a49314b2525f3f32c07dd8a4891fa74e1 (diff) | |
download | gitlab-ce-b7d672328db358690d043aae8b5fc24c358a52ab.tar.gz |
Add initial build stage_id ref background migration
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb index 2eaa798d0aa..44bac4a8cc7 100644 --- a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb +++ b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb @@ -3,7 +3,17 @@ class MigrateStageIdReferenceInBackground < ActiveRecord::Migration DOWNTIME = false + disable_ddl_transaction! + + class Build < ActiveRecord::Base + self.table_name = 'ci_builds' + end + def up + Build.find_each do |build| + BackgroundMigrationWorker + .perform_async('MigrateBuildStageIdReference', [build.id]) + end end def down |