Set a revision number manually #4401

Closed
opened 2026-02-05 08:48:34 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @ymarkus on GitHub (Jan 15, 2024).

Describe the feature you'd like

I would like to be able to set a revision number manually. It would be enough (in my eyes) to be able to do it if there is only one revision existing.

Describe the benefits this would bring to existing BookStack users

We are porting our old quality management documents to BookStack and need to keep old revision numbers (ongoing). It would then be possible to port the document and then change the revision number to the one we need.

Can the goal of this request already be achieved via other means?

I can do it by running these SQL commands after ensuring there is only one revision left:

UPDATE pages SET revision_count = 7 WHERE id = 28;
UPDATE page_revisions SET revision_number = 7 WHERE page_id = 28;

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

1 to 5 years

Additional context

No response

Originally created by @ymarkus on GitHub (Jan 15, 2024). ### Describe the feature you'd like I would like to be able to set a revision number manually. It would be enough (in my eyes) to be able to do it if there is only one revision existing. ### Describe the benefits this would bring to existing BookStack users We are porting our old quality management documents to BookStack and need to keep old revision numbers (ongoing). It would then be possible to port the document and then change the revision number to the one we need. ### Can the goal of this request already be achieved via other means? I can do it by running these SQL commands after ensuring there is only one revision left: ``` UPDATE pages SET revision_count = 7 WHERE id = 28; UPDATE page_revisions SET revision_number = 7 WHERE page_id = 28; ``` ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 1 to 5 years ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:48:34 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 15, 2024):

Thanks for the request @ymarkus.
This is somewhat similar to #4235. My thoughts on this would be much the same, in that I'm not too keen on adding complexity to effectively support edge cases that are process-based and limited in audience and time.

Is your porting process long running in this case?
I'm just wondering what stops you from keeping a reference of new page Id and revision number, then updating all in one go via the database as you mention.

@ssddanbrown commented on GitHub (Jan 15, 2024): Thanks for the request @ymarkus. This is somewhat similar to #4235. My thoughts on this would be much the same, in that I'm not too keen on adding complexity to effectively support edge cases that are process-based and limited in audience and time. Is your porting process long running in this case? I'm just wondering what stops you from keeping a reference of new page Id and revision number, then updating all in one go via the database as you mention.
Author
Owner

@ymarkus commented on GitHub (Jan 15, 2024):

Thanks for the quick feedback!
Yes, I agree it is a bit of a edge case and, for me personally, I am fine doing it this way. I just wanted to open a FR, because this is a function that is (at least I think) needed for more corporate use-cases of BookStack and could be implemented by just adding a "set revision number" next to these buttons:
2024-01-15T15-04-25

@ymarkus commented on GitHub (Jan 15, 2024): Thanks for the quick feedback! Yes, I agree it is a bit of a edge case and, for me personally, I am fine doing it this way. I just wanted to open a FR, because this is a function that is (at least I think) needed for more corporate use-cases of BookStack and could be implemented by just adding a "set revision number" next to these buttons: ![2024-01-15T15-04-25](https://github.com/BookStackApp/BookStack/assets/62380378/64b8a5b8-edc6-4fd2-a267-7d05ba04c280)
Author
Owner

@ssddanbrown commented on GitHub (Jan 15, 2024):

could be implemented by just adding a "set revision number" next to these buttons:

Sure, but then that's extra UI controls, extra text for folks to translate, it'd probably need some kind of option/control since some admins may not want to provide that option, potentially a new activity to reflect this kind of action since it's altering the record, plus extra testing.

All possible but just don't think it's worthwhile, especially if focused just on a limited time of a limited subset of corporate use-cases.

@ssddanbrown commented on GitHub (Jan 15, 2024): > could be implemented by just adding a "set revision number" next to these buttons: Sure, but then that's extra UI controls, extra text for folks to translate, it'd probably need some kind of option/control since some admins may not want to provide that option, potentially a new activity to reflect this kind of action since it's altering the record, plus extra testing. All possible but just don't think it's worthwhile, especially if focused just on a limited time of a limited subset of corporate use-cases.
Author
Owner

@ymarkus commented on GitHub (Jan 16, 2024):

Yeah I understand. Would you be interested in a PR? Then maybe I'll have a look when I have time. Otherwise we can close this issue.
For anyone coming here for an answer, here's how to do it (in this example we're setting the revision number of "YOURPAGENAME" to 7:

DISCLAIMER: if you are running this, be sure what you are doing! This might lead to data loss if not done properly!!!

  1. Delete all older revisions so there is only the current revision left (should be done for cleanness, it might have unintended consequences else)
  2. Connect to your db: mysql bookstack (or similar)
  3. Find out your page id:
MariaDB [bookstack]> SELECT id,name FROM pages WHERE name LIKE 'YOURPAGENAME'';
+----+------------------------+
| id | name                   |
+----+------------------------+
| 28 | YOURPAGENAME           |
+----+------------------------+
1 row in set (0,000 sec)
  1. Use that page id (here 28) in these commands:
UPDATE pages SET revision_count = 7 WHERE id = 28;
UPDATE page_revisions SET revision_number = 7 WHERE page_id = 28;
@ymarkus commented on GitHub (Jan 16, 2024): Yeah I understand. Would you be interested in a PR? Then maybe I'll have a look when I have time. Otherwise we can close this issue. For anyone coming here for an answer, here's how to do it (in this example we're setting the revision number of "YOURPAGENAME" to 7: ### DISCLAIMER: if you are running this, be sure what you are doing! This might lead to data loss if not done properly!!! 1. Delete all older revisions so there is only the current revision left (should be done for cleanness, it might have unintended consequences else) 2. Connect to your db: `mysql bookstack` (or similar) 3. Find out your page id: ``` MariaDB [bookstack]> SELECT id,name FROM pages WHERE name LIKE 'YOURPAGENAME''; +----+------------------------+ | id | name | +----+------------------------+ | 28 | YOURPAGENAME | +----+------------------------+ 1 row in set (0,000 sec) ``` 4. Use that page id (here 28) in these commands: ``` UPDATE pages SET revision_count = 7 WHERE id = 28; UPDATE page_revisions SET revision_number = 7 WHERE page_id = 28; ```
Author
Owner

@ssddanbrown commented on GitHub (Jan 16, 2024):

Would you be interested in a PR? Then maybe I'll have a look when I have time. Otherwise we can close this issue.

Thanks for the offer, but no. Implementation effort is not my concern.
I'll therefore close this off.

@ssddanbrown commented on GitHub (Jan 16, 2024): > Would you be interested in a PR? Then maybe I'll have a look when I have time. Otherwise we can close this issue. Thanks for the offer, but no. Implementation effort is not my concern. I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4401