mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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_topic_views
|
||||||
insert_user_actions
|
insert_user_actions
|
||||||
insert_user_options
|
insert_user_options
|
||||||
|
insert_user_profiles
|
||||||
insert_user_stats
|
insert_user_stats
|
||||||
insert_user_visits
|
insert_user_visits
|
||||||
insert_draft_sequences
|
insert_draft_sequences
|
||||||
@ -198,6 +199,17 @@ def insert_user_options
|
|||||||
SQL
|
SQL
|
||||||
end
|
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
|
def insert_user_stats
|
||||||
log "Inserting user stats..."
|
log "Inserting user stats..."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user