mirror of
https://github.com/dg/dibi.git
synced 2025-08-08 07:06:52 +02:00
PostgreDriver: fix indexes reflection for indexes on expressions (#323)
This commit is contained in:
@@ -176,8 +176,11 @@ class PostgreReflector implements Dibi\Reflector
|
|||||||
$indexes[$row['relname']]['name'] = $row['relname'];
|
$indexes[$row['relname']]['name'] = $row['relname'];
|
||||||
$indexes[$row['relname']]['unique'] = $row['indisunique'] === 't' || $row['indisunique'] === true;
|
$indexes[$row['relname']]['unique'] = $row['indisunique'] === 't' || $row['indisunique'] === true;
|
||||||
$indexes[$row['relname']]['primary'] = $row['indisprimary'] === 't' || $row['indisprimary'] === true;
|
$indexes[$row['relname']]['primary'] = $row['indisprimary'] === 't' || $row['indisprimary'] === true;
|
||||||
|
$indexes[$row['relname']]['columns'] = [];
|
||||||
foreach (explode(' ', $row['indkey']) as $index) {
|
foreach (explode(' ', $row['indkey']) as $index) {
|
||||||
$indexes[$row['relname']]['columns'][] = $columns[$index];
|
if (isset($columns[$index])) {
|
||||||
|
$indexes[$row['relname']]['columns'][] = $columns[$index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array_values($indexes);
|
return array_values($indexes);
|
||||||
|
Reference in New Issue
Block a user