fix(db)!: Doctrine\DBAL\Schema\Table::hasPrimaryKey() was removed, use Table::getPrimaryKey` instead.

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-07-01 11:09:24 +02:00
parent 27c49e7a9a
commit 466f455e93
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205
2 changed files with 2 additions and 2 deletions

View file

@ -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('<info>Adding primary key to the ' . $missingKey['tableName'] . ' table, this can take some time...</info>');
$table->setPrimaryKey($missingKey['columns'], $missingKey['primaryKeyName']);

View file

@ -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';