summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-19 22:11:40 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-19 22:11:40 +0200
commit52c8b9da37451943fe97f3a687d43ae39105aaa0 (patch)
tree1a4136d0ab951f1d895ed100ae99f3fb5c8d25bf
parent4cc77c3bf8ef72d1b08160da9f55eb1c5f95e832 (diff)
downloadgitlab-ce-feature/runner-config-untagged-jobs.tar.gz
Use migration helper to prevent downtime migrationfeature/runner-config-untagged-jobs
-rw-r--r--db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
index c6753f2b398..84e5e4eabe2 100644
--- a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
+++ b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
@@ -1,11 +1,13 @@
class AddRunUntaggedToCiRunner < ActiveRecord::Migration
- ##
- # Downtime expected!
- #
- # This migration will cause downtime due to exclusive lock
- # caused by the default value.
- #
- def change
- add_column :ci_runners, :run_untagged, :boolean, default: true, null: false
+ include Gitlab::Database::MigrationHelpers
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:ci_runners, :run_untagged, :boolean,
+ default: true, allow_null: false)
+ end
+
+ def down
+ remove_column(:ci_runners, :run_untagged)
end
end