Deprecate removal of namespaced assets from schema #5432
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Silently dropping database objects from the schema looks like a disservice. If the application declares certain schema objects, it means that it expects them to exist in the resulting schema, so it won't work properly if these objects don't exist.
It will be easier to spot such issues if the visitor drops a table (all the queries against it will fail) but the problems may be way harder to diagnose if a foreign key is dropped. This way, the application will rely on the referential integrity being preserved by the database but in fact it the database won't have the expected constraints in place.
According to the
GH6823Test
in the ORM, there is a flaw in this logic:dbal/src/Schema/Visitor/RemoveNamespacedAssets.php
Lines 75 to 79 in 4be7e2f
The entities being deployed in the test don't declare a namespaced object name but the visitor drops a valid foreign key because the referenced entity (
GH6823Tag
) isn't being deployed as part of the schema.The following statement is missing as a result of processing schema by the visitor: