mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
IMPORT: create category definitions in import:ensure_consistency
task
This commit is contained in:
@ -20,6 +20,7 @@ task "import:ensure_consistency" => :environment do
|
||||
update_users
|
||||
update_groups
|
||||
update_tag_stats
|
||||
create_category_definitions
|
||||
|
||||
log "Done!"
|
||||
end
|
||||
@ -425,6 +426,11 @@ def update_tag_stats
|
||||
Tag.ensure_consistency!
|
||||
end
|
||||
|
||||
def create_category_definitions
|
||||
log "Creating category definitions"
|
||||
Category.where(topic_id: nil).each(&:create_category_definition)
|
||||
end
|
||||
|
||||
def log(message)
|
||||
puts "[#{DateTime.now.strftime("%Y-%m-%d %H:%M:%S")}] #{message}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user