User tests: Successful: Unsuccessful:
This hopefully changes all datetime values for com_content from the pseudo-null-date 0000-00-00 00:00:00 to a real null value.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql com_content JavaScript Repository NPM Change Front End Installation Libraries Modules Plugins |
@Hackwar Regarding my comment above: I mean that the database checker will only check the first column modification if you have all in 1 alter table statement. But when the check shows for the first column that the statement has not run yet, it will run the complete statement.
So it is formally not correct to have all in 1 statement.
On the other hand, it might be necessary that we do it like this in MySQL 8, and maybe also lower, if strict mode is on. I noticed on MySQL 8 that when running such statement for a single column in PhpMyAdmin on MySQL8, I get an SQL error complaining about the other column not having a valid default value.
If it turns out we have to do that and so betray the database checker a bit (but it would work), then we have to do that everywhere where this change for real null columns has been made already, because I've seen in schema updates of those PR that they did it like I suggested, with 1 alter table statement for every column.
@Hackwar When running in PhpMyAdmin on MySQL 5.7 with strict mode on, I even have to add the checked_out_time
column to make it work, and I have to do all with 1 statement:
ALTER TABLE
#__content
MODIFYcreated
DATETIME NULL DEFAULT NULL,
MODIFYmodified
DATETIME NULL DEFAULT NULL,
MODIFYchecked_out_time
DATETIME NULL DEFAULT NULL,
MODIFYpublish_up
DATETIME NULL DEFAULT NULL,
MODIFYpublish_down
DATETIME NULL DEFAULT NULL;
Labels |
Added:
NPM Resource Changed
?
|
I'm going to change the ISNULL to IS NULL and see where the issue in the install SQL is. I would keep the original PR for checked_out and simply provide PRs for everything else and then we can merge everything.
I will of course do the getNullDateTime() call.
Which issue in the install SQL?
Closed_Date | 2019-10-14 18:09:55 | ⇒ | 2019-10-14 18:09:56 |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-14 18:09:55 |
Closed_By | ⇒ | Quy |
Replaced by #26295.
@Hackwar I don't think the database schema checker/fixer understands this in the schema update for MySQL:
I think it needs a single line statement for each column for the database schema checker/fixer:
You could see that here:
https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Schema/ChangeItem/MysqlChangeItem.php#L149-L175