diff options
| author | Robert Speicher <rspeicher@gmail.com> | 2012-09-05 01:00:07 -0400 |
|---|---|---|
| committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-05 01:00:07 -0400 |
| commit | f06d98e907f71dc9b3a4a2da0db1c096b6c07024 (patch) | |
| tree | d9abb23571730dafaae65b4c2ba12fd96907c9c2 /db/migrate | |
| parent | 36738897bf06937056285b0eeabef13928d4d704 (diff) | |
| download | gitlab-ce-f06d98e907f71dc9b3a4a2da0db1c096b6c07024.tar.gz | |
Add SetDefaultBranchDefaultToNil migration
default_branch now defaults to nil, not 'master'. It will be set after the first
push by discover_default_branch.
Diffstat (limited to 'db/migrate')
| -rw-r--r-- | db/migrate/20120905043334_set_default_branch_default_to_nil.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20120905043334_set_default_branch_default_to_nil.rb b/db/migrate/20120905043334_set_default_branch_default_to_nil.rb new file mode 100644 index 00000000000..f5956fe8751 --- /dev/null +++ b/db/migrate/20120905043334_set_default_branch_default_to_nil.rb @@ -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 |
