Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions models/datasources/dbo/dbo_sqlite3.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function listSources() {
return $cache;
}

$result = $this->fetchAll("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;", false);
$result = $this->fetchAll("SELECT name FROM sqlite_master WHERE type='table' AND name <> 'sqlite_sequence' ORDER BY name;", false);

if (!$result || empty($result)) {
return array();
Expand Down Expand Up @@ -280,12 +280,13 @@ function describe(&$model) {
'length' => $this->length($column[0]['type'])
);
if($column[0]['pk'] == 1) {
$colLength = $this->length($column[0]['type']);
$fields[$column[0]['name']] = array(
'type' => $fields[$column[0]['name']]['type'],
'null' => false,
'default' => $column[0]['dflt_value'],
'key' => $this->index['PRI'],
'length' => 11
'length' => ($colLength != null) ? $colLength : 11
);
}
}
Expand Down Expand Up @@ -489,7 +490,7 @@ function column($real) {
if (in_array($col, array('text', 'integer', 'float', 'boolean', 'timestamp', 'date', 'datetime', 'time'))) {
return $col;
}
if (strpos($col, 'varchar') !== false) {
if (strpos($col, 'char') !== false) {
return 'string';
}
if (in_array($col, array('blob', 'clob'))) {
Expand Down Expand Up @@ -625,7 +626,7 @@ function buildColumn($column) {

$real = $this->columns[$type];
$out = $this->name($name) . ' ' . $real['name'];
if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {
if (isset($column['key']) && $column['key'] == 'primary') {
return $this->name($name) . ' ' . $this->columns['primary_key']['name'];
}
return parent::buildColumn($column);
Expand Down