Module: DataMapper::Migrations::SqlserverAdapter::ClassMethods

Defined in:
lib/dm-migrations/adapters/dm-sqlserver-adapter.rb

Instance Method Summary collapse

Instance Method Details

#type_mapHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Types for Sqlserver databases.



160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/dm-migrations/adapters/dm-sqlserver-adapter.rb', line 160

def type_map
  length    = Property::String.length
  precision = Property::Numeric.precision
  scale     = Property::Decimal.scale

  super.merge(
    DateTime       => { :primitive => 'DATETIME'                   },
    Date           => { :primitive => 'SMALLDATETIME'              },
    Time           => { :primitive => 'SMALLDATETIME'              },
    TrueClass      => { :primitive => 'BIT',                       },
    Property::Text => { :primitive => 'NVARCHAR', :length => 'max' }
  ).freeze
end