2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
class FixPostTimings < ActiveRecord::Migration[4.2]
|
2013-02-06 03:16:51 +08:00
|
|
|
def up
|
|
|
|
remove_index :post_timings, [:thread_id, :post_number]
|
|
|
|
remove_index :post_timings, [:thread_id, :post_number, :user_id]
|
|
|
|
rename_column :post_timings, :thread_id, :forum_thread_id
|
|
|
|
add_index :post_timings, [:forum_thread_id, :post_number], name: 'post_timings_summary'
|
2013-02-26 00:42:20 +08:00
|
|
|
add_index :post_timings, [:forum_thread_id, :post_number, :user_id], unique: true, name: 'post_timings_unique'
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2013-02-26 00:42:20 +08:00
|
|
|
rename_column :post_timings, :forum_thread_id, :thread_id
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|