Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compensate difference between DBAL schema introspection and ORM generation #1463

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

morozov
Copy link
Member

@morozov morozov commented Oct 10, 2024

Q A
Type bug
BC Break no

Fixes #1415.

There is a discrepancy between how the DBAL represents the introspected schema and how the ORM generates the schema that represents entities:

  • The DBAL includes all existing namespaces into the introspected schema, including the default ones like public for PostgreSQL.
  • The ORM doesn't include any namespaces into the generated schemas, even if the schema contains tables in those namespaces. This behavior is incorrect, but fixing it isn't trivial (Create the default namespace in the schema orm#11658).

The above discrepancy leads to false differences between the schemas, which we want to compensate here:

  • As of DBAL 4.0, the PostgreSQL schema manager sets the introspected schema name to the name of the current schema
  • If it's set, Migrations will create the corresponding namespace in the schema generated by the ORM.

Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works 🎉 ! Thanks a lot for fixing this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CREATE SCHEMA public is added to all down migrations in Postgres
2 participants