refactor(server): change alias column type in books & collections table
Targets: #1242 (closed)
Changes proposed
- Changes type of
alias
column fromint4
tovarchar(255)
books
book_component
tocs
collections
- Generate new
alias
for the existng data in the following ways:-
books
:old_alias
+book.version
-
book_component
:old_alias
+book_component.version_name
-
tocs
:old_alias
+toc.version_name
-
collections
:old_alias
-
- Programatically generate
nextval
for the following cases- book create
- book version create
- book component create
- book component version create
- toc create
- collection create
Testing
Book
Initial version
- id = 73fd2859-3905-4a83-9890-23d7c9ae4cab
- alias = 400000091.1
- version = 1
- parentId = null
- status = new-book
Second version
- id = 653f6a0e-2f7d-4591-9b52-be9dfe9c0377
- alias = 400000091.2
- version = 2
- parentId = 73fd2859-3905-4a83-9890-23d7c9ae4cab
- status = new-version
Third version
- id = a1077bee-3c04-4fef-b2d7-0161bce3f9e9
- alias = 400000091.3
- version = 3
- parentId = 73fd2859-3905-4a83-9890-23d7c9ae4cab
- status = new-version
Book Component
A new book component version is created from here: https://gitlab.coko.foundation/ncbi/ncbi/-/blob/331fb36f00700c076c752a822928dc3b22123fa7/ui/Pages/Bookmanager/BookComponentPage.js#L298
- The feature is available when
multiplePublishedVersions
setting is enable in the book setting, and - you are not already loading a new version, and
- you are on the latest version, and
- book component status is published