function Schema::getFieldTypeMap

Same name in this branch
  1. 11.x core/modules/sqlite/src/Driver/Database/sqlite/Schema.php \Drupal\sqlite\Driver\Database\sqlite\Schema::getFieldTypeMap()
  2. 11.x core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::getFieldTypeMap()
  3. 11.x core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Schema.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Schema::getFieldTypeMap()
  4. 11.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::getFieldTypeMap()
Same name and namespace in other branches
  1. 9 core/modules/sqlite/src/Driver/Database/sqlite/Schema.php \Drupal\sqlite\Driver\Database\sqlite\Schema::getFieldTypeMap()
  2. 9 core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::getFieldTypeMap()
  3. 9 core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::getFieldTypeMap()
  4. 9 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Schema.php \Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses\Schema::getFieldTypeMap()
  5. 9 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::getFieldTypeMap()
  6. 8.9.x core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php \Drupal\Core\Database\Driver\sqlite\Schema::getFieldTypeMap()
  7. 8.9.x core/lib/Drupal/Core/Database/Driver/mysql/Schema.php \Drupal\Core\Database\Driver\mysql\Schema::getFieldTypeMap()
  8. 8.9.x core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php \Drupal\Core\Database\Driver\pgsql\Schema::getFieldTypeMap()
  9. 8.9.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::getFieldTypeMap()
  10. 10 core/modules/sqlite/src/Driver/Database/sqlite/Schema.php \Drupal\sqlite\Driver\Database\sqlite\Schema::getFieldTypeMap()
  11. 10 core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::getFieldTypeMap()
  12. 10 core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::getFieldTypeMap()
  13. 10 core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Schema.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Schema::getFieldTypeMap()
  14. 10 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::getFieldTypeMap()

Overrides Schema::getFieldTypeMap

1 call to Schema::getFieldTypeMap()
Schema::processField in core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
Set database-engine specific properties for a field.

File

core/modules/pgsql/src/Driver/Database/pgsql/Schema.php, line 430

Class

Schema
PostgreSQL implementation of <a href="/api/drupal/core%21lib%21Drupal%21Core%21Database%21Schema.php/class/Schema/11.x" title="Provides a base implementation for Database Schema." class="local">\Drupal\Core\Database\Schema</a>.

Namespace

Drupal\pgsql\Driver\Database\pgsql

Code

public function getFieldTypeMap() {
    // Put :normal last so it gets preserved by array_flip. This makes
    // it much easier for modules (such as schema.module) to map
    // database types back into schema types.
    // $map does not use drupal_static as its value never changes.
    static $map = [
        'varchar_ascii:normal' => 'varchar',
        'varchar:normal' => 'varchar',
        'char:normal' => 'character',
        'text:tiny' => 'text',
        'text:small' => 'text',
        'text:medium' => 'text',
        'text:big' => 'text',
        'text:normal' => 'text',
        'int:tiny' => 'smallint',
        'int:small' => 'smallint',
        'int:medium' => 'int',
        'int:big' => 'bigint',
        'int:normal' => 'int',
        'float:tiny' => 'real',
        'float:small' => 'real',
        'float:medium' => 'real',
        'float:big' => 'double precision',
        'float:normal' => 'real',
        'numeric:normal' => 'numeric',
        'blob:big' => 'bytea',
        'blob:normal' => 'bytea',
        'serial:tiny' => 'serial',
        'serial:small' => 'serial',
        'serial:medium' => 'serial',
        'serial:big' => 'bigserial',
        'serial:normal' => 'serial',
    ];
    return $map;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.