Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20120905043334_set_default_branch_default_to_nil.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f5956fe875184473481fe8673e57a9bab967c95e (plain)
1
2
3
4
5
6
7
8
9
10
11
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