Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
19
db/migrate/011_create_comments.rb
Normal file
19
db/migrate/011_create_comments.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class CreateComments < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :comments, :force => true do |t|
|
||||
t.column :title, :string, :limit => 50, :default => ""
|
||||
t.column :comment, :string, :default => ""
|
||||
t.column :created_at, :datetime, :null => false
|
||||
t.column :commentable_id, :integer, :default => 0, :null => false
|
||||
t.column :commentable_type, :string, :limit => 15,
|
||||
:default => "", :null => false
|
||||
t.column :user_id, :integer, :default => 0, :null => false
|
||||
end
|
||||
|
||||
add_index :comments, ["user_id"], :name => "fk_comments_user"
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :comments
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue