Commit c38137d5 authored by zYne's avatar zYne

int alias added

parent f2e19fd9
...@@ -75,6 +75,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -75,6 +75,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return 'BLOB SUB_TYPE 0'; return 'BLOB SUB_TYPE 0';
case 'integer': case 'integer':
case 'enum': case 'enum':
case 'int':
return 'INT'; return 'INT';
case 'boolean': case 'boolean':
return 'SMALLINT'; return 'SMALLINT';
...@@ -89,8 +90,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -89,8 +90,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
case 'decimal': case 'decimal':
$length = !empty($field['length']) ? $field['length'] : 18; $length = !empty($field['length']) ? $field['length'] : 18;
return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')'; return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
default:
throw new Doctrine_DataDict_Exception('Unknown field type '. $field['type']);
} }
return '';
} }
/** /**
* Maps a native array description of a field to a Doctrine datatype and length * Maps a native array description of a field to a Doctrine datatype and length
......
...@@ -90,6 +90,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict ...@@ -90,6 +90,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
return 'IMAGE'; return 'IMAGE';
case 'integer': case 'integer':
case 'enum': case 'enum':
case 'int':
return 'INT'; return 'INT';
case 'boolean': case 'boolean':
return 'BIT'; return 'BIT';
...@@ -105,7 +106,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict ...@@ -105,7 +106,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
$length = !empty($field['length']) ? $field['length'] : 18; $length = !empty($field['length']) ? $field['length'] : 18;
return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')'; return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
} }
return ''; throw new Doctrine_DataDict_Exception('Unknown column type.');
} }
/** /**
* Maps a native array description of a field to a MDB2 datatype and length * Maps a native array description of a field to a MDB2 datatype and length
......
...@@ -72,6 +72,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -72,6 +72,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
return 'BLOB'; return 'BLOB';
case 'integer': case 'integer':
case 'enum': case 'enum':
case 'int':
if (!empty($field['length'])) { if (!empty($field['length'])) {
return 'NUMBER('.$field['length'].')'; return 'NUMBER('.$field['length'].')';
} }
...@@ -86,6 +87,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -86,6 +87,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
return 'NUMBER'; return 'NUMBER';
case 'decimal': case 'decimal':
return 'NUMBER(*,'.$this->conn->options['decimal_places'].')'; return 'NUMBER(*,'.$this->conn->options['decimal_places'].')';
default:
throw new Doctrine_DataDict_Exception('Unknown field type '. $field['type']);
} }
} }
/** /**
...@@ -97,7 +100,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -97,7 +100,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
*/ */
public function getPortableDeclaration(array $field) public function getPortableDeclaration(array $field)
{ {
$db_type = strtolower($field['type']); $dbType = strtolower($field['type']);
$type = array(); $type = array();
$length = $unsigned = $fixed = null; $length = $unsigned = $fixed = null;
if (!empty($field['length'])) { if (!empty($field['length'])) {
...@@ -108,7 +111,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -108,7 +111,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
$field['name'] = ''; $field['name'] = '';
} }
switch ($db_type) { switch ($dbType) {
case 'integer': case 'integer':
case 'pls_integer': case 'pls_integer':
case 'binary_integer': case 'binary_integer':
...@@ -174,7 +177,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -174,7 +177,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'rowid': case 'rowid':
case 'urowid': case 'urowid':
default: default:
throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$db_type); throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType);
} }
return array($type, $length, $unsigned, $fixed); return array($type, $length, $unsigned, $fixed);
......
...@@ -378,6 +378,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict ...@@ -378,6 +378,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
return 'BYTEA'; return 'BYTEA';
case 'enum': case 'enum':
case 'integer': case 'integer':
case 'int':
if (!empty($field['autoincrement'])) { if (!empty($field['autoincrement'])) {
if (!empty($field['length'])) { if (!empty($field['length'])) {
$length = $field['length']; $length = $field['length'];
......
...@@ -97,6 +97,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict ...@@ -97,6 +97,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
case 'enum': case 'enum':
case 'integer': case 'integer':
case 'boolean': case 'boolean':
case 'int':
return 'INTEGER'; return 'INTEGER';
case 'date': case 'date':
return 'DATE'; return 'DATE';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment