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

Option to limit number of saved entry versions/revisions #926

Closed
angrybrad opened this issue Jan 31, 2017 · 6 comments

Comments

@angrybrad
Copy link
Member

commented Jan 31, 2017

Created by: Matt Jones (matt@boxhead.io) on 2015/11/11 13:01:18 +0000
Votes at time of UserVoice import: 10


When entry revisions are turn on for a section there is currently no method to cap/limit the number of revisions saved in the database so the entry versions table continues to grow indefinitely and therefore the database size also.

If there could be either a field in the section settings page to enter a number, or a general config setting to do the same that would be really useful.

@aaronbushnell

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2019

Not sure if this is something on the docket for Craft 3.x but it would really help a handful of sites we have. One of our sites has ~900 MB in the entryversions table and it'd be nice to have some kind of garbage collection/limiting to shrink this down.

I know about @carlcs's awesome plugin to clear this out, but it'd be nice to selectively purge this area and handle it in a first-party way.

brandonkelly added a commit that referenced this issue May 17, 2019
Resolves #1021
Resolves #1034
Resolves #1135
Resolves #1231
Resolves #1489
Resolves #1787
Resolves #2120
Resolves #2325
Resolves #2669
Resolves #2909
Resolves #3349
Resolves #3392
Resolves #926
@aaronbushnell

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

You all are awesome! Can't wait for 3.2! 💪

@brandonkelly

This comment has been minimized.

Copy link
Member

commented May 18, 2019

Only took us 3.5 years :)

@aaronbushnell

This comment has been minimized.

Copy link
Contributor

commented May 18, 2019

Screen Shot 2019-05-18 at 10 48 28 AM

@brandonkelly brandonkelly added this to the 3.2 milestone May 18, 2019
@Jones-S

This comment has been minimized.

Copy link

commented Aug 28, 2019

I am not super comfortable with reading the yii classes.
How would I set this new setting?

Like this?

config/general.php

return [
    '*' => [
        'maxRevisions' => 5
    ]
]

Because I had a post where I already had 12 drafts and I expected them to be cut down to 5.
Didn't happen though.

Or will it only happen for new drafts?

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Aug 28, 2019

@Jones-S Craft only enforces the setting when a new revision is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.