Skip to content

Command to rebuild MySQL Triggers #10958

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

Closed
wants to merge 2 commits into from
Closed

Command to rebuild MySQL Triggers #10958

wants to merge 2 commits into from

Conversation

josephmcdermott
Copy link
Contributor

Description

Fixed Issues (if relevant)

  1. Column names row_id and entity_id seem mixed up after upgrading to Magento2 EE 2.1 or 2.1.1 possibly due to catalog staging (module magento-catalog-staging) #6478

Manual testing scenarios

  1. Start with a 2.0.x instance with Indexers set to By Schedule.
  2. Upgrade to 2.1.8 or 2.1.9.
  3. In the DB, attempt to delete a row from catalog_product_entity_varchar.
  4. Observe error: ERROR 1054: 1054: Unknown column 'entity_id' in 'NEW'.
  5. Run CLI command ./bin/magento indexer:rebuild-triggers.
  6. Retry step 3 with success this time.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • [-] All new or changed code is covered with unit/integration tests (if applicable)
  • [-] All automated tests passed successfully (all builds on Travis CI are green)

@vrann
Copy link
Contributor

vrann commented Sep 19, 2017

@josephmcdermott is there any reason why this can't be a part of the UpgradeSchem.php script? I'm a bit hesitant introducing CLI command which will be used just once in a very specific use case (most SI or developers most likely will not use it ever) but it will be supported from version to version of Magento.

@josephmcdermott
Copy link
Contributor Author

No not really, it could be a setup script. I use this kind of approach in local dev from time to time though (manually turning off and on via admin panel index management), as I often find on client DB's that the triggers are missing or are owned by another user, etc. so this can be quite useful.

@vrann
Copy link
Contributor

vrann commented Sep 19, 2017

@josephmcdermott would you be willing to convert it to setup script?

@josephmcdermott
Copy link
Contributor Author

josephmcdermott commented Sep 20, 2017

Went to have a look, and looks like you guys already have this in hand with the same approach:
78b796f

The install() method does the 'turn off and turn on' I was proposing, during every install/upgrade in the RecurringData class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants