User tests: Successful: Unsuccessful:
Pull Request for Issue # #14331
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 #18483DROP NOT NULL;
TYPE character varying(127)
- new stuff - allow to resize column... DROP DEFAULT, ... SET DEFAULT 0;
- only test the last action after comma[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
is wrong and should be removed as I did in my PR.
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.
After you click on the Fix button, the column data
from #__updates
will be repaired and will be equal to definition from
joomla-cms/installation/sql/postgresql/joomla.sql
Line 1868 in 73ca292
The next tests are to check if each query starts with ALTER TABLE ALTER COLUMN
is visible by joomla. I prepared 7 queries:
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" DROP NOT NULL;
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" DROP DEFAULT;
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" TYPE bigint USING "modified_by"::bigint;
ALTER TABLE "#__contact_details" ALTER COLUMN "con_position" SET DEFAULT '';
ALTER TABLE "#__contact_details" ALTER COLUMN "mobile" DROP DEFAULT,
ALTER COLUMN "mobile" SET DEFAULT 'new value';
ALTER TABLE "#__contact_details" ALTER COLUMN "address" SET NOT NULL;
ALTER TABLE "#__contact_details" ALTER COLUMN "alias" TYPE character varying(10) USING substr("alias", 1, 10);
After you put it at the bottom of
and refresh extension -> database
page 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.
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" SET NOT NULL;
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" SET DEFAULT 0;
ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified_by" TYPE integer USING "modified_by"::integer;
ALTER TABLE "#__contact_details" ALTER COLUMN "con_position" DROP DEFAULT;
ALTER TABLE "#__contact_details" ALTER COLUMN "mobile" SET DEFAULT '';
ALTER TABLE "#__contact_details" ALTER COLUMN "address" DROP NOT NULL;
ALTER TABLE "#__contact_details" ALTER COLUMN "alias" TYPE character varying(255);
Then refresh extension -> database
page 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.sql
and refresh extension -> database
. All is OK.All changes/issues are visible and can be fixed.
Joomla does not recognise a few above queries or recognises them incorrectly.
Status | New | ⇒ | Pending |
Category | ⇒ | Postgresql SQL Administration com_admin Libraries |
Labels |
Added:
?
|
Thanks,
ALTER TABLE "#__contact_details" ALTER COLUMN "alias" TYPE varchar(10) USING substr("alias", 1, 10)
I fixed it and now you can use function with parameters after word USING
after the first fix, still get database issues
I have not explained that before.
This is an expected behaviour (for above columns) because of earlier sql queries.
This was a reason I had to comment line in administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql
because it is conflicted with query from
administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-03.sql
Example:
The first update file contains "... column X SET DEFAULT ''"
The second update file redefines column X and change default value to NULL.
This two changes has a conflict and joomla show first or second issue.
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
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
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.
Today or tomorrow I will try to add easier text instructions.
I updated the test instructions.
Can we merge this after only one success test?
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
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-10 08:40:15 |
Closed_By | ⇒ | wilsonge |
i remember that?
DROP DEFAULT;
was fixed on #18483, but i've no problem on closing that in favour of this one as your are adding new features, and with the hope this one have more luck than my old onegetting the ERROR: value too long for type character varying(10)
ALTER TABLE "#__contact_details" ALTER COLUMN "alias" TYPE character varying(10);
you should issue/manage something like this instead