修正sqlite驱动

This commit is contained in:
thinkphp
2015-12-11 21:36:44 +08:00
parent ca86ee8007
commit 774736f41c

View File

@@ -43,13 +43,13 @@ class Sqlite extends Driver
$info = []; $info = [];
if ($result) { if ($result) {
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
$info[$val['field']] = [ $info[$val['name']] = [
'name' => $val['field'], 'name' => $val['name'],
'type' => $val['type'], 'type' => $val['type'],
'notnull' => (bool) ('' === $val['null']), // not null is empty, null is yes 'notnull' => (bool) (1 === $val['notnull']),
'default' => $val['default'], 'default' => $val['dflt_value'],
'primary' => (strtolower($val['dey']) == 'pri'), 'primary' => '1' == $val['pk'],
'autoinc' => (strtolower($val['extra']) == 'auto_increment'), 'autoinc' => false,
]; ];
} }
} }