mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #11658] Create the default namespace in the schema #13168
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/11658
State: closed
Merged: No
This patch should address https://github.com/doctrine/migrations/issues/1415.
Problem details
current_schema()in theSchema.SchemaToolgenerates the schema to be deployed, it doesn't create the default namespace.As a result, we have a mismatch in the list of schemas between the "from" and "to" schemas.
Solution
Instead of the approach proposed in https://github.com/doctrine/dbal/issues/5609, here, we add the default namespace obtain from the schema configuration, to the schema. This replicates the behavior of the schema manager.
Alternatives
As an option, the DBAL
Schemacould automatically create the namespace with the name from configuration in its constructor. There are certain difficulties with that:postgres).createNamespacewith the same name (as the DBAL's schema manager does) will fail.Limitations
This fix cannot be implemented in ORM 2.x which still supports DBAL 3.x, which has the issue #2 from the above list.