diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-06 18:24:55 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-06 18:24:55 +0100 |
commit | 3b35d1f8c153fb31af66049ba5461f9b39c66397 (patch) | |
tree | 3dd91ccf38972bc43d70503f543d7e850bb81c92 /db/post_migrate | |
parent | 07539ab2b07bf2d1e652a34dcabc7cf907cd9906 (diff) | |
download | gitlab-ce-3b35d1f8c153fb31af66049ba5461f9b39c66397.tar.gz |
Migrate legacy actions in post deployment migration
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb b/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb new file mode 100644 index 00000000000..9020e0d054c --- /dev/null +++ b/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb @@ -0,0 +1,19 @@ +class MigrateLegacyManualActions < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + 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 + execute <<-EOS + UPDATE ci_builds SET status = 'skipped', allow_failure = false + WHERE ci_builds.when = 'manual' AND ci_builds.status = 'manual'; + EOS + end +end |