retrospring/db/migrate/20141130175749_create_smiles.rb

17 lines
342 B
Ruby
Raw Normal View History

2023-10-20 01:37:34 +02:00
# frozen_string_literal: true
class CreateSmiles < ActiveRecord::Migration[4.2]
2014-11-30 19:43:22 +01: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
2023-10-20 01:37:34 +02:00
add_index :smiles, %i[user_id answer_id], unique: true
2014-11-30 19:43:22 +01:00
end
end