about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-14 20:24:36 +0200
committerGitHub <noreply@github.com>2018-08-14 20:24:36 +0200
commitbe13e95d066bcef058abb88790d5cdff74f57a21 (patch)
treeae48a19d88f148db74fd9d84a5f0596b26b8846c /db
parent8e111b753a3411b258cdb008c9a53bad696f4df1 (diff)
Fix null constraint violation in copy status stats migration (#8198)
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180812173710_copy_status_stats.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20180812173710_copy_status_stats.rb b/db/migrate/20180812173710_copy_status_stats.rb
index 6ecccc0ae..64a564ca0 100644
--- a/db/migrate/20180812173710_copy_status_stats.rb
+++ b/db/migrate/20180812173710_copy_status_stats.rb
@@ -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