Remove the custom prefix from the table name length when checking on the default primary index

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-04-29 16:08:26 +02:00
parent 01410491b9
commit b3e6cbc4c5
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 1 additions and 1 deletions

View File

@ -547,7 +547,7 @@ class MigrationService {
if (!$isUsingDefaultName && \strlen($indexName) > 30) { if (!$isUsingDefaultName && \strlen($indexName) > 30) {
throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
} }
if ($isUsingDefaultName && \strlen($table->getName()) > 26) { if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength > 23) {
throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
} }
} }