-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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.
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. |
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". |
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)).