Commit 52c8b9da authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use migration helper to prevent downtime migration

parent 4cc77c3b
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
def up
add_column_with_default(:ci_runners, :run_untagged, :boolean,
default: true, allow_null: false)
def down
remove_column(:ci_runners, :run_untagged)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment