DEV: Create missing user profiles in "import:ensure_consistency" rake task

This commit is contained in:
Gerhard Schlager 2023-08-07 12:25:34 +02:00 committed by Gerhard Schlager
parent b2fee68b3f
commit eabea3e8fd

View File

@ -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..."