Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-06 20:24:55 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-06 20:24:55 +0300
commit3b35d1f8c153fb31af66049ba5461f9b39c66397 (patch)
tree3dd91ccf38972bc43d70503f543d7e850bb81c92 /db/post_migrate
parent07539ab2b07bf2d1e652a34dcabc7cf907cd9906 (diff)
Migrate legacy actions in post deployment migration
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb19
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