2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class FixPostActionsIndexAgain < ActiveRecord::Migration[4.2]
|
2014-08-15 15:33:45 -04:00
|
|
|
def change
|
|
|
|
remove_index "post_actions", name: "idx_unique_actions"
|
|
|
|
add_index "post_actions",
|
|
|
|
["user_id", "post_action_type_id",
|
|
|
|
"post_id", "targets_topic"],
|
|
|
|
name: "idx_unique_actions",
|
|
|
|
unique: true,
|
|
|
|
where: 'deleted_at IS NULL AND disagreed_at IS NULL AND deferred_at IS NULL'
|
|
|
|
end
|
|
|
|
end
|