Skip to content

Commit f5f2ae8

Browse files
committed
MDL-66827 ddl: Fix detection of primary keys in index checks in pgsql
1 parent 1453bdb commit f5f2ae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

public/lib/dml/pgsql_native_moodle_database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public function get_indexes($table) {
530530
if (!preg_match('/CREATE (|UNIQUE )INDEX ([^\s]+) ON (|'.$row['schemaname'].'\.)'.$tablename.' USING ([^\s]+) \(([^\)]+)\)/i', $row['indexdef'], $matches)) {
531531
continue;
532532
}
533-
if ($matches[5] === 'id') {
533+
if ($matches[5] === 'id' && str_ends_with($matches[2], '_pk')) {
534534
continue;
535535
}
536536
$columns = explode(',', $matches[5]);

0 commit comments

Comments
 (0)