Bug Report
| Q |
A |
| BC Break |
no |
| Version |
2.11.0 |
Summary
A virtual column defined via the new capabilities of v2.11 will always have changes when checked with the orm:schema-tool:update console command.
How to reproduce
Consider the following mapping on a MySQL 8 database:
#[Entity]
class Website
{
#[Column(
type: 'string',
insertable: false,
updatable: false,
columnDefinition: "VARCHAR(255) GENERATED ALWAYS AS ('foo') VIRTUAL",
generated: 'ALWAYS'
)]
private ?string $url = null;
}
Running orm:schema-tool:update --dump-sql --force consecutively will always yield the change:
ALTER TABLE website CHANGE url url VARCHAR(255) GENERATED ALWAYS AS ('foo') VIRTUAL;
Expected behavior
Expected behavior is to either compare the column definition from the database with the schema, or ignore it completely and only check column existence when it has a custom definition. Both situations would lead to the changes being generated only once.