From 3c189c90642a638c4bca1964c489707b02524d16 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 13 Apr 2015 13:06:26 -0400 Subject: [PATCH] Updates to the Drupal import script - Allow the VID and DB to be configurable by ENV vars. - Make importing the blog optional. --- script/import_scripts/drupal.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/import_scripts/drupal.rb b/script/import_scripts/drupal.rb index 36607613505..82266d77ca8 100644 --- a/script/import_scripts/drupal.rb +++ b/script/import_scripts/drupal.rb @@ -3,7 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + "/base.rb") class ImportScripts::Drupal < ImportScripts::Base - DRUPAL_DB = "newsite3" + DRUPAL_DB = ENV['DRUPAL_DB'] || "newsite3" + VID = ENV['DRUPAL_VID'] || 1 def initialize super @@ -17,7 +18,7 @@ class ImportScripts::Drupal < ImportScripts::Base end def categories_query - @client.query("SELECT tid, name, description FROM taxonomy_term_data WHERE vid = 1") + @client.query("SELECT tid, name, description FROM taxonomy_term_data WHERE vid = #{VID}") end def execute @@ -37,7 +38,10 @@ class ImportScripts::Drupal < ImportScripts::Base # "Nodes" in Drupal are divided into types. Here we import two types, # and will later import all the comments/replies for each node. # You will need to figure out what the type names are on your install and edit the queries to match. - create_blog_topics + if ENV['DRUPAL_IMPORT_BLOG'] + create_blog_topics + end + create_forum_topics create_replies