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.

Returns:

  • (Hash)

    types for PostgreSQL databases.



139
140
141
142
143
144
145
146
147
148
# File 'lib/dm-migrations/adapters/dm-postgres-adapter.rb', line 139

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

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