Add a update sql File in a Component and use SQL: ADD COLUMN IF NOT EXISTS column_name
Install and go to the Maintenance: Database View
Database is reportet to have no Problems
I shows that there is a problem in the Database
ERROR Mesage:
One Problem
Table 'prefix_tablename' does not have column 'IF'. (From file x.x.x-XXXX-XX-XX.sql)
Table 'prefix_tablename' does not have index 'IF'. (From file x.x.x-XXXX-XX-XX.sql)
1 database changes were checked.
1 database changes did not alter table structure and were skipped.
Joomla 5.2.5
PHP 8.2
Labels |
Added:
No Code Attached Yet
|
To the best of my knowledge MySQL does not have a direct IF NOT EXISTS clause for ADD COLUMN.
Confirmed. Only MariaDB has that. MySQL doesn't have it, see https://dev.mysql.com/doc/refman/8.4/en/alter-table.html .
@Weiskopfseeadler As the CMS core has to work with MariaDB and MySQL, it does not use that MariaDB specific syntax, and your component should do the same.
If you agree, please close the issue.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-04-08 13:13:33 |
Closed_By | ⇒ | richard67 |
@Weiskopfseeadler See also this older, closed issue: #39333 .
As stated there, you can use the /** CAN FAIL **/
installer hint: #39333 (comment)
Closing as expected behaviour.
To the best of my knowledge MySQL does not have a direct IF NOT EXISTS clause for ADD COLUMN.