migrations
migrations copied to clipboard
Using schema_filter creates tables instead of ignoring them
Bug Report
| Q | A |
|---|---|
| BC Break | no |
| Version | "stof/doctrine-extensions-bundle": "^1.3", |
Summary
I had a need to ignore tables created earlier by doctrine to comply many to many relationship. Instead of ignoring them, it generated code to create them...
Current behavior
After creation of tables that are in the middle of a many to many relation, I needed to add a column to them manually. Therefor, I added them to schema_filter to be ignored. After launching migrations:diff, the diff command created creation SQL for them, although the tables already existed.
If I try to ignore different tables (really custom ones), then the command works as it should.
How to reproduce
- Create Entity
Foo - Create Entity
Bar - Make
ManyToManyrelationship between them - Create migration and launch it (should create table foo_bar or bar_foo, depending on what kind of ManyToMany relationship you created)
- Add
schema_filteroptionschema_filter: ~^(?!foo_)~todoctrine.yml(orschema_filter: ~^(?!bar_)~) - Launch
migration:diff - Migration with wrong creation SQL should be created
Expected behavior
Ignoring the tables entirely?
This was fixed in #823, which was later released as 2.1.0. Please post the version of doctrine/migrations that you are using, not of a bundle that brings in some extensions. You can show the version you're using by running composer show doctrine/migrations.