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

Update site empty command to include removal of wp_links table data #284

Merged
merged 3 commits into from Apr 8, 2020

Conversation

thrijith
Copy link
Member

@thrijith thrijith commented Mar 7, 2020

Fixes #261

@thrijith thrijith requested a review from a team as a code owner Mar 7, 2020
@thrijith
Copy link
Member Author

thrijith commented Mar 7, 2020

@schlessera I have manually tested and verified removal of data on local setup, I am not sure how to go about adding tests for the same, please let me know if a test is required for this change. Thanks.

@schlessera
Copy link
Member

There are already existing tests for the site empty command here: https://github.com/wp-cli/entity-command/blob/v2.0.7/features/site-empty.feature

You can just add to these to verify the logic with the following test:

  • add an entry to the wp_links table;
  • run site empty;
  • query the SELECT COUNT(*) from $wpdb->links and verify that the count is zero.

src/Site_Command.php Outdated Show resolved Hide resolved
src/Site_Command.php Outdated Show resolved Hide resolved
Add tests to validate data truncate of wp_links table
@thrijith
Copy link
Member Author

thrijith commented Mar 24, 2020

@schlessera the build seems to have passed, but there seems to be some issue with travis config, can you please take look when time permits? Thanks.

If the travis config isn't valid, maybe I can create a PR to update that as well, seems like a good option to use automated script to add updates across repos.

@schlessera
Copy link
Member

@thrijith I'm pushing PRs to all repos right now to fix the Travis warning.

@schlessera schlessera added this to the 2.0.8 milestone Apr 8, 2020
@schlessera schlessera merged commit 04e9a16 into master Apr 8, 2020
@schlessera schlessera deleted the empty-links-table branch Apr 8, 2020
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.

The links table should also be emptied
2 participants