Skip to content

Commit

Permalink
Merge pull request #31887 from nextcloud/techdebt/noid/log-primary-ke…
Browse files Browse the repository at this point in the history
…y-violation

Log missing primary key until we make it a requirement
  • Loading branch information
juliusknorr authored Apr 8, 2022
2 parents c023a6e + df36ed4 commit 88e5c07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/private/DB/MigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,10 @@ public function ensureOracleConstraints(Schema $sourceSchema, Schema $targetSche
if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength >= 23) {
throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
}
// } elseif (!$primaryKey instanceof Index && !$sourceTable instanceof Table) {
} elseif (!$primaryKey instanceof Index && !$sourceTable instanceof Table) {
/** @var LoggerInterface $logger */
$logger = \OC::$server->get(LoggerInterface::class);
$logger->error('Table "' . $table->getName() . '" has no primary key and therefor will not behave sane in clustered setups. This will throw an exception and not be installable in a future version of Nextcloud.');
// throw new \InvalidArgumentException('Table "' . $table->getName() . '" has no primary key and therefor will not behave sane in clustered setups.');
}
}
Expand Down

0 comments on commit 88e5c07

Please sign in to comment.