bug #37117 [Messenger/DoctrineBridge] set column length for mysql 5.6 compatibility (Nemo64)

This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger/DoctrineBridge] set column length for mysql 5.6 compatibility

MySQL 5.6 does not support more than 191 characters when an index is used and when using utf8mb4 as charset.
As a workaround, I define the length of the queue_name field.

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37116
| License       | MIT

Commits
-------

d12190687b set column length for mysql 5.6 compatibility
This commit is contained in:
Nicolas Grekas 2020-06-07 17:46:15 +02:00
commit 717de3ef87

View File

@ -390,6 +390,7 @@ class Connection implements ResetInterface
$table->addColumn('headers', self::$useDeprecatedConstants ? Type::TEXT : Types::TEXT)
->setNotnull(true);
$table->addColumn('queue_name', self::$useDeprecatedConstants ? Type::STRING : Types::STRING)
->setLength(190) // mysql 5.6 only supports 191 characters on an indexed column in utf8mb4 mode
->setNotnull(true);
$table->addColumn('created_at', self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE)
->setNotnull(true);