Skip to content
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

Fix syntax in 3.8.0-2017-07-28.sql #17626

Merged
merged 1 commit into from
Aug 20, 2017
Merged

Conversation

wojsmol
Copy link
Contributor

@wojsmol wojsmol commented Aug 19, 2017

#Pull Request for Issue # .

Summary of Changes

Fixed syntax in 3.8.0-2017-07-28.sql update files for mysql and postgresql to be detected by Joomla schema checker on update.

Testing Instructions

  1. Install latest staging on mysql or postgresql
  2. Go to database fixer and remember number of checked database changes.(in my case 146)
  3. Apply PR.
  4. Go to database fixer and check number of checked database changes should be one more then in point 2 (in my case 147).
    or code review

Expected result

147 database changes were checked.

Actual result

146 database changes were checked.

Documentation Changes Required

N/A

cc @alikon @csthomas @twister65 for postgresql testing

@twister65
Copy link
Contributor

twister65 commented Aug 20, 2017

ADD COLUMN is only for postgreSQL:
ALTER TABLE "#__fields_groups" ADD COLUMN "params" TEXT NOT NULL;

For mySQL, it's only ADD :
ALTER TABLE '#__fields_groups' ADD 'params' TEXT NOT NULL AFTER 'ordering';

@wojsmol
Copy link
Contributor Author

wojsmol commented Aug 20, 2017

@twister65 For MySQL ADD and ADD COLUMN are both valid but only ADD COLUMN is recognised by Joomla schema manager see

if ($command === 'ALTER TABLE')
{
$alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]);
if ($alterCommand === 'ADD COLUMN')
{
$result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[5]);
$this->queryType = 'ADD_COLUMN';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]));
}

@wojsmol
Copy link
Contributor Author

wojsmol commented Aug 20, 2017

pinging @mbabker

@mbabker mbabker added this to the Joomla 3.8.0 milestone Aug 20, 2017
@mbabker mbabker merged commit c68cc23 into joomla:staging Aug 20, 2017
@wojsmol wojsmol deleted the fix-17317 branch August 20, 2017 20:03
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.

None yet

4 participants