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