This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
binaryattraction/schema/migrations/003_create_votes_migration.rb

17 lines
343 B
Ruby

class CreateVotesMigration < ActiveRecord::Migration
def self.up
create_table :votes do |t|
t.integer :photo_id, :user_id
t.string :session_id
t.boolean :vote
end
add_index :votes, :photo_id
add_index :votes, :user_id
add_index :votes, :session_id
end
def self.down
drop_table :votes
end
end