Module: DataMapper::Migrations::PostgresAdapter::ClassMethods

Defined in:
lib/dm-migrations/adapters/dm-postgres-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 PostgreSQL databases.



145
146
147
148
149
150
151
152
153
154
# File 'lib/dm-migrations/adapters/dm-postgres-adapter.rb', line 145

def type_map
  precision = Property::Numeric::DEFAULT_PRECISION
  scale     = Property::Decimal::DEFAULT_SCALE

  @type_map ||= super.merge(
    Property::Binary => { :primitive => 'BYTEA'                                                      },
    BigDecimal       => { :primitive => 'NUMERIC',          :precision => precision, :scale => scale },
    Float            => { :primitive => 'DOUBLE PRECISION'                                           }
  ).freeze
end