Open
Description
Bug Report
Q | A |
---|---|
Version | 3.3.2 |
Summary
Platform: MySQL
Version: 8.0
Entity with versionable field:
/**
* @ORM\Version()
* @ORM\Column(type="datetime")
*/
private \DateTime $version;
generates the same migration over and over again even after executing it (https://github.com/rmikalkenas/migration-issue/blob/version-issue/migrations/Version20220302083650.php)
An issue comes from changes that adds Comparator
with provided database platform as dependency.
When comparing columns this peace of code
dbal/src/Schema/Comparator.php
Line 291 in baf6efe
[]
on versionable datetimetype column. But due to set $this->platform
later check $this->columnsEqual($column, $toColumn)
results to false
and marks column as having changes. Because one of Column
instances does not have version
platform option which is necessary for getting correct mysql datetime column type declaration: dbal/src/Platforms/AbstractMySQLPlatform.php
Line 249 in baf6efe
How to reproduce
https://github.com/rmikalkenas/migration-issue/tree/version-issue
version-issue
branch
Expected behaviour
No migration should be generated for versionable datetime type column