migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Using schema_filter creates tables instead of ignoring them

Open muchar opened this issue 6 years ago • 1 comments

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

  1. Create Entity Foo
  2. Create Entity Bar
  3. Make ManyToMany relationship between them
  4. Create migration and launch it (should create table foo_bar or bar_foo, depending on what kind of ManyToMany relationship you created)
  5. Add schema_filter option schema_filter: ~^(?!foo_)~ to doctrine.yml (or schema_filter: ~^(?!bar_)~)
  6. Launch migration:diff
  7. Migration with wrong creation SQL should be created

Expected behavior

Ignoring the tables entirely?

muchar avatar Jul 28 '19 19:07 muchar

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.

alcaeus avatar Jul 30 '19 18:07 alcaeus