Module: DataMapper::Adapters::MysqlAdapter::Migration::ClassMethods

Included in:
DataMapper::Adapters::MysqlAdapter
Defined in:
lib/gems/dm-core-0.9.7/lib/dm-core/adapters/mysql_adapter.rb

Instance Method Summary collapse

Instance Method Details

#type_mapDataMapper::TypeMap

TypeMap for MySql databases.

TODO: move to dm-more/dm-migrations

Returns:



122
123
124
125
126
127
128
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/adapters/mysql_adapter.rb', line 122

def type_map
  @type_map ||= TypeMap.new(super) do |tm|
    tm.map(Integer).to('INT').with(:size => 11)
    tm.map(TrueClass).to('TINYINT').with(:size => 1)  # TODO: map this to a BIT or CHAR(0) field?
    tm.map(Object).to('TEXT')
  end
end