This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
SQL fixes for PR #6 #10
Merged
khu5h1
merged 32 commits into
joomla-projects:cleanup
from
richard67:cleanup-fix-sql-2022-08-13
Sep 24, 2022
Merged
SQL fixes for PR #6 #10
khu5h1
merged 32 commits into
joomla-projects:cleanup
from
richard67:cleanup-fix-sql-2022-08-13
Sep 24, 2022
Conversation
This file contains 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
- Fix wrong lft, rgt and level value - Remove unused asset for plugin - Adapt rgt value of the root item to the new asset
When inserting values into a table with specifying the values for an auto-incremented ID column, the next value of the corresponding sequence has to be set on PostgreSQL databases.
The values for the "ordering" and "state" are missing here, which causes an SQL error when installing Joomla on a PostgreSQL database.
On updates we do not create new assets, so we use asset_id zero for the records we insert on updates, see e.g. 4.0.0-2018-05-15.sql
Explanation see description of commit joomla-projects@c1476f6 .
- Some code style fixes - Be consistent with how you specify primary keys in MySQL - On update, insert new extensions with one insert statement and use ordering 0
Add missing extensions record for the plugin for new installations on PostgreSQL
- The checked_out and checked_out_time columns meanwhile allow null values and so also should not have a default value. - Use data types consistent with other tables for these columns.
- Use correct data types in PostgreSQL. - Remove "state" column which is not used for MySQL either.
See joomla/joomla-cms#37156 for details.
The soundex function has to be the last thing in this file.
- Do not use wrong values for created and modified times. - Do not use hardcoded user ID.
- Hardcoded MySQL names quotes in this query lead to an SQL error on PostgreSQL databases - Added other missing names quotes
Remove wrong code possibly resulting from copy and paset
The database checker for PostgreSQL seems to have a problem when the opening bracket is in a new line. This has to be fixed elsewhere, For now adapt to this behavior.
13 tasks
…uided-tour into cleanup-fix-sql-2022-08-13
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR #6 .
Summary of Changes
This Pull Request (PR) fixes errors in the installation and update SQL scripts and one error in the tours model and adapts the update SQL scripts to the enhancements made with PR joomla/joomla-cms#37156 for the 4.2 version for more fault tolerant update SQL scripts.
The changes have been made with several commits in a comprehensive way so you can understand why a change has been made.
Simply go to the list of commits of this PR. You can expand the descriptions with details or links to details by using the "..." right beside the title of each commit.
By clicking on the title (or better right click and chose open in a new tab) you can then see the changes made with this commit.
Testing Instructions
Check that a new installation and after that login to backend work without SQL errors on all kinds or supported databases (MySQL or MariaDB and PostgreSQL).
Check that updating any 3.10 or 4.x version to a package build with this PR and after that login to backend work without SQL errors on all kinds or supported databases (MySQL or MariaDB and PostgreSQL).
Actual result BEFORE applying this Pull Request
New installations and updates fail for sure with PostgreSQL.
Hard-coded user IDs used for created by and modified by users for the new data on new installations and updates.
On PostgreSQL you get an SQL error due to hardcoded MySQL names quotes being used in an SQL query in the guided tours model.
MySQL data types were used in SQL scripts for PostgreSQL.
Wrong data types (strings instead of numbers or datetimes/timestamps) used for values in insert statements.
....
Expected result AFTER applying this Pull Request
No such errors anymore.
Documentation Changes Required
None.