2 title = "Prune Revisions Command"
3 author = "@ssddanbrown"
4 date = 2024-05-23T13:00:00Z
5 updated = 2024-05-23T13:00:00Z
9 This hack registers a custom command using the logical theme system, which will prune the revisions of a specific page
10 to just those with a changelog provided (in addition to the current revision), before resetting the revision numbers
11 across the remaining versions to be sequential without gaps. This will also reset the overall revision count on the page.
13 Once added, the command can be called like so from your BookStack install directory:
17 php artisan bookstack:prune-revisions {book-slug} {page-slug}
20 php artisan bookstack:prune-revisions team-notes code-snippets
25 - The changes here will not be reflected in activity/audit logs, and existing related activity/audit logs will not be modified.
26 - This can delete data with no option to restore without resorting to backups.
27 - This could affect other features or processes that may potentially reference specific page revisions or numbers.
31 {{<hack file="functions.php" type="logical">}}