Cms: [FR] Flush revisions CLI command/Utility

Created on 29 Aug 2019  路  5Comments  路  Source: craftcms/cms

It would useful to have a CLI command/Utility to flush revisions when maxRevisions is adjusted mid-project.

As an example, if you decide to set 'maxRevisions' => 10 on a project which didn't have a limit before, all revisions beyond the limit will only get flushed when the entry itself is resaved in the Control Panel.

enhancement system administration

Most helpful comment

Just added a utils/prune-revisions command for Craft 3.4.

All 5 comments

Wouldnt resave/ clear the revisions? Admittedly it's not purpose-built and so a little slower but it should work fine?

Hey @gtettelaar, no it doesn't. Revisions get flushed when a revision is created.

@olivierbon Doh! Didn't look at the code but just assumed this would happen during saving in ->getElements()->saveElement().

+1 on this tho, deleting entry revisions should be possible or have a dedicated command line exec.

Just added a utils/prune-revisions command for Craft 3.4.

Was this page helpful?
0 / 5 - 0 ratings