Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-03-15 18:52:51 +0300
committerJoas Schilling <coding@schilljs.com>2022-03-21 14:14:19 +0300
commit32ede5489e191fcaaebaab3de3d43521c17a3f53 (patch)
tree58a2840f3d5e325356477bb710a92892a60b5fe3 /lib
parent84ae0703a3b74c5ce616c7ca690fedebd3a0d3ab (diff)
Limit missing primary key fail to new tables
This will work on CI so devs notice it when they install the app for testing, and at the same time existing faulty tables don't break the upgrade to 24 Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/MigrationService.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index e7361cb4cab..0cf37cb995a 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -634,7 +634,7 @@ 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) {
+ } elseif (!$primaryKey instanceof Index && !$sourceTable instanceof Table) {
throw new \InvalidArgumentException('Table "' . $table->getName() . '" has no primary key and therefor will not behave sane in clustered setups.');
}
}