]> source.dussan.org Git - nextcloud-server.git/commitdiff
Log missing primary key until we make it a requirement 31887/head
authorJoas Schilling <coding@schilljs.com>
Fri, 8 Apr 2022 08:47:24 +0000 (10:47 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 8 Apr 2022 08:47:24 +0000 (10:47 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/DB/MigrationService.php

index 92f45dfdbe83a7b2d8380e7769127c0f0bbe9d98..13bbe8dc5d049df46a0e7ad18dc1256b218d8aec 100644 (file)
@@ -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.');
                        }
                }