Commit fcfff27a authored by lsmith's avatar lsmith

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

parent a2d69c5d
......@@ -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) {
......
......@@ -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);
}
......
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