PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb

https://gitlab.com/visay/gitlab-ce
Ruby | 23 lines | 18 code | 5 blank | 0 comment | 0 complexity | 3c54e3c9aa41eacbdb963387d873ac7f MD5 | raw file
 1class MigrateLegacyManualActions < ActiveRecord::Migration
 2  include Gitlab::Database::MigrationHelpers
 3
 4  DOWNTIME = false
 5
 6  def up
 7    disable_statement_timeout
 8
 9    execute <<-EOS
10      UPDATE ci_builds SET status = 'manual', allow_failure = true
11        WHERE ci_builds.when = 'manual' AND ci_builds.status = 'skipped';
12    EOS
13  end
14
15  def down
16    disable_statement_timeout
17
18    execute <<-EOS
19      UPDATE ci_builds SET status = 'skipped', allow_failure = false
20        WHERE ci_builds.when = 'manual' AND ci_builds.status = 'manual';
21    EOS
22  end
23end