Skip to content

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

Merged
schlessera merged 3 commits into
masterfrom
empty-links-table
Apr 8, 2020
Merged

schlessera merged 3 commits into
masterfrom
empty-links-table

Conversation

@thrijith

@thrijith thrijith commented Mar 7, 2020

Copy link
Copy Markdown
Member

Fixes #261

@thrijith thrijith added the command:site-empty Related to 'site empty' command label Mar 7, 2020
@thrijith
thrijith requested a review from a team as a code owner March 7, 2020 15:05
@thrijith

thrijith commented Mar 7, 2020

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
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.

Comment thread src/Site_Command.php Resolved
Comment thread src/Site_Command.php Resolved
Add tests to validate data truncate of wp_links table
@thrijith

thrijith commented Mar 24, 2020 •

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
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 April 8, 2020 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:site-empty Related to 'site empty' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The links table should also be emptied

2 participants