summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-04-08 17:27:53 +0200
committerGitHub <noreply@github.com>2022-04-08 17:27:53 +0200
commit88e5c0792a7107a4d1be4973205e23628d3a971f (patch)
tree70c94fd5b3f10b9947d70753af5810235401f17e
parentc023a6efb3b526bc4bced14648ead5a818415451 (diff)
parentdf36ed4d1ad153b9bd30b799c35a4b6421126c70 (diff)
downloadnextcloud-server-88e5c0792a7107a4d1be4973205e23628d3a971f.tar.gz
nextcloud-server-88e5c0792a7107a4d1be4973205e23628d3a971f.zip
Merge pull request #31887 from nextcloud/techdebt/noid/log-primary-key-violation
Log missing primary key until we make it a requirement
-rw-r--r--lib/private/DB/MigrationService.php5
1 files changed, 4 insertions, 1 deletions
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.');
}
}