? ? ? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
30 Jul 2017

Currently Database Schema checker (Database FIX) button is ignoring

  • NULL column attribute
  • DEFAULT column attribute

e.g. this is not checked

ALTER TABLE `table1` MODIFY `colname1` NOT NULL DEFAULT 'somevalue'

Also this is applied only when column is of wrong name

ALTER TABLE `table1` CHANGE `colname_old` `colname_new` NOT NULL DEFAULT 'somevalue'

Thus the above query will not run if column is correct name despite NULL and DEFAULT attributes being of wrong value

Summary of Changes

Modify Schema checker to support checking the above
(modified and tested Mysql / Maria DB, someone should help with the other DBs)

Testing Instructions

View an 'upgrade' SQL file that has

ALTER TABLE 'table1' MODIFY/CHANGE ...

e.g.
administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-04

ALTER TABLE `#__extensions` CHANGE `enabled` `enabled` TINYINT(3) NOT NULL DEFAULT '0';

-- Go to a DB manager e.g. phpmyadmin and change it to NULL
Run the DB Fixer and you will be ask to fix it (back to NOT NULL)

-- Go to a DB manager e.g. phpmyadmin and change DEFAULT to '1'
Run the DB Fixer and you will be ask to fix it (back to '0')

If your apply this PR to some older installations e.g. a J2.5 upgraded up to staging,
then probably you will find several errors ... already being there

Expected result

Database Schema checker (Database FIX) supports checking
queries like: ALTER TABLE 'table1' MODIFY/CHANGE

  • NULL column attribute
  • DEFAULT column attribute

Actual result

The above are not checked

Documentation Changes Required

None

avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2017
Category Libraries
avatar ggppdk ggppdk - open - 30 Jul 2017
avatar ggppdk ggppdk - change - 30 Jul 2017
Status New Pending
avatar ggppdk ggppdk - change - 30 Jul 2017
Labels Added: ?
avatar ggppdk ggppdk - change - 30 Jul 2017
The description was changed
avatar ggppdk ggppdk - edited - 30 Jul 2017
avatar ggppdk ggppdk - change - 30 Jul 2017
The description was changed
avatar ggppdk ggppdk - edited - 30 Jul 2017
avatar ggppdk ggppdk - change - 30 Jul 2017
The description was changed
avatar ggppdk ggppdk - edited - 30 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2017
Category Libraries Administration Language & Strings Libraries
avatar wilsonge
wilsonge - comment - 30 Jul 2017

This needs doing for the mssql and postgresql drivers too. we need parity between the drivers

avatar ggppdk ggppdk - change - 31 Jul 2017
The description was changed
avatar ggppdk ggppdk - edited - 31 Jul 2017
avatar ggppdk
ggppdk - comment - 3 Aug 2017

This needs doing for the mssql and postgresql drivers too. we need parity between the drivers

Yes indeed , and i have asked for someone to volunteer to convert code to the other DBs
it will take me some time to setup again these environments, but if i get some time i will do it

avatar brianteeman brianteeman - change - 7 Aug 2017
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Nov 2017
Status Pending Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Dec 2017

@ggppdk do i guess correct there is no Progress on this issue?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17351.

avatar ggppdk
ggppdk - comment - 26 Dec 2017

yes, this code is still implemented for only MySQL, don't have time to test / implement for other DBs now, this will need to wait for a while longer

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Dec 2017

thanks for Info @ggppdk.

avatar wilsonge
wilsonge - comment - 26 Dec 2017

@alikon are you interested in picking this up for non-mysql drivers?

avatar alikon
alikon - comment - 29 Dec 2017

i'll look at it

avatar alikon
alikon - comment - 29 Dec 2017

@ggppdk can you solve the conflict please

avatar alikon
alikon - comment - 29 Dec 2017

after some dirty hacks for solving conflicts, and as per testing info
under mysql driver it works as described....
i'll try to port these changes to the postgresql driver too...

avatar wilsonge
wilsonge - comment - 29 Dec 2017

Thanks :)

76c1726 30 Dec 2017 avatar ggppdk CS
avatar ggppdk
ggppdk - comment - 30 Dec 2017

Rebased the PR,
the file had no other changes, it was simply moved to new location

avatar alikon
alikon - comment - 2 Jan 2018

the postgresql version is #18483

avatar alikon alikon - test_item - 2 Jan 2018 - Tested successfully
avatar alikon
alikon - comment - 2 Jan 2018

I have tested this item successfully on ed379a2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17351.

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jan 2018
Status Information Required Discussion
avatar csthomas
csthomas - comment - 16 Feb 2018

I have tested this item successfully on ed379a2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17351.

avatar csthomas csthomas - test_item - 16 Feb 2018 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Feb 2018
Status Discussion Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Feb 2018

Ready to Commit after two successful tests.

avatar mbabker mbabker - change - 26 Feb 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-26 03:23:44
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 26 Feb 2018
avatar mbabker mbabker - merge - 26 Feb 2018

Add a Comment

Login with GitHub to post a comment