Sha256: eeb78ef9435b3ecdacb127b2d4f7191b9022b07e932274877979f8c77b35f188

Contents?: true

Size: 870 Bytes

Versions: 99

Compression:

Stored size: 870 Bytes

Contents

require 'arjdbc/tasks/hsqldb_database_tasks'

module ArJdbc
  module Tasks
    class H2DatabaseTasks < HSQLDBDatabaseTasks

      protected

      # @override
      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

      # @override
      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

    end
  end
end

Version data entries

99 entries across 99 versions & 4 rubygems

Version Path
activerecord-jdbc-alt-adapter-61.3.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-71.0.0.alpha2-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-71.0.0.alpha1-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-70.2.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-70.2-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-61.3-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-70.1.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-70.0.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-70.1-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-70.0.0.rc2-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-60.3.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-61.2.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-70.0.0.rc1-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-70.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-70.0.pre-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-61.2-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-60.2.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-alt-adapter-61.1.0-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-61.1-java lib/arjdbc/tasks/h2_database_tasks.rb
activerecord-jdbc-adapter-60.4-java lib/arjdbc/tasks/h2_database_tasks.rb