aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/dbi_discrete.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/dbi_discrete.rb')
-rw-r--r--lib/sisu/v6/dbi_discrete.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/sisu/v6/dbi_discrete.rb b/lib/sisu/v6/dbi_discrete.rb
index d4efe687..4c3efc46 100644
--- a/lib/sisu/v6/dbi_discrete.rb
+++ b/lib/sisu/v6/dbi_discrete.rb
@@ -81,7 +81,9 @@ module SiSU_DBI_Discrete #% database building
@md=@particulars.md
if @opt.act[:sqlite][:set]==:on
@sql_type=:sqlite
- maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
+ if @opt.act[:maintenance][:set]==:on
+ maintenance_check(@opt,__FILE__,__LINE__)
+ end
end
@output_path=@md.file.output_path.sqlite_discrete.dir
@filename=@md.file.base_filename.sqlite_discrete
@@ -180,13 +182,19 @@ module SiSU_DBI_Discrete #% database building
def populate
end
def sql_maintenance_file
- file=if @opt.inspect =~/M/
+ file=if @opt.act[:maintenance][:set]==:on
if @opt.fns and not @opt.fns.empty?
@env=SiSU_Env::InfoEnv.new(@opt.fns) if @opt.fns
- puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql" if @sql_type ==:sqlite and @opt.act[:maintenance][:set]==:on
+ if @sql_type ==:sqlite
+ puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql"
+ end
@db=SiSU_Env::InfoDb.new
@job="sqlite3 #{@db.sqlite.db} < #{@env.processing_path.sqlite}/#{@opt.fns}.sql"
- File.new("#{@env.processing_path.sqlite}/#{@opt.fns}.sql",'w+')
+ if @sql_type ==:sqlite
+ File.new("#{@env.processing_path.sqlite}/#{@opt.fns}.sql",'w+')
+ else
+ File.new("#{@env.processing_path.postgresql}/#{@opt.fns}.sql",'w+')
+ end
elsif @opt.fns \
and @opt.fns.inspect =~/create/
nil #sort variations later