Sha256: 4d27679ec611d4ab12bc344c77d37040a9d70fe8846998782325b41da824306a

Contents?: true

Size: 828 Bytes

Versions: 4

Compression:

Stored size: 828 Bytes

Contents

# -*- coding: utf-8 -*-

require 'sequel'
if Sequel::DATABASES.first.nil?
  db = Sequel.connect(Dcmgr.conf.database_url)
else
  db = Sequel::DATABASES.first
end

#require 'logger' 
#db.loggers << Logger.new(STDERR)
if db.is_a?(Sequel::MySQL::Database)
  Sequel::MySQL.default_charset = 'utf8'
  Sequel::MySQL.default_collate = 'utf8_general_ci'
  Sequel::MySQL.default_engine = 'InnoDB'

  db << "SET AUTOCOMMIT=0"
  Dcmgr::Models::BaseNew.default_row_lock_mode = nil
end

# Disable TEXT to Sequel::SQL::Blob translation.
# see the thread: MySQL text turning into blobs
# http://groups.google.com/group/sequel-talk/browse_thread/thread/d0f4c85abe9b3227/9ceaf291f90111e6
# lib/sequel/adapters/mysql.rb
[249, 250, 251, 252].each { |v|
  Sequel::MySQL::MYSQL_TYPES.delete(v)
}

# Set timezone to UTC
Sequel.default_timezone = :utc

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
wakame-vdc-agents-11.12.0 config/initializers/sequel.rb
wakame-vdc-dcmgr-11.12.0 config/initializers/sequel.rb
wakame-vdc-agents-11.06.0 config/initializers/sequel.rb
wakame-vdc-dcmgr-11.06.0 config/initializers/sequel.rb