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

add option to drop views during DropCommand #1038

Closed
wants to merge 3 commits into from

Conversation

torhoehn
Copy link
Contributor

@torhoehn torhoehn commented Sep 21, 2022

Magerun pull-request check-list:

  • Pull request against develop branch (if not, just close and create a new one against it)
  • README.md reflects changes (if any)
  • phar fuctional test (in tests/phar-test.sh)

Summary: (some words as summary)

Fixes #602.

Changes proposed in this pull request:

  • Extend the database helper to return views
  • Adopt table drop logic also for views in db:drop command

* @throws RuntimeException
* @throws \Magento\Framework\Exception\FileSystemException
*/
public function getViews($withoutPrefix = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copied from getTables function, has to be tested and developed

@torhoehn torhoehn force-pushed the feature/db-drop-views branch 2 times, most recently from c01e979 to 288932e Compare September 21, 2022 19:17
@cmuench
Copy link
Member

cmuench commented Sep 22, 2022

@torhoehn nice. I will review that after the next release if it's ok. Or we discuss it in Cologne :-)

@torhoehn
Copy link
Contributor Author

@cmuench I'm sure you could teach me something there. :)

@cmuench
Copy link
Member

cmuench commented Jan 17, 2023

@torhoehn I didn't forget your PR. I plan to merge this feature in the v7.0.0 release.

@cmuench cmuench force-pushed the feature/db-drop-views branch from 288932e to b0f62ca Compare January 19, 2023 17:37
This conflicts with the global Symfony verbose option.
@cmuench
Copy link
Member

cmuench commented Jan 19, 2023

@torhoehn I remove the "-v" shortcut. This produces an error, because the "-v" option is already reserved as global shortcut of the verbose option in Symfony Commands.
The I rebased the branch with latest develop branch of n98-magerun2 which got a bigger refactoring. Jobs are running. I will do further tests in the next days.

@cmuench
Copy link
Member

cmuench commented Jan 24, 2023

I tested the drop function.
It's currently not working. I got this error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual th at corresponds to your MariaDB server version for the right syntax to use near 'LIKE 'view%'' at line 1

The generated SQL query looks like this:
SELECT table_name FROM information_schema.views WHERE table_schema = database() AND LIKE 'view%';

I left the "echo" statement in the code for debugging.

@cmuench
Copy link
Member

cmuench commented Sep 12, 2023

I close this MR until we have refactored the command.

@cmuench cmuench closed this Sep 12, 2023
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.

Handling for Views in db:dump / db:drop
2 participants