2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class CreateHotTopics < ActiveRecord::Migration[4.2]
|
2013-03-28 13:02:59 -04:00
|
|
|
def change
|
|
|
|
create_table :hot_topics, force: true do |t|
|
|
|
|
t.integer :topic_id, null: false
|
|
|
|
t.integer :category_id, null: true
|
|
|
|
t.float :score, null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index :hot_topics, :topic_id, unique: true
|
|
|
|
add_index :hot_topics, :score, order: "desc"
|
|
|
|
end
|
|
|
|
end
|