1
0
mirror of synced 2024-12-14 07:06:04 +03:00

int alias added

This commit is contained in:
zYne 2007-02-04 22:34:44 +00:00
parent f2e19fd9fa
commit c38137d551
5 changed files with 14 additions and 6 deletions

View File

@ -75,6 +75,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return 'BLOB SUB_TYPE 0';
case 'integer':
case 'enum':
case 'int':
return 'INT';
case 'boolean':
return 'SMALLINT';
@ -89,8 +90,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
case 'decimal':
$length = !empty($field['length']) ? $field['length'] : 18;
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

View File

@ -90,6 +90,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
return 'IMAGE';
case 'integer':
case 'enum':
case 'int':
return 'INT';
case 'boolean':
return 'BIT';
@ -105,7 +106,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
$length = !empty($field['length']) ? $field['length'] : 18;
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

View File

@ -72,6 +72,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
return 'BLOB';
case 'integer':
case 'enum':
case 'int':
if (!empty($field['length'])) {
return 'NUMBER('.$field['length'].')';
}
@ -86,6 +87,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
return 'NUMBER';
case 'decimal':
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
*/
public function getPortableDeclaration(array $field)
{
$db_type = strtolower($field['type']);
$dbType = strtolower($field['type']);
$type = array();
$length = $unsigned = $fixed = null;
if (!empty($field['length'])) {
@ -108,7 +111,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
$field['name'] = '';
}
switch ($db_type) {
switch ($dbType) {
case 'integer':
case 'pls_integer':
case 'binary_integer':
@ -174,7 +177,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'rowid':
case 'urowid':
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);

View File

@ -378,6 +378,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
return 'BYTEA';
case 'enum':
case 'integer':
case 'int':
if (!empty($field['autoincrement'])) {
if (!empty($field['length'])) {
$length = $field['length'];

View File

@ -97,6 +97,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
case 'enum':
case 'integer':
case 'boolean':
case 'int':
return 'INTEGER';
case 'date':
return 'DATE';