retrospring/db/migrate/20140801175137_create_comments.rb
2023-10-21 13:01:07 +02:00

14 lines
292 B
Ruby

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