Don't use numeric offsets, use column names instead.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 2 Nov 2010 22:38:02 +0000 (18:38 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 3 Nov 2010 00:21:18 +0000 (20:21 -0400)
framework/Db/lib/Horde/Db/Adapter/Sqlite/Schema.php

index 19659d4..2449423 100644 (file)
@@ -184,15 +184,14 @@ class Horde_Db_Adapter_Sqlite_Schema extends Horde_Db_Adapter_Base_Schema
 
         if (!$rows) {
             $rows = $this->selectAll('PRAGMA table_info(' . $this->quoteTableName($tableName) . ')', $name);
-
             $this->_cache->set("tables/columns/$tableName", serialize($rows));
         }
 
         // create columns from rows
         $columns = array();
         foreach ($rows as $row) {
-            $columns[$row[1]] = $this->makeColumn(
-                $row[1], $row[4], $row[2], !(bool)$row[3]);
+            $columns[$row['name']] = $this->makeColumn(
+                $row['name'], $row['dflt_value'], $row['type'], !(bool)$row['notnull']);
         }
 
         return $columns;