mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 22:27:31 -04:00
refactor(dbal): Port away from deprecated hasPrimaryKey
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
parent
c89ca89f2f
commit
b0c6ef5821
2 changed files with 2 additions and 2 deletions
|
|
@ -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() === null) {
|
||||
$output->writeln('<info>Adding primary key to the ' . $missingKey['tableName'] . ' table, this can take some time...</info>');
|
||||
$table->setPrimaryKey($missingKey['columns'], $missingKey['primaryKeyName']);
|
||||
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ class MigrationService {
|
|||
}
|
||||
|
||||
$primaryKey = $table->getPrimaryKey();
|
||||
if ($primaryKey instanceof Index && (!$sourceTable instanceof Table || !$sourceTable->hasPrimaryKey())) {
|
||||
if ($primaryKey instanceof Index && (!$sourceTable instanceof Table || $sourceTable->getPrimaryKey() === null)) {
|
||||
$indexName = strtolower($primaryKey->getName());
|
||||
$isUsingDefaultName = $indexName === 'primary';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue