Retrospring/db/migrate/20141130175749_create_smile...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
312 B
Ruby
Raw Normal View History

class CreateSmiles < ActiveRecord::Migration[4.2]
2014-11-30 10:43:22 -08:00
def change
create_table :smiles do |t|
t.integer :user_id
t.integer :answer_id
t.timestamps
end
add_index :smiles, :user_id
add_index :smiles, :answer_id
add_index :smiles, [:user_id, :answer_id], unique: true
end
end