From 466f455e9305de6e3f4d747e8fe08bf349482e36 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 1 Jul 2024 11:09:24 +0200 Subject: [PATCH] fix(db)!: `Doctrine\DBAL\Schema\Table::hasPrimaryKey() was removed, use `Table::getPrimaryKey` instead. Signed-off-by: Joas Schilling --- core/Command/Db/AddMissingPrimaryKeys.php | 2 +- lib/private/DB/MigrationService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Command/Db/AddMissingPrimaryKeys.php b/core/Command/Db/AddMissingPrimaryKeys.php index 073ce7538cc..539720cc639 100644 --- a/core/Command/Db/AddMissingPrimaryKeys.php +++ b/core/Command/Db/AddMissingPrimaryKeys.php @@ -55,7 +55,7 @@ class AddMissingPrimaryKeys extends Command { foreach ($missingKeys as $missingKey) { if ($schema->hasTable($missingKey['tableName'])) { $table = $schema->getTable($missingKey['tableName']); - if (!$table->hasPrimaryKey()) { + if (!$table->getPrimaryKey()) { $output->writeln('Adding primary key to the ' . $missingKey['tableName'] . ' table, this can take some time...'); $table->setPrimaryKey($missingKey['columns'], $missingKey['primaryKeyName']); diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index ca326abb5bb..54257025de3 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -595,7 +595,7 @@ class MigrationService { } $primaryKey = $table->getPrimaryKey(); - if ($primaryKey instanceof Index && (!$sourceTable instanceof Table || !$sourceTable->hasPrimaryKey())) { + if ($primaryKey instanceof Index && (!$sourceTable instanceof Table || !$sourceTable->getPrimaryKey())) { $indexName = strtolower($primaryKey->getName()); $isUsingDefaultName = $indexName === 'primary';