[4.0] Remove the meanwhile obsolete updateDates routine from installation database model#26825
Merged
wilsonge merged 2 commits intojoomla:4.0-devfrom Nov 2, 2019
Conversation
This was referenced Oct 26, 2019
Contributor
|
Thanks! |
Member
Author
|
Thanks too. |
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.
Pull Request for Issue #26387 , datetime part.
The user ID part is done in PR #26745 (added missing workflow table to routine
updateUserIds) .Summary of Changes
This Pull Request (PR) removes the routine
updateDatesfrom the installation database model.The routine is used to set datetime fields in database to current date and time if they are not null and not equal to the old nulldate, i.e. when something was inserted with a hard-coded creation time at new installation.
With recently merged PR's for the datetimes things the joomla.sql scripts have been changed so there is not any data inserted anymore with such hardcoded times. Instead of this,
CURRENT_TIMESTAMPis used.So the
updateDatesroutine is not needed anymore for the core.For custom installation SQL scripts like
localise.sqlorcustom.sqlwhich might be used by some customized installations, it is recommended to useCURRENT_TIMESTAMPtoo in SQL scripts, but it is preferred to insert new content using the appropriate PHP API like we do in our diverse sample data.See also comments here #26399 (comment) and here #26399 (comment).
Testing Instructions
Attention: Do this only on a testing environment where your data can be thrown away.
Testers please report back in any case (success or failure) which kind of database (MySQL/MariaDB or PostgreSQL) you've used for testing. If you have several and enough time, please test with all of them.
datetime(MySQL) ortimestamp without time zone(PostgreSQL) have either value NULL or the date and time of installation in UTC, but not anything else in past or future. Such columns are eg all columns likecreated_timeormodified_time(with different named here and there, but you will find them).Expected result
All datetimes in database which don't allow null values have as value the date and time in UTC when the installation has been finished, ie there is no other fixed datetime given in past or future for columns like
created_timeormodified_time.There is one exception the lastResetTime of users, which will be fixed when PR #26611 is merged.
Actual result
Same as expected, but one useless routine more in the installation database model.
Documentation Changes Required
Maybe somewhere inform developers of customized installations that they shall use
CURRENT_TIMESTAMPin SQL scripts but better insert new content using the appropriate PHP API like we do in our diverse sample data.