Skip to content

Commit 1fbd6e4

Browse files
committedJun 26, 2014
update migration and test schema to *not* set default values for ID columns
1 parent 6a04f39 commit 1fbd6e4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎lib/generators/acts_as_commentable_with_threading_migration/templates/migration.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
22
def self.up
33
create_table :comments, :force => true do |t|
4-
t.integer :commentable_id, :default => 0
4+
t.integer :commentable_id
55
t.string :commentable_type
66
t.string :title
77
t.text :body
88
t.string :subject
9-
t.integer :user_id, :default => 0, :null => false
9+
t.integer :user_id, :null => false
1010
t.integer :parent_id, :lft, :rgt
1111
t.timestamps
1212
end
13-
13+
1414
add_index :comments, :user_id
1515
add_index :comments, [:commentable_id, :commentable_type]
1616
end
17-
17+
1818
def self.down
1919
drop_table :comments
2020
end

‎spec/db/schema.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
create_table "users", :force => true do |t|
33
t.timestamps
44
end
5-
5+
66
create_table "commentables", :force => true do |t|
77
t.timestamps
88
end
99

1010
create_table "comments", :force => true do |t|
11-
t.integer "commentable_id", :default => 0
11+
t.integer "commentable_id"
1212
t.string "commentable_type", :limit => 15, :default => ""
1313
t.string "title", :default => ""
1414
t.text "body", :default => ""
1515
t.string "subject", :default => ""
16-
t.integer "user_id", :default => 0, :null => false
16+
t.integer "user_id", :null => false
1717
t.integer "parent_id"
1818
t.integer "lft"
1919
t.integer "rgt"

0 commit comments

Comments
 (0)