retrospring/db/migrate/20140801175137_create_comments.rb
2014-10-28 06:36:38 +01:00

12 lines
257 B
Ruby

class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.string :content
t.integer :answer_id
t.integer :user_id
t.timestamps
end
add_index :comments, [:user_id, :created_at]
end
end