改进pgsql数据库驱动的数据表字段信息读取

This commit is contained in:
thinkphp
2016-09-22 15:18:57 +08:00
parent 8c15e55d21
commit 7d5e5fb237

View File

@@ -59,10 +59,10 @@ class Pgsql extends Connection
$info[$val['field']] = [
'name' => $val['field'],
'type' => $val['type'],
'notnull' => (bool) ('' === $val['null']), // not null is empty, null is yes
'notnull' => (bool) ('' !== $val['null']),
'default' => $val['default'],
'primary' => (strtolower($val['key']) == 'pri'),
'autoinc' => (strtolower($val['extra']) == 'auto_increment'),
'primary' => !empty($val['key']),
'autoinc' => (0 === strpos($val['extra'], 'nextval(')),
];
}
}