Index: connection.php =================================================================== --- connection.php (revision 1450) +++ connection.php (working copy) @@ -104,10 +104,8 @@ } // Merge the queries into allqueries; pragmas MUST go first - $allqueries = array_merge($pqueries, $indexqueries, $iqueries); + $allqueries = array_merge($pqueries, $iqueries); - - $tables= $this->get_column( "SELECT name FROM sqlite_master WHERE type = 'table';" ); foreach ( $cqueries as $tablename => $query ) { @@ -126,6 +124,8 @@ $allqueries[]= $query; } } + + $allqueries = array_merge($allqueries, $indexqueries); if ( $execute ) { foreach ( $allqueries as $query ) { Index: schema.sql =================================================================== --- schema.sql (revision 1450) +++ schema.sql (working copy) @@ -144,14 +144,14 @@ id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL ); -CREATE UNIQUE INDEX name ON {$prefix}groups(name); +CREATE UNIQUE INDEX group_name ON {$prefix}groups(name); CREATE TABLE {$prefix}permissions ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) ); -CREATE UNIQUE INDEX name ON {$prefix}permissions(name); +CREATE UNIQUE INDEX permissions_name ON {$prefix}permissions(name); CREATE TABLE {$prefix}users_groups ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,