mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 07:18:06 +08:00
12 lines
434 B
Ruby
12 lines
434 B
Ruby
|
class FixPostActionsIndexAgain < ActiveRecord::Migration
|
||
|
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
|