Module: DataMapper::Migrations::DataObjectsAdapter::ClassMethods

### Home Classes Methods

### In Files

- lib/dm-migrations/adapters/dm-do-adapter.rb

### Methods

- #type_map

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Adapters
- DataMapper::Migration
- DataMapper::MigrationRunner
- DataMapper::Migrations
- DataMapper::Migrations::DataObjectsAdapter
- DataMapper::Migrations::DataObjectsAdapter::ClassMethods
- DataMapper::Migrations::DuplicateMigration
- DataMapper::Migrations::Model
- DataMapper::Migrations::MysqlAdapter
- DataMapper::Migrations::MysqlAdapter::ClassMethods
- DataMapper::Migrations::OracleAdapter
- DataMapper::Migrations::OracleAdapter::ClassMethods
- DataMapper::Migrations::PostgresAdapter
- DataMapper::Migrations::PostgresAdapter::ClassMethods
- DataMapper::Migrations::Repository
- DataMapper::Migrations::SingletonMethods
- DataMapper::Migrations::SqliteAdapter
- DataMapper::Migrations::SqliteAdapter::ClassMethods
- DataMapper::Migrations::SqlserverAdapter
- DataMapper::Migrations::SqlserverAdapter::ClassMethods
- DataMapper::Migrations::YamlAdapter
- SQL
- SQL::Column
- SQL::Mysql
- SQL::Mysql::Column
- SQL::Mysql::Table
- SQL::Postgres
- SQL::Postgres::Column
- SQL::Postgres::Table
- SQL::Sqlite
- SQL::Sqlite::Column
- SQL::Sqlite::Table
- SQL::Table
- SQL::TableCreator
- SQL::TableCreator::Column
- SQL::TableCreator::SqlExpr
- SQL::TableModifier
- Spec
- Spec::Example
- Spec::Example::MigrationExampleGroup
- Spec::Matchers
- Spec::Matchers::Migration
- Spec::Matchers::Migration::HaveColumnMatcher
- Spec::Matchers::Migration::HaveTableMatcher
- Spec::Matchers::Migration::NullableColumnMatcher
- Spec::Matchers::Migration::PrimaryKeyMatcher
- Object

No matching classes.

# DataMapper::Migrations::DataObjectsAdapter::ClassMethods

### Public Instance Methods

type_map() click to toggle source

Default types for all data object based adapters.

@return [Hash] default types for data objects adapters.

@api private

    # File lib/dm-migrations/adapters/dm-do-adapter.rb, line 271
    def type_map
      length    = Property::String.length
      precision = Property::Numeric.precision
      scale     = Property::Decimal.scale

      {
        Property::Binary => { :primitive => 'BLOB'                                              },
        Object           => { :primitive => 'TEXT'                                              },
        Integer          => { :primitive => 'INTEGER'                                           },
        String           => { :primitive => 'VARCHAR', :length => length                        },
        Class            => { :primitive => 'VARCHAR', :length => length                        },
        BigDecimal       => { :primitive => 'DECIMAL', :precision => precision, :scale => scale },
        Float            => { :primitive => 'FLOAT',   :precision => precision                  },
        DateTime         => { :primitive => 'TIMESTAMP'                                         },
        Date             => { :primitive => 'DATE'                                              },
        Time             => { :primitive => 'TIMESTAMP'                                         },
        TrueClass        => { :primitive => 'BOOLEAN'                                           },
        Property::Text   => { :primitive => 'TEXT'                                              },
      }.freeze
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.