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

Add support for disabling type comments in the schema #1714

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

stof
Copy link
Member

@stof stof commented Oct 23, 2023

This adds a new disable_type_comments boolean setting in the DBAL configuration to expose the DBAL feature added in doctrine/dbal#6150

DBAL 3.2 implemented the platform-aware schema comparison APIs which don't rely on the DC2Type comments on columns anymore and has deprecated the old schema comparison APIs. DBAL 4.0 removes type comments entirely (In 4.0, this setter would become a no-op in the Configuration class and it will be deprecated in 4.1).
For projects that use the new APIs (and doctrine/migrations uses them), the type comment is pure noise in the DB. And it would generate a DB migration when migrating to DBAL 4 to remove those comments (which are added for any date*_immutable fields for instance). The new setting allows to perform the cleanup earlier than the DBAL 4 release (and avoiding to add new type comments for further schema changes until then).

@stof stof added this to the 2.11.0 milestone Oct 23, 2023
@dmaicher
Copy link
Contributor

Should it be documented?

@ostrolucky
Copy link
Member

Indeed. Please add docs and test, if it's easy enough

@stof stof force-pushed the disable_type_comments branch 2 times, most recently from 1fb4262 to e421b19 Compare October 23, 2023 14:59
@stof
Copy link
Member Author

stof commented Oct 23, 2023

I added those. For the documentation, I'm adding that only in the configuration reference. I don't think it needs lots of documentation.

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.

3 participants