From eabea3e8fd08377e48c9372c95c3d2bb7098f9a5 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Mon, 7 Aug 2023 12:25:34 +0200 Subject: [PATCH] DEV: Create missing user profiles in "import:ensure_consistency" rake task --- lib/tasks/import.rake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index e8f62e8f4c0..79eb54726d1 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -11,6 +11,7 @@ task "import:ensure_consistency" => :environment do insert_topic_views insert_user_actions insert_user_options + insert_user_profiles insert_user_stats insert_user_visits insert_draft_sequences @@ -198,6 +199,17 @@ def insert_user_options SQL end +def insert_user_profiles + log "Inserting user profiles..." + + DB.exec <<-SQL + INSERT INTO user_profiles (user_id) + SELECT id + FROM users + ON CONFLICT DO NOTHING + SQL +end + def insert_user_stats log "Inserting user stats..."