[4.0] Converting checked_out fields to true NULLs#29260
Merged
wilsonge merged 4 commits intojoomla:4.0-devfrom May 29, 2020
Merged
[4.0] Converting checked_out fields to true NULLs#29260wilsonge merged 4 commits intojoomla:4.0-devfrom
wilsonge merged 4 commits intojoomla:4.0-devfrom
Conversation
Member
|
Nice PR you know hat we use === null and not is_null normally? |
wilsonge
reviewed
May 29, 2020
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-05-29.sql
Outdated
Show resolved
Hide resolved
richard67
reviewed
May 29, 2020
richard67
reviewed
May 29, 2020
Contributor
|
@Hackwar @richard67 RE: your comments technically the issues are the |
Contributor
|
Thanks! |
Member
Contributor
|
never mind a b/c break it doesnt work and breaks everything |
Contributor
|
@brianteeman can you elaborate. All of core seems to work fine to me. And #29272 will fix JM's issue I believe |
sakiss
pushed a commit
to sakiss/joomla-cms
that referenced
this pull request
Oct 16, 2020
* Converting checked_out fields to true NULLs * Fixing errors * Don't check in everything * Fixing Postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The checked_out fields so far had the behaviour that items were checked out when the value was >0 and not checked out when it was equal to 0. From a theoretical standpoint, 0 here is a magic number and we should avoid that. So we should change that to using a real NULL value for checked-in items and a positive integer for checked-out items.
However, if this were just a theoretical exercise this wouldn't be a big issue. However we are now using NULL-aware table classes and we either need to add checks in each NULL-aware table class to fill the checked_out column with a 0 value or we need to make the change that this PR does. Otherwise a not-set checked_out column results in a failure when storing the table content. This can be seen in #29217.
This PR also unifies all checked_out columns to be an unsigned integer instead of INT(11), bigint, signed or whatever.