Better import for Drupal QA
This commit is contained in:
parent
2f8e28c918
commit
28cbebe5ed
2 changed files with 29 additions and 4 deletions
|
@ -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 a new issue