diff --git a/library/think/db/driver/sqlite.php b/library/think/db/driver/sqlite.php index fb70c959..d2ae2401 100644 --- a/library/think/db/driver/sqlite.php +++ b/library/think/db/driver/sqlite.php @@ -43,13 +43,13 @@ class Sqlite extends Driver $info = []; if ($result) { foreach ($result as $key => $val) { - $info[$val['field']] = [ - 'name' => $val['field'], + $info[$val['name']] = [ + 'name' => $val['name'], 'type' => $val['type'], - 'notnull' => (bool) ('' === $val['null']), // not null is empty, null is yes - 'default' => $val['default'], - 'primary' => (strtolower($val['dey']) == 'pri'), - 'autoinc' => (strtolower($val['extra']) == 'auto_increment'), + 'notnull' => (bool) (1 === $val['notnull']), + 'default' => $val['dflt_value'], + 'primary' => '1' == $val['pk'], + 'autoinc' => false, ]; } }