Skip to content

Conversation

@richard67
Copy link
Member

Pull Request for #38149 (comment) .

Summary of Changes

With PR #38149 , update SQL scripts have been added, which add a new column to a table.

However, the corresponding SQL statement is missing the /** CAN FAIL **/ installer hint, which has been implemented once with PR #36506 and established with PR #37156 for all ALTER TABLE ... ADD COLUMN statements.

The use of this installer hint is to ignore the SQL error which happens when the statement runs and the column already exists because MySQL and PostgreSQL do not support an IF NOT EXISTS in such an SQL statement. This can happen e.g. when an update breaks for some reason after the SQL statement has run but the schema version has not been updated in the database, so then trying to resume the broken update the statement will run again.

Testing Instructions

Code review. See e.g. following places for examples how /** CAN FAIL **/ is used:

Actual result BEFORE applying this Pull Request

Installer hint /** CAN FAIL **/ is missing.

Expected result AFTER applying this Pull Request

Installer hint /** CAN FAIL **/ is present.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

@HLeithner
Copy link
Member

thx

@brianteeman
Copy link
Contributor

That was my fault for not understanding the meaning of CAN FAIL

@richard67
Copy link
Member Author

That was fast 😄 .

@richard67 richard67 deleted the 5.0-dev-add-missing-can-fail-to-update-sql branch July 18, 2023 11:51
GeraintEdwards pushed a commit to GeraintEdwards/joomla-cms that referenced this pull request Aug 14, 2023
GeraintEdwards pushed a commit to GeraintEdwards/joomla-cms that referenced this pull request Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants