Revert "Prevent upsert operation"

This reverts commit 641ecd4677b0c95fdbf83a8b4429c51c39e603aa.
This commit is contained in:
Basti 2018-09-03 21:09:01 +08:00
parent 641ecd4677
commit 18c4e7ecb1

View File

@ -9,6 +9,8 @@ class CopyStatusStats < ActiveRecord::Migration[5.2]
SELECT id, reblogs_count, favourites_count, created_at, updated_at
FROM statuses
WHERE id IN (#{statuses.map(&:id).join(', ')})
ON CONFLICT (status_id) DO UPDATE
SET reblogs_count = EXCLUDED.reblogs_count, favourites_count = EXCLUDED.favourites_count
SQL
end
end