2017-03-06 04:50:35 -05:00
|
|
|
class MigrateLegacyManualActions < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
2017-03-16 04:57:53 -04:00
|
|
|
disable_statement_timeout
|
|
|
|
|
2017-03-06 04:50:35 -05:00
|
|
|
execute <<-EOS
|
|
|
|
UPDATE ci_builds SET status = 'manual', allow_failure = true
|
|
|
|
WHERE ci_builds.when = 'manual' AND ci_builds.status = 'skipped';
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2017-03-16 04:57:53 -04:00
|
|
|
disable_statement_timeout
|
|
|
|
|
2017-03-06 04:50:35 -05:00
|
|
|
execute <<-EOS
|
|
|
|
UPDATE ci_builds SET status = 'skipped', allow_failure = false
|
|
|
|
WHERE ci_builds.when = 'manual' AND ci_builds.status = 'manual';
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|