First checkin
This commit is contained in:
parent
f207e2c8b7
commit
90b30db9e8
260 changed files with 37349 additions and 0 deletions
19
db/migrate/20130104142209_create_comments.rb
Normal file
19
db/migrate/20130104142209_create_comments.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class CreateComments < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :comments do |t|
|
||||
t.string :title, :limit => 50, :default => ""
|
||||
t.text :comment
|
||||
t.references :commentable, :polymorphic => true
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :comments, :commentable_type
|
||||
add_index :comments, :commentable_id
|
||||
add_index :comments, :user_id
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :comments
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue