This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
2008-10-01 02:19:35 -04:00
|
|
|
class CreateVotesMigration < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :votes do |t|
|
|
|
|
t.integer :photo_id, :user_id
|
2008-10-11 04:22:58 -04:00
|
|
|
t.string :session_id
|
2008-10-01 02:19:35 -04:00
|
|
|
t.boolean :vote
|
|
|
|
end
|
|
|
|
add_index :votes, :photo_id
|
|
|
|
add_index :votes, :user_id
|
2008-10-11 04:22:58 -04:00
|
|
|
add_index :votes, :session_id
|
2008-10-01 02:19:35 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :votes
|
|
|
|
end
|
|
|
|
end
|