From d6563a108aaab56376adf3dc6fd48ce87b9e047c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 10 May 2023 14:09:18 +0200 Subject: [PATCH] [Messenger] Use immutable dates in the storage when using Doctrine --- .../Bridge/Doctrine/Transport/Connection.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php index 98eb224841585..7e57b0fac98a7 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php @@ -148,8 +148,8 @@ public function send(string $body, array $headers, int $delay = 0): string null, null, null, - Types::DATETIME_MUTABLE, - Types::DATETIME_MUTABLE, + Types::DATETIME_IMMUTABLE, + Types::DATETIME_IMMUTABLE, ]); return $this->driverConnection->lastInsertId(); @@ -226,7 +226,7 @@ public function get(): ?array $now, $doctrineEnvelope['id'], ], [ - Types::DATETIME_MUTABLE, + Types::DATETIME_IMMUTABLE, ]); $this->driverConnection->commit(); @@ -354,8 +354,8 @@ private function createAvailableMessagesQueryBuilder(): QueryBuilder $now, $this->configuration['queue_name'], ], [ - Types::DATETIME_MUTABLE, - Types::DATETIME_MUTABLE, + Types::DATETIME_IMMUTABLE, + Types::DATETIME_IMMUTABLE, ]); } @@ -449,11 +449,11 @@ private function addTableToSchema(Schema $schema): void $table->addColumn('queue_name', Types::STRING) ->setLength(190) // MySQL 5.6 only supports 191 characters on an indexed column in utf8mb4 mode ->setNotnull(true); - $table->addColumn('created_at', Types::DATETIME_MUTABLE) + $table->addColumn('created_at', Types::DATETIME_IMMUTABLE) ->setNotnull(true); - $table->addColumn('available_at', Types::DATETIME_MUTABLE) + $table->addColumn('available_at', Types::DATETIME_IMMUTABLE) ->setNotnull(true); - $table->addColumn('delivered_at', Types::DATETIME_MUTABLE) + $table->addColumn('delivered_at', Types::DATETIME_IMMUTABLE) ->setNotnull(false); $table->setPrimaryKey(['id']); $table->addIndex(['queue_name']);