Class: ArJdbc::Tasks::H2DatabaseTasks

Inherits:
HSQLDBDatabaseTasks show all
Defined in:
lib/arjdbc/tasks/h2_database_tasks.rb

Instance Attribute Summary

Attributes inherited from JdbcDatabaseTasks

#configuration

Instance Method Summary collapse

Methods inherited from HSQLDBDatabaseTasks

#create, #drop

Methods inherited from JdbcDatabaseTasks

#charset, #collation, #create, #drop, #expand_path, #initialize, #purge, #resolve_database, #resolve_database_from_url, #structure_dump, #structure_load

Constructor Details

This class inherits a constructor from ArJdbc::Tasks::JdbcDatabaseTasks

Instance Method Details

#delete_database_files(config) ⇒ Object (protected)



21
22
23
24
25
26
27
# File 'lib/arjdbc/tasks/h2_database_tasks.rb', line 21

def delete_database_files(config)
  return unless db_base = database_base_name(config)
  for suffix in [ '.h2,db', '.mv.db', '.lock.db', '.trace.db' ]
    db_file = "#{db_base}#{suffix}"
    File.delete(db_file) if File.exist?(db_file)
  end
end

#do_drop_database(config) ⇒ Object (protected)



10
11
12
13
14
15
16
17
18
# File 'lib/arjdbc/tasks/h2_database_tasks.rb', line 10

def do_drop_database(config)
  # ActiveRecord::JDBCError: org.h2.jdbc.JdbcSQLException:
  # Database is already closed (to disable automatic closing at VM
  # shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-170]:
  # SHUTDOWN COMPACT
  #
  # connection.shutdown
  connection.drop_database resolve_database(config)
end