Adding descrption compatiblity fixes to SQLite driver (Ticket #1211)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3450 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-09-05 15:37:13 +00:00
parent 9f454bf5b9
commit 213e22b1a8

View file

@ -162,15 +162,14 @@ class DboSqlite extends DboSource {
return $cache; return $cache;
} }
$fields = array(); $fields = array();
$cols = sqlite_fetch_column_types($model->tablePrefix . $model->table, $this->connection); $result = $this->fetchAll('PRAGMA table_info(' . $model->tablePrefix . $model->table . ')');
pr($cols); foreach ($result as $column) {
die();
foreach ($cols as $column => $type) {
$fields[] = array( $fields[] = array(
'name' => $column, 'name' => $column[0]['name'],
'type' => $this->column($type), 'type' => $this->column($column[0]['type']),
'null' => true 'null' => ! $column[0]['notnull'],
'default' => $column[0]['dflt_value']
); );
} }
@ -335,7 +334,7 @@ class DboSqlite extends DboSource {
$limit = null; $limit = null;
@list($col, $limit) = explode('(', $col); @list($col, $limit) = explode('(', $col);
if (in_array($col, array('text', 'integer', 'float', 'boolean', 'timestamp'))) { if (in_array($col, array('text', 'integer', 'float', 'boolean', 'timestamp', 'datetime'))) {
return $col; return $col;
} }
if (strpos($col, 'varchar') !== false) { if (strpos($col, 'varchar') !== false) {