Use migration helper to prevent downtime migration
This commit is contained in:
parent
4cc77c3bf8
commit
52c8b9da37
|
@ -1,11 +1,13 @@
|
||||||
class AddRunUntaggedToCiRunner < ActiveRecord::Migration
|
class AddRunUntaggedToCiRunner < ActiveRecord::Migration
|
||||||
##
|
include Gitlab::Database::MigrationHelpers
|
||||||
# Downtime expected!
|
disable_ddl_transaction!
|
||||||
#
|
|
||||||
# This migration will cause downtime due to exclusive lock
|
def up
|
||||||
# caused by the default value.
|
add_column_with_default(:ci_runners, :run_untagged, :boolean,
|
||||||
#
|
default: true, allow_null: false)
|
||||||
def change
|
end
|
||||||
add_column :ci_runners, :run_untagged, :boolean, default: true, null: false
|
|
||||||
|
def down
|
||||||
|
remove_column(:ci_runners, :run_untagged)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue