1
0
mirror of synced 2025-01-17 22:11:41 +03:00

- fixes #519 and #761 (patch provided by RQuadling)

This commit is contained in:
lsmith 2008-01-30 23:03:56 +00:00
parent a2d69c5d8e
commit fcfff27a76
2 changed files with 7 additions and 3 deletions

View File

@ -123,7 +123,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
*/
public function getPortableDeclaration($field)
{
$db_type = preg_replace('/\d/','', strtolower($field['type']) );
$db_type = preg_replace('/[\d\(\)]/','', strtolower($field['type']) );
$length = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null;
$type = array();
@ -137,6 +137,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
case 'bit':
$type[0] = 'boolean';
break;
case 'tinyint':
case 'smallint':
case 'int':
$type[0] = 'integer';
if ($length == 1) {

View File

@ -73,6 +73,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$type .= '(' . $val['length'] . ')';
}
$val['type'] = $type;
$val['identity'] = $identity;
$decl = $this->conn->dataDict->getPortableDeclaration($val);
$description = array(
@ -112,7 +114,7 @@ class Doctrine_Import_Mssql extends Doctrine_Import
*/
public function listTables($database = null)
{
$sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name";
$sql = "SELECT name FROM sysobjects WHERE type = 'U' AND name <> 'dtproperties' ORDER BY name";
return $this->conn->fetchColumn($sql);
}
@ -196,4 +198,4 @@ class Doctrine_Import_Mssql extends Doctrine_Import
return $this->conn->fetchColumn($query);
}
}
}