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 ...@@ -123,7 +123,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
*/ */
public function getPortableDeclaration($field) 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; $length = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null;
$type = array(); $type = array();
...@@ -137,6 +137,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict ...@@ -137,6 +137,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
case 'bit': case 'bit':
$type[0] = 'boolean'; $type[0] = 'boolean';
break; break;
case 'tinyint':
case 'smallint':
case 'int': case 'int':
$type[0] = 'integer'; $type[0] = 'integer';
if ($length == 1) { if ($length == 1) {
......
...@@ -73,6 +73,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import ...@@ -73,6 +73,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$type .= '(' . $val['length'] . ')'; $type .= '(' . $val['length'] . ')';
} }
$val['type'] = $type;
$val['identity'] = $identity;
$decl = $this->conn->dataDict->getPortableDeclaration($val); $decl = $this->conn->dataDict->getPortableDeclaration($val);
$description = array( $description = array(
...@@ -112,7 +114,7 @@ class Doctrine_Import_Mssql extends Doctrine_Import ...@@ -112,7 +114,7 @@ class Doctrine_Import_Mssql extends Doctrine_Import
*/ */
public function listTables($database = null) 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); return $this->conn->fetchColumn($sql);
} }
...@@ -196,4 +198,4 @@ class Doctrine_Import_Mssql extends Doctrine_Import ...@@ -196,4 +198,4 @@ class Doctrine_Import_Mssql extends Doctrine_Import
return $this->conn->fetchColumn($query); return $this->conn->fetchColumn($query);
} }
} }
\ No newline at end of file
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