|
@@ -106,7 +106,7 @@ class GenericReflection
|
106
|
106
|
return 'SELECT c.name AS "COLUMN_NAME", c.is_nullable AS "IS_NULLABLE", t.Name AS "DATA_TYPE", (c.max_length/2) AS "CHARACTER_MAXIMUM_LENGTH", c.precision AS "NUMERIC_PRECISION", c.scale AS "NUMERIC_SCALE", \'\' AS "COLUMN_TYPE" FROM sys.columns c INNER JOIN sys.types t ON c.user_type_id = t.user_type_id WHERE c.object_id = OBJECT_ID(?) AND \'\' <> ?';
|
107
|
107
|
case 'sqlite':
|
108
|
108
|
$this->updateSqlLiteReflectionTables();
|
109
|
|
- return 'SELECT "name" AS "COLUMN_NAME", case when "notnull"==1 then \'no\' else \'yes\' end as "IS_NULLABLE", "type" AS "DATA_TYPE", 2147483647 AS "CHARACTER_MAXIMUM_LENGTH", 0 AS "NUMERIC_PRECISION", 0 AS "NUMERIC_SCALE", \'\' AS "COLUMN_TYPE" FROM "sys/columns" WHERE "self" = ? AND \'\' <> ?';
|
|
109
|
+ return 'SELECT "name" AS "COLUMN_NAME", case when "notnull"==1 then \'no\' else \'yes\' end as "IS_NULLABLE", lower("type") AS "DATA_TYPE", 2147483647 AS "CHARACTER_MAXIMUM_LENGTH", 0 AS "NUMERIC_PRECISION", 0 AS "NUMERIC_SCALE", \'\' AS "COLUMN_TYPE" FROM "sys/columns" WHERE "self" = ? AND \'\' <> ?';
|
110
|
110
|
}
|
111
|
111
|
}
|
112
|
112
|
|
|
@@ -184,7 +184,7 @@ class GenericReflection
|
184
|
184
|
if ($this->driver == 'mysql') {
|
185
|
185
|
foreach ($results as &$result) {
|
186
|
186
|
// mysql does not properly reflect display width of types
|
187
|
|
- preg_match('|([a-zA-Z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
|
|
187
|
+ preg_match('|([a-z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
|
188
|
188
|
$result['DATA_TYPE'] = $matches[1];
|
189
|
189
|
if (!$result['CHARACTER_MAXIMUM_LENGTH']) {
|
190
|
190
|
if (isset($matches[3])) {
|
|
@@ -198,8 +198,8 @@ class GenericReflection
|
198
|
198
|
}
|
199
|
199
|
if ($this->driver == 'sqlite') {
|
200
|
200
|
foreach ($results as &$result) {
|
201
|
|
- // mysql does not properly reflect display width of types
|
202
|
|
- preg_match('|([a-zA-Z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
|
|
201
|
+ // sqlite does not properly reflect display width of types
|
|
202
|
+ preg_match('|([a-z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
|
203
|
203
|
if (isset($matches[1])) {
|
204
|
204
|
$result['DATA_TYPE'] = $matches[1];
|
205
|
205
|
} else {
|