Apply schema filter more selectively#587
Conversation
c32b617 to
b6d8f19
Compare
|
|
||
| public function testItDisablesItselfWhenTheCurrentCommandIsAMigrationsCommand(): void | ||
| public function testItFiltersOutMigrationMetadataTableWhenRunningSpecificCommands(): void | ||
| { | ||
| $listener = new SchemaFilterListener('doctrine_migration_versions'); | ||
| $migrationsCommand = new class extends DoctrineCommand { | ||
| $migrationsCommand = new class ($this->createStub(EntityManagerProvider::class)) extends ValidateSchemaCommand { | ||
| }; | ||
|
|
There was a problem hiding this comment.
Isn't this still a valid test as the opposite for testItFiltersOutMigrationMetadataTableWhenRunningSpecificCommands()?
There was a problem hiding this comment.
The name is no longer valid, since the filter no longer disables itself (it's disabled by default and stays so until enabled).
There is another test that tests that it's disabled by default.
There was a problem hiding this comment.
It isn't about the name but about the 2 cases where we have an instance of UpdateCommand or ValidateSchemaCommand and not having an instance of ValidateSchemaCommand or UpdateCommand. onConsoleCommand is currently only covering one of those cases. UpdateCommand isn't covered either.
Isn't useless for mongo-odm users ? Since you're doing only instanceof check, I'm not sure you need to require the package. The best way to solve this might be to
But I didn't found a package used by both orm and migrationBundle. (That would end in the famous doctrine/contract package). Until them I think you can keep the instanceof check without requiring ORM. |
You're right, I'll revert this change. |
b6d8f19 to
e17a608
Compare
|
For #584, this solution currently hides the toolbar indicator. If we reactivate it, it still indicates that none of the migrations have been executed |
|
@victor-paumier I don't understand how that's possible, given that with this solution, the filter will never be enabled in the context of HTTP. Maybe there is a cache you need to clear? |
I just enable it manually, I just wanted to know if it was the expected result. |
You enabled the filter? Why? |
There is only one call to it.
1e8ff6b to
47cfdb3
Compare
It is more careful, since there seems to be a lot of situations where we do not want to apply the filter. Let us take the opposite approach and: - Have the filter disabled by default, instead of enabled by default. - Enable it for precise commands where we know we need it.
47cfdb3 to
31417c0
Compare
|
ping @derrabus @SenseException 🙏 |
SenseException
left a comment
There was a problem hiding this comment.
I didn't understand the use case of @victor-paumier though. Maybe it can be addressed separately when a deeper explanation is available.
|
Me neither, and they don't answer my questions so 🤷 |
- removed unnecessary conflict as the orginal problem is already resolved - see #3749 - see doctrine/DoctrineMigrationsBundle#587
- removed unnecessary conflict as the orginal problem is already resolved - see shopsys/shopsys#3749 - see doctrine/DoctrineMigrationsBundle#587
- removed unnecessary conflict as the orginal problem is already resolved - see shopsys/shopsys#3749 - see doctrine/DoctrineMigrationsBundle#587


It is more careful, since there seems to be a lot of situations where we do not want to apply the filter.
Let us take the opposite approach and:
This means the ORM is no longer just a dev dependency.
Fixes #584, fixes #585
How can I test this?
composer config repositories.greg0ire vcs https://github.com/greg0ire/DoctrineMigrationsBundle composer require doctrine/doctrine-migrations-bundle "dev-selective-filter as 3.4.0"