Skip to content
Snippets Groups Projects
Unverified Commit be13e95d authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix null constraint violation in copy status stats migration (#8198)

parent 8e111b75
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,8 @@ class CopyStatusStats < ActiveRecord::Migration[5.2]
def up
safety_assured do
execute <<-SQL.squish
INSERT INTO status_stats (status_id, reblogs_count, favourites_count)
SELECT id, reblogs_count, favourites_count
INSERT INTO status_stats (status_id, reblogs_count, favourites_count, created_at, updated_at)
SELECT id, reblogs_count, favourites_count, created_at, updated_at
FROM statuses
ON CONFLICT (status_id) DO UPDATE
SET reblogs_count = EXCLUDED.reblogs_count, favourites_count = EXCLUDED.favourites_count
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment