-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Repair the update of database schema changes on postgreSQL #19707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
i remember that
you should issue/manage something like this instead |
|
Thanks,
I fixed it and now you can use function with parameters after word |
I have not explained that before. This was a reason I had to comment line in because it is conflicted with query from Example: The result is, the problem won't be fixed because the database table won't match to the query from the first file or to the query from the second file. In my example, which you tested, I redefined a few columns and then joomla show changed column that does not match to queries from previous update files. If this is a problem I can find a better columns (which does not exists in update files before). |
|
i was 😪 |
|
I have tested this item ✅ successfully on 7001e67 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19707. |
|
I finally got pgsql installed on my windows machine Not sure if my test is successful or not as I still have a few issues to fix after applying the patch This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19707. |
|
Nice, after you applied the PR, joomla starts to show you a database problems (old problems that have never been recognized before). Before you start to use my above test examples you can click on fix button and all issues should disappear. |
|
I updated the test instructions. |
|
As PR #17351 for the mysql version has been merged it would be good to take a look at this version for postgreSQL. |
|
Can we merge this after only one success test? |
| /* Changes to tables where data type conflicts exist with MySQL (mainly dealing with null values */ | ||
| ALTER TABLE "#__modules" ALTER COLUMN "content" SET DEFAULT ''; | ||
| ALTER TABLE "#__updates" ALTER COLUMN "data" SET DEFAULT ''; | ||
| --ALTER TABLE "#__updates" ALTER COLUMN "data" SET DEFAULT ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should't we remove this line? Maybe I just don't get it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove it, but I thought it would be better to leave it because of history, e.g.
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/sql/updates/mysql/3.4.0-2014-09-16.sql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add such a comment than too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
7001e67 to
daed6e3
Compare
|
I rebased it and I added a comment only. |
|
Given the low number of postgres testers I'm going to merge this with the one good test |
Migrate the change from PR joomla#19707 for ALTER TABLE statements with multiple actions to check the last change instead of failing from PostgreSQL to MySQL.
Migrate the change from PR joomla#19707 for ALTER TABLE statements with multiple actions to check the last change instead of failing from PostgreSQL to MySQL.
Migrate the change from PR joomla#19707 for ALTER TABLE statements with multiple actions to check the last change instead of failing from PostgreSQL to MySQL.
Migrate the change from PR joomla#19707 for ALTER TABLE statements with multiple actions to check the last change instead of failing from PostgreSQL to MySQL.
Migrate the change from PR joomla#19707 for ALTER TABLE statements with multiple actions to check the last change instead of failing from PostgreSQL to MySQL.

Pull Request for Issue # #14331
Summary of Changes
This PR is based on #17351, #18483 and is a replacement for #18483.
After PR, joomla recognises correctly:
SET NOT NULL;SET DEFAULT '';DROP DEFAULT;- does not work in [postgresql] - schema change rework #18483DROP NOT NULL;TYPE character varying(127)- new stuff - allow to resize column... DROP DEFAULT, ... SET DEFAULT 0;- only test the last action after commaTesting Instructions
[UPDATED]
This issue should not happen because there is a fresh installation.
The column has a definition at
joomla-cms/installation/sql/postgresql/joomla.sql
Line 1868 in 73ca292
This means that the update query from
joomla-cms/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql
Line 3 in c8b2121
is wrong and should be removed as I did in my PR.
joomla-cms/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-03.sql
Line 3 in 73ca292
is not visible by joomla (bug) and the query can not fix our database.
Now our database is different than the fresh from installation but joomla does not see any problems.
Apply this PR by com_patchtester
Go to extension -> database.
Now you see

After you click on the Fix button, the column
datafrom#__updateswill be repaired and will be equal to definition fromjoomla-cms/installation/sql/postgresql/joomla.sql
Line 1868 in 73ca292
The next tests are to check if each query starts with
ALTER TABLE ALTER COLUMNis visible by joomla. I prepared 7 queries:After you put it at the bottom of
joomla-cms/administrator/components/com_admin/sql/updates/postgresql/3.8.4-2018-01-16.sql
Lines 1 to 2 in 5bf0e5d
and refresh

extension -> databasepage you should see a 7 issues:This means that every query is recognised by joomla.
Then click on the Fix button.
Now everything is OK.
Then refresh
extension -> databasepage we will see 7 issues:this means that all queries have been recognised.
Now click on the Fix button. All s OK.
administrator/components/com_admin/sql/updates/postgresql/3.8.4-2018-01-16.sqland refreshextension -> database. All is OK.Expected result
All changes/issues are visible and can be fixed.
Actual result
Joomla does not recognise a few above queries or recognises them incorrectly.