2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class ViewsToTopicViews < ActiveRecord::Migration[4.2]
|
2014-08-04 05:07:55 -04:00
|
|
|
def change
|
|
|
|
remove_column :views, :parent_type
|
|
|
|
rename_column :views, :parent_id, :topic_id
|
|
|
|
|
|
|
|
rename_table :views, :topic_views
|
|
|
|
|
|
|
|
add_index :topic_views, [:topic_id]
|
|
|
|
add_index :topic_views, [:user_id, :topic_id]
|
|
|
|
end
|
|
|
|
end
|