mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Better import for Drupal QA
This commit is contained in:
@ -17,6 +17,10 @@ class ImportScripts::Drupal < ImportScripts::Base
|
||||
)
|
||||
end
|
||||
|
||||
def categories_query
|
||||
@client.query("SELECT tid, name, description FROM taxonomy_term_data WHERE vid = 1")
|
||||
end
|
||||
|
||||
def execute
|
||||
create_users(@client.query("SELECT uid id, name, mail email, created FROM users;")) do |row|
|
||||
{id: row['id'], username: row['name'], email: row['email'], created_at: Time.zone.at(row['created'])}
|
||||
@ -27,7 +31,7 @@ class ImportScripts::Drupal < ImportScripts::Base
|
||||
# * Drupal allows duplicate category names, so you may need to exclude some categories or rename them here.
|
||||
# * Table name may be term_data.
|
||||
# * May need to select a vid other than 1.
|
||||
create_categories(@client.query("SELECT tid, name, description FROM taxonomy_term_data WHERE vid = 1;")) do |c|
|
||||
create_categories(categories_query) do |c|
|
||||
{id: c['tid'], name: c['name'], description: c['description']}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user