Switch from deprecated hasPrimaryKey to getPrimaryKey function

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-11-14 16:19:16 +01:00 committed by backportbot-nextcloud[bot]
parent fc2467c18f
commit b75affa793

View file

@ -62,7 +62,7 @@ class DatabaseHasMissingPrimaryKeys implements ISetupCheck {
foreach ($missingPrimaryKeys as $missingPrimaryKey) {
if ($schema->hasTable($missingPrimaryKey['tableName'])) {
$table = $schema->getTable($missingPrimaryKey['tableName']);
if (!$table->hasPrimaryKey()) {
if ($table->getPrimaryKey() === null) {
$primaryKeyInfo->addHintForMissingPrimaryKey($missingPrimaryKey['tableName']);
}
}