2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class AddQuarterlyToTopTopics < ActiveRecord::Migration[4.2]
|
2015-07-28 12:31:31 -04:00
|
|
|
def change
|
|
|
|
add_column :top_topics, :quarterly_posts_count, :integer, default: 0, null: false
|
|
|
|
add_column :top_topics, :quarterly_views_count, :integer, default: 0, null: false
|
|
|
|
add_column :top_topics, :quarterly_likes_count, :integer, default: 0, null: false
|
|
|
|
add_column :top_topics, :quarterly_score, :float, default: 0.0
|
|
|
|
add_column :top_topics, :quarterly_op_likes_count, :integer, default: 0, null: false
|
|
|
|
|
|
|
|
add_index :top_topics, [:quarterly_posts_count]
|
|
|
|
add_index :top_topics, [:quarterly_views_count]
|
|
|
|
add_index :top_topics, [:quarterly_likes_count]
|
|
|
|
add_index :top_topics, [:quarterly_op_likes_count]
|
|
|
|
end
|
|
|
|
end
|