Prevent upsert operation

Only works in newer postgresql, but also not really necessary because
the table is brandnew there.
This commit is contained in:
Basti 2018-09-03 20:43:38 +08:00
parent 35dc6c095a
commit 641ecd4677

View File

@ -9,8 +9,6 @@ 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