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

Deprecate "unique" and "check" column properties #5656

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Sep 5, 2022

Introspection of these properties is not supported. The support for these properties is not tested.

Unique constraints can be implemented via unique indexes or unique constraints.

Implementing proper support for managing checks is impossible in the current state of the DBAL (see doctrine/orm#9465 (comment)).

@morozov morozov added this to the 3.5.0 milestone Sep 5, 2022
@morozov morozov marked this pull request as ready for review September 5, 2022 19:25
Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

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

Even MySQL has checks added by now in one of the 8.0.* releases, but the current checks implementation got old and I haven't seen much usage of it. Maybe it should be removed and, if people need them, has to be reimplemented anew.

I'd like to have a second opinion for this PR.

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.

the current checks implementation got old and I haven't seen much usage of it

I think the check property is seldom used, but that might not be the case of the unique property. That being said, its implementation seems to use a method deprecated in #4724 , so this ship has already kind of sailed I think.

@morozov
Copy link
Member Author

morozov commented Sep 17, 2022

That being said, its implementation seems to use a method deprecated in #4724, so this ship has already kind of sailed I think.

Fairly speaking, #4724 only deprecates the method, not the functionality. My greatest concern is schema introspection. With the switch to the platform-aware logic, if anybody used these properties, they would get false positives: the column definitions on the application side would contain these properties but the ones introspected from the database wouldn't.

If anybody used them, we would likely receive the corresponding bug reports.

@morozov morozov merged commit a4a784a into doctrine:3.5.x Sep 18, 2022
@morozov morozov deleted the deprecate-unique-check branch September 18, 2022 14:14
@juanparati
Copy link

juanparati commented May 11, 2023

With MariaDB it's important to inspect the check properties in order to know if one column is JSON instead of a TextType, because they don't support native JSON types and they add the "json_valid" function to the "check".

+Info: https://mariadb.com/kb/en/json-data-type/

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

Successfully merging this pull request may close these issues.

None yet

4 participants