Skip to content

refactor(server): change alias column type in books & collections table

Pokhi requested to merge refactor/1242/bcms-structure into book-version-feature

Targets: #1242 (closed)

Changes proposed

  1. Changes type of alias column from int4 to varchar(255)
    1. books
    2. book_component
    3. tocs
    4. collections
  2. Generate new alias for the existng data in the following ways:
    1. books: old_alias + book.version
    2. book_component: old_alias + book_component.version_name
    3. tocs: old_alias + toc.version_name
    4. collections: old_alias
  3. Programatically generate nextval for the following cases
    1. book create
    2. book version create
    3. book component create
    4. book component version create
    5. toc create
    6. 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

  1. The feature is available when multiplePublishedVersions setting is enable in the book setting, and
  2. you are not already loading a new version, and
  3. you are on the latest version, and
  4. book component status is published
Edited by Pokhi

Merge request reports