Add SetDefaultBranchDefaultToNil migration
default_branch now defaults to nil, not 'master'. It will be set after the first push by discover_default_branch.
This commit is contained in:
parent
36738897bf
commit
f06d98e907
3 changed files with 22 additions and 10 deletions
|
@ -0,0 +1,12 @@
|
|||
class SetDefaultBranchDefaultToNil < ActiveRecord::Migration
|
||||
def up
|
||||
# Set the default_branch to allow nil, and default it to nil
|
||||
change_column_null(:projects, :default_branch, true)
|
||||
change_column_default(:projects, :default_branch, nil)
|
||||
end
|
||||
|
||||
def down
|
||||
change_column_null(:projects, :default_branch, false)
|
||||
change_column_default(:projects, :default_branch, 'master')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue