In the sql update file, if I add multiple CHANGE COLUMN in one ALTER TABLE statement.
It will cause error in the page Check Database Updates (In Joomla 4 Backend > System > Database).
For example, if I add the statement below to the file:
sql/updates/4.8.3.sql
ALTER TABLE `#__geekelasticsearch_log_searches`
CHANGE `first_search` `first_search` DATETIME NULL DEFAULT NULL,
CHANGE `last_search` `last_search` DATETIME NULL DEFAULT NULL;
The class that build sql check update will generate invalid query as below (libraries/src/Schema/ChangeItem/MysqlChangeItem.php):
SHOW COLUMNS IN `jos_geekelasticsearch_log_searches` WHERE field = 'first_search' AND UPPER(type) = 'DATETIME' AND `default` = NULL, AND `null` = 'YES'
I have to split that sql statement into multiple ones as below to resolve this issue:
ALTER TABLE `#__geekelasticsearch_log_searches` CHANGE `first_search` `first_search` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__geekelasticsearch_log_searches` CHANGE `last_search` `last_search` DATETIME NULL DEFAULT NULL;
In the sql update file, if I add multiple CHANGE COLUMN in one ALTER TABLE statement.
It will cause error in the page Check Database Updates (In Joomla 4 Backend > System > Database).
For example, if I add the statement below to the file:
sql/updates/4.8.3.sql
The class that build sql check update will generate invalid query as below (libraries/src/Schema/ChangeItem/MysqlChangeItem.php):
I have to split that sql statement into multiple ones as below to resolve this issue: