mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
DEV: Create missing user profiles in "import:ensure_consistency" rake task
This commit is contained in:
parent
b2fee68b3f
commit
eabea3e8fd
|
@ -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..."
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user