From 32ede5489e191fcaaebaab3de3d43521c17a3f53 Mon Sep 17 00:00:00 2001 From: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Date: Tue, 15 Mar 2022 16:52:51 +0100 Subject: 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 --- lib/private/DB/MigrationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.'); } } -- cgit v1.2.3 From 3bed983a9c7fe53b221b20b45d4682d77f947965 Mon Sep 17 00:00:00 2001 From: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Date: Wed, 16 Mar 2022 15:17:28 +0100 Subject: Disable for now again until more apps are fixed Signed-off-by: Joas Schilling --- lib/private/DB/MigrationService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 0cf37cb995a..5e146112120 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -634,8 +634,8 @@ 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) { - throw new \InvalidArgumentException('Table "' . $table->getName() . '" has no primary key and therefor will not behave sane in clustered setups.'); + // } 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.'); } } -- cgit v1.2.3