0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 04:48:33 +08:00
discourse/db/migrate/20140804072504_views_to_topic_views.rb
2023-01-09 11:59:41 +00:00

13 lines
325 B
Ruby
Vendored

# frozen_string_literal: true
class ViewsToTopicViews < ActiveRecord::Migration[4.2]
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, %i[user_id topic_id]
end
end