creddit/db/migrate/20150716155403_create_comments.rb

15 lines
341 B
Ruby
Raw Normal View History

2015-07-16 11:57:27 -04:00
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.references :user, index: true, foreign_key: true
t.references :post, index: true, foreign_key: true
t.string :ancestry
t.text :content
t.timestamps null: false
end
add_index :comments, :ancestry
end
end