migrations
migrations copied to clipboard
Bug in generating migration for MEDIUMBLOB field (type="binary", length=16777215)
Bug Report
Q | A |
---|---|
BC Break | no |
Version | 3.0.2 |
Summary
Doctrine generates migration when there are no mapping changes, up
and down
are identical.
Current behavior
Doctrine continues to generate migrations with identical up
and down
methods.
How to reproduce
- Create an entity containing the next field mapping:
/**
* @var string|null
*
* @ORM\Column(type="binary", length=16777215, nullable=true)
*/
private $binaryContent;
-
Apply this mapping to the database (MySQL) somehow (with migrations or in any other way, it doesn't matter).
-
After the mapping is applied, run
bin/console doctrine:migrations:diff
. -
Take a look at the generated code:
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE file CHANGE binary_content binary_content MEDIUMBLOB DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE file CHANGE binary_content binary_content MEDIUMBLOB DEFAULT NULL');
}
These code blocks are just the same.
Expected behavior
No migration generated, as there were not mapping changes.