- $type = strtolower($type);
- $map = array(
- 'int4' => array('int', null),
- 'int8' => array('int', 'big'),
- 'bytea' => array('blob', null),
- );
- if (isset($map[$type])) {
- return $map[$type];
- } else {
- return array($type, null);
+ foreach ($tableDef['fields'] as $name => &$col) {
+ // No convenient support for field descriptions
+ unset($col['description']);
+
+ /*
+ if (isset($col['size'])) {
+ // Don't distinguish between tinyint and int.
+ if ($col['size'] == 'tiny' && $col['type'] == 'int') {
+ unset($col['size']);
+ }
+ }
+ */
+ $col['type'] = $this->mapType($col);
+ unset($col['size']);
+ }
+ if (!empty($tableDef['primary key'])) {
+ $tableDef['primary key'] = $this->filterKeyDef($tableDef['primary key']);