Commit b4dc7e0b authored by Bart Visscher's avatar Bart Visscher

The primary key columns don't have to be in the same order as the table columns

parent 2790ee79
......@@ -168,7 +168,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
$indexArray = $stmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($indexArray as $indexColumnRow) {
if ($indexColumnRow['pk'] != "0") {
$indexBuffer[] = array(
$indexBuffer[$indexColumnRow['pk']] = array(
'key_name' => 'primary',
'primary' => true,
'non_unique' => false,
......@@ -176,6 +176,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
);
}
}
ksort($indexBuffer);
// fetch regular indexes
foreach ($tableIndexes as $tableIndex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment