Class: JunglePath::DBAccess::Import::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/jungle_path/db_access/import/schema.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, logger = nil) ⇒ Schema

Returns a new instance of Schema.



9
10
11
12
13
14
15
16
# File 'lib/jungle_path/db_access/import/schema.rb', line 9

def initialize(config, logger=nil)
	@logger = logger
	@path = config.import_file_path
	#@db = nil
	#if config.postgresql
	#	@db = JunglePath::DBAccess::IO::DB.new(config.postgresql, @logger)
	#end
end

Instance Method Details

#create_table(table_class) ⇒ Object



26
27
28
29
30
31
# File 'lib/jungle_path/db_access/import/schema.rb', line 26

def create_table(table_class)
	raise 'create_table method not implemented'
	#if @db
	#	@db.schema.create_table(table_class)
	#end
end

#drop_table(table_class) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/jungle_path/db_access/import/schema.rb', line 18

def drop_table(table_class)
	file_name = JunglePath::DBAccess::Import.data_file_name(@path, table_class.table_name)
	File.delete file_name if File.exist?(file_name)
	#if @db
	#	@db.schema.drop_table(table_class)
	#end
end