Files
nairobi/db/migrate/20150825124821_adds_votable_cache_field_to_comments.rb

12 lines
422 B
Ruby

class AddsVotableCacheFieldToComments < ActiveRecord::Migration
def change
add_column :comments, :cached_votes_total, :integer, default: 0
add_column :comments, :cached_votes_up, :integer, default: 0
add_column :comments, :cached_votes_down, :integer, default: 0
add_index :comments, :cached_votes_total
add_index :comments, :cached_votes_up
add_index :comments, :cached_votes_down
end
end