Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

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

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

angrybrad opened this issue Jan 31, 2017 · 6 comments
Labels
enhancement improvements to existing features system administration 💼 features related to system administration

Comments

@angrybrad
Copy link
Member

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.

@brandonkelly brandonkelly added enhancement improvements to existing features and removed enhancement improvements to existing features feature labels Mar 5, 2019
@aaronbushnell
Copy link
Contributor

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 brandonkelly added the system administration 💼 features related to system administration label May 17, 2019
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
Copy link
Contributor

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

@brandonkelly
Copy link
Member

Only took us 3.5 years :)

@aaronbushnell
Copy link
Contributor

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

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

Jones-S 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
Copy link
Member

brandonkelly commented Aug 28, 2019

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement improvements to existing features system administration 💼 features related to system administration
Projects
None yet
Development

No branches or pull requests

4 participants