Prevent upsert operation
Only works in newer postgresql, but also not really necessary because the table is brandnew there.
This commit is contained in:
parent
35dc6c095a
commit
641ecd4677
@ -9,8 +9,6 @@ class CopyStatusStats < ActiveRecord::Migration[5.2]
|
|||||||
SELECT id, reblogs_count, favourites_count, created_at, updated_at
|
SELECT id, reblogs_count, favourites_count, created_at, updated_at
|
||||||
FROM statuses
|
FROM statuses
|
||||||
WHERE id IN (#{statuses.map(&:id).join(', ')})
|
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
|
SQL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user