From: Joas Schilling Date: Fri, 8 Apr 2022 08:47:24 +0000 (+0200) Subject: Log missing primary key until we make it a requirement X-Git-Tag: v24.0.0rc1~48^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df36ed4d1ad153b9bd30b799c35a4b6421126c70;p=nextcloud-server.git Log missing primary key until we make it a requirement Signed-off-by: Joas Schilling --- diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 92f45dfdbe8..13bbe8dc5d0 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -652,7 +652,10 @@ class MigrationService { 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.'); } }