mirror of
https://github.com/dg/dibi.git
synced 2025-02-22 18:02:25 +01:00
PostgreDriver: fix indexes reflection for indexes on expressions (#323)
This commit is contained in:
parent
76593b7da4
commit
2b5683d0f2
@ -176,8 +176,11 @@ class PostgreReflector implements Dibi\Reflector
|
||||
$indexes[$row['relname']]['name'] = $row['relname'];
|
||||
$indexes[$row['relname']]['unique'] = $row['indisunique'] === 't' || $row['indisunique'] === true;
|
||||
$indexes[$row['relname']]['primary'] = $row['indisprimary'] === 't' || $row['indisprimary'] === true;
|
||||
$indexes[$row['relname']]['columns'] = [];
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user