discourse/db/migrate/20140815191556_fix_post_actions_index_again.rb
2023-01-09 11:59:41 +00:00

13 lines
436 B
Ruby

# frozen_string_literal: true
class FixPostActionsIndexAgain < ActiveRecord::Migration[4.2]
def change
remove_index "post_actions", name: "idx_unique_actions"
add_index "post_actions",
%w[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