HI there,

Is there anyway I can call delete-all from command line or drush? I'm thinking about using such feature to automatically wipe out all data to have a vanilla site for QA purpose.

Thanks for any helps in advance.
--halhx

Comments

kbahey’s picture

Category: support » feature

Not at present, but it is a nice feature to have.

Anyone with patches, please submit them for review and testing.

okokokok’s picture

StatusFileSize
new441 bytes

I uploaded some drush code to do this.

It's not yet working, even though it's actually executing node_delete($data->nid) in _delete_all_normal()

okokokok’s picture

Assigned: Unassigned » okokokok
Status: Active » Needs review

I figured that it was a permission problem, and adding -u admin did the trick.

e.g. drush -u admin delete-all page

okokokok’s picture

StatusFileSize
new587 bytes

Now drush delete-all will give an overview of content types and number of nodes, also removed some references to OpenID Admin (where I took the drush.inc from).

kbahey’s picture

Status: Needs review » Fixed

Thank you.

This is now committed, and should be in the tarball in about 11 hours from now.

okokokok’s picture

Status: Fixed » Needs work

Cool. You took the first file I uploaded though.
delete_all.drush-2.inc_.gz is significantly better.

kbahey’s picture

Status: Needs work » Fixed
okokokok’s picture

I added drush_drupal_login(1); so that stuff is actually deleted all the time.
But I'm waiting with a patch until I have a y/n confirmation thing added as well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.