Module: DataMapper::Adapters::DataObjectsAdapter::Migration::ClassMethods
- Included in:
- DataMapper::Adapters::DataObjectsAdapter
- Defined in:
- lib/dm-core/adapters/data_objects_adapter.rb
Instance Method Summary collapse
-
#type_map ⇒ DataMapper::TypeMap
Default TypeMap for all data object based adapters.
Instance Method Details
#type_map ⇒ DataMapper::TypeMap
Default TypeMap for all data object based adapters.
TODO: move to dm-more/dm-migrations
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/dm-core/adapters/data_objects_adapter.rb', line 610 def type_map @type_map ||= TypeMap.new(super) do |tm| tm.map(Integer).to('INT') tm.map(String).to('VARCHAR').with(:size => Property::DEFAULT_LENGTH) tm.map(Class).to('VARCHAR').with(:size => Property::DEFAULT_LENGTH) tm.map(DM::Discriminator).to('VARCHAR').with(:size => Property::DEFAULT_LENGTH) tm.map(BigDecimal).to('DECIMAL').with(:precision => Property::DEFAULT_PRECISION, :scale => Property::DEFAULT_SCALE_BIGDECIMAL) tm.map(Float).to('FLOAT').with(:precision => Property::DEFAULT_PRECISION) tm.map(DateTime).to('DATETIME') tm.map(Date).to('DATE') tm.map(Time).to('TIMESTAMP') tm.map(TrueClass).to('BOOLEAN') tm.map(DM::Object).to('TEXT') tm.map(DM::Text).to('TEXT') end end |