mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 22:27:31 -04:00
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>
This commit is contained in:
parent
84ae0703a3
commit
32ede5489e
1 changed files with 1 additions and 1 deletions
|
|
@ -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.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue