diff --git a/db/migrate/20160509091049_add_locked_to_ci_runner.rb b/db/migrate/20160509091049_add_locked_to_ci_runner.rb index 6294fa9d86b..43376304bd9 100644 --- a/db/migrate/20160509091049_add_locked_to_ci_runner.rb +++ b/db/migrate/20160509091049_add_locked_to_ci_runner.rb @@ -2,7 +2,12 @@ class AddLockedToCiRunner < ActiveRecord::Migration ## # Downtime expected due to exclusive lock when setting default value. # - def change - add_column :ci_runners, :locked, :boolean, default: false, null: false + def up + add_column_with_default(:ci_runners, :locked, :boolean, + default: false, allow_null: false) + end + + def down + remove_column(:ci_runners, :locked) end end