doctrine / migrations

Doctrine Database Migrations Library
https://www.doctrine-project.org/projects/migrations.html
MIT License
4.68k stars 385 forks source link

Don't throw NoMappingFound from OrmSchemaProvider #1285

Closed nicolas-grekas closed 1 year ago

nicolas-grekas commented 1 year ago
Q A
Type bug
BC Break no
Fixed issues -

This is something we figured out in Symfony: when there is no mapping info available, it doesn't mean there is no migration to generate. This happens when there are schema listeners that integrate with migrations, as is the case for those: https://github.com/symfony/symfony/tree/6.2/src/Symfony/Bridge/Doctrine/SchemaListener

Right now, one has to have entities before they can generate migrations, but those schema are entity-less.

Removing this check does the job.

nicolas-grekas commented 1 year ago

(phpstan failures are unrelated)

greg0ire commented 1 year ago

I fixed the PHPStan failures in https://github.com/doctrine/migrations/pull/1286

derrabus commented 1 year ago

Can you please rebase?

nicolas-grekas commented 1 year ago

All green in a minute.