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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2012-09-05 09:00:07 +0400
committerRobert Speicher <rspeicher@gmail.com>2012-09-05 09:00:07 +0400
commitf06d98e907f71dc9b3a4a2da0db1c096b6c07024 (patch)
treed9abb23571730dafaae65b4c2ba12fd96907c9c2 /db
parent36738897bf06937056285b0eeabef13928d4d704 (diff)
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')
-rw-r--r--db/migrate/20120905043334_set_default_branch_default_to_nil.rb12
-rw-r--r--db/schema.rb18
2 files changed, 21 insertions, 9 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
diff --git a/db/schema.rb b/db/schema.rb
index 46461e44aad..00bb55234af 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120729131232) do
+ActiveRecord::Schema.define(:version => 20120905043334) do
create_table "events", :force => true do |t|
t.string "target_type"
@@ -98,16 +98,16 @@ ActiveRecord::Schema.define(:version => 20120729131232) do
t.string "name"
t.string "path"
t.text "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "private_flag", :default => true, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "private_flag", :default => true, :null => false
t.string "code"
t.integer "owner_id"
- t.string "default_branch", :default => "master", :null => false
- t.boolean "issues_enabled", :default => true, :null => false
- t.boolean "wall_enabled", :default => true, :null => false
- t.boolean "merge_requests_enabled", :default => true, :null => false
- t.boolean "wiki_enabled", :default => true, :null => false
+ t.string "default_branch"
+ t.boolean "issues_enabled", :default => true, :null => false
+ t.boolean "wall_enabled", :default => true, :null => false
+ t.boolean "merge_requests_enabled", :default => true, :null => false
+ t.boolean "wiki_enabled", :default => true, :null => false
end
create_table "protected_branches", :force => true do |t|