Commit 417b71f4 authored by zYne's avatar zYne

--no commit message

--no commit message
parent f4842edd
......@@ -120,7 +120,7 @@ END;
$i = 1;
foreach ($tableColumns as $name => $column) {
$columns[$i] = ' $this->hasColumn(\'' . $name . '\', \'' . $column['ptype'][0] . '\'';
$columns[$i] = ' $this->hasColumn(\'' . $name . '\', \'' . $column['type'] . '\'';
if ($column['length']) {
$columns[$i] .= ', ' . $column['length'];
} else {
......@@ -147,7 +147,7 @@ END;
if (isset($column['unsigned']) && $column['unsigned']) {
$a[] = '\'unsigned\' => true';
}
if ($column['ptype'][0] == 'enum' && isset($column['values']) && $column['values']) {
if ($column['type'] == 'enum' && isset($column['values']) && $column['values']) {
$a[] = '\'values\' => array(' . implode(',', $column['values']) . ')';
}
......
......@@ -59,6 +59,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$columns = array();
foreach ($result as $key => $val) {
$val = array_change_key_case($val, CASE_LOWER);
if (strstr($val['type_name'], ' ')) {
list($type, $identity) = explode(' ', $val['type_name']);
} else {
......@@ -74,8 +76,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import
$description = array(
'name' => $val['column_name'],
'type' => $type,
'ptype' => $decl['type'],
'ntype' => $type,
'type' => $decl['type'][0],
'alltypes' => $decl['type'],
'length' => $decl['length'],
'fixed' => $decl['fixed'],
'unsigned' => $decl['unsigned'],
......
......@@ -124,8 +124,9 @@ class Doctrine_Import_Mysql extends Doctrine_Import
$description = array(
'name' => $val['field'],
'type' => $val['type'],
'ptype' => $decl['type'],
'type' => $decl['type'][0],
'alltypes' => $decl['type'],
'ntype' => $val['type'],
'length' => $decl['length'],
'fixed' => $decl['fixed'],
'unsigned' => $decl['unsigned'],
......
......@@ -122,13 +122,16 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$result = $this->conn->fetchAssoc($sql);
foreach($result as $val) {
$val = array_change_key_case($val, CASE_LOWER);
$decl = $this->conn->dataDict->getPortableDeclaration($val);
$descr[$val['column_name']] = array(
'name' => $val['column_name'],
'notnull' => (bool) ($val['nullable'] === 'N'),
'type' => $val['data_type'],
'ptype' => $decl['type'],
'ntype' => $val['data_type'],
'type' => $decl['type'][0],
'alltypes' => $decl['type'],
'fixed' => $decl['fixed'],
'unsigned' => $decl['unsigned'],
'default' => $val['data_default'],
......
......@@ -154,7 +154,9 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
$columns = array();
foreach ($result as $key => $val) {
if ($val['type'] === 'varchar') {
$val = array_change_key_case($val, CASE_LOWER);
if (strtolower($val['type']) === 'varchar') {
// get length from varchar definition
$length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $val['complete_type']);
$val['length'] = $length;
......@@ -164,8 +166,9 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
$description = array(
'name' => $val['field'],
'type' => $val['type'],
'ptype' => $decl['type'],
'ntype' => $val['type'],
'type' => $decl['type'][0],
'alltypes' => $decl['type'],
'length' => $decl['length'],
'fixed' => $decl['fixed'],
'unsigned' => $decl['unsigned'],
......
......@@ -130,9 +130,14 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
$description = array();
$columns = array();
foreach ($result as $key => $val) {
$val = array_change_key_case($val, CASE_LOWER);
$decl = $this->conn->dataDict->getPortableDeclaration($val);
$description = array(
'name' => $val['name'],
'type' => $val['type'],
'ntype' => $val['type'],
'type' => $decl['type'][0],
'alltypes' => $decl['type'],
'notnull' => (bool) $val['notnull'],
'default' => $val['dflt_value'],
'primary' => (bool) $val['pk'],
......
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