Update migration with add_column_with_default:
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12278454
This commit is contained in:
parent
35954572b8
commit
2ea0148c55
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue