Bug Report
| Q |
A |
| BC Break |
no |
| Version |
3.9.4 |
Summary
My column definition in a Symfony 7 entity:
#[ORM\Column(options: ['default' => 0])]
private ?float $otherFees = 0;
When I generate a diff, migrate, then regenerate a diff, the same line is always generated:
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE xxx CHANGE other_fees other_fees DOUBLE PRECISION DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE xxx CHANGE other_fees other_fees DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
}
This only happens for floats.
Using ['default' => '0'] instead of ['default' => 0] yields the same result.
I'm using MySQL 8.0.36. I tried MySQL 8.4.7 with the same result.
Current behavior
A migration is always generated for entities with floats having a default value set.
How to reproduce
- Create an entity with this column definition
#[ORM\Column(options: ['default' => 0])]
private ?float $floatval = 0;
- Run d:m:diff
- Run d:m:m
- Run d:m:diff again
The same diff will be generated again.
Expected behavior
No new migration lines are generated for entities having a float default value set, if the default value is already set.
Bug Report
Summary
My column definition in a Symfony 7 entity:
When I generate a diff, migrate, then regenerate a diff, the same line is always generated:
This only happens for
floats.Using
['default' => '0']instead of['default' => 0]yields the same result.I'm using MySQL 8.0.36. I tried MySQL 8.4.7 with the same result.
Current behavior
A migration is always generated for entities with floats having a default value set.
How to reproduce
The same diff will be generated again.
Expected behavior
No new migration lines are generated for entities having a float default value set, if the default value is already set.