Created
December 7, 2012 21:26
-
-
Save CarlosEspejo/4236663 to your computer and use it in GitHub Desktop.
indexing needed?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateListProductInteractions < ActiveRecord::Migration | |
def change | |
create_table :list_product_interactions do |t| | |
t.integer :votes_up, default: 0 | |
t.integer :votes_down, default: 0 | |
t.integer :votes_activity, default: 0 | |
t.integer :votes_total, default: 0 | |
t.integer :list_id | |
t.integer :product_id | |
t.timestamps | |
end | |
end | |
end | |
class CreateVotes < ActiveRecord::Migration | |
def change | |
create_table :votes do |t| | |
t.string :status | |
t.boolean :vote_up | |
t.boolean :vote_down | |
t.integer :user_id | |
t.timestamps | |
end | |
add_index :votes, :user_id | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment