Sha256: 27db9ae68c84dceea1221d0eaf8c09506c91f0631bc799a4fd8c59ad17c8b65e
Contents?: true
Size: 669 Bytes
Versions: 2
Compression:
Stored size: 669 Bytes
Contents
module Hourglass if Hourglass.environment.to_s != "test" options = {:logger => Logger.new(File.join(Hourglass.root, "log", "database.log"))} else options = {} end Database = Sequel.connect("jdbc:h2:#{Hourglass.db_path};IGNORECASE=TRUE", options) class << Database def rollback! version = self[:schema_info].first[:version] migrate!(version - 1) end def migrate!(to = nil, from = nil) dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'db', 'migrate')) args = [self, dir] if to args << to args << from if from end Sequel::Migrator.run(*args) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hourglass-0.0.2-java | lib/hourglass/database.rb |
hourglass-0.0.1-java | lib/hourglass/database.rb |