Merge pull request #31580 from nextcloud/nickvergessen-patch-2

Limit missing primary key fail to new tables and comment out for now
This commit is contained in:
Vincent Petry 2022-03-22 10:58:24 +01:00 committed by GitHub
commit acfa546efd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {
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.');
}
}