Details
-
Type:
New Feature
-
Status: Closed (View Workflow)
-
Priority:
P3
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 30.0.0
-
Labels:
-
Template:customfield_11100 32969
-
Sprint:CP: sprint 87, CP: sprint 88
-
Development Team:Core: Platform
Description
Current situation:
schema.json entries (tables, etc.) should have a fromModuleVersion property that is set or updated whenever a change is made to that entry.
An entry cannot be removed, instead "tOps": "ADD" must be changed to "tOps": "DELETE".
This is error prone because it is a manual task.
Usability is bad because deleted entries have to stay in the schema.json forever.
Solution:
Drop fromModuleVersion and tOps.
Save schema.json in the database. We already have the rmb_internal table that currently stores rmb and module version: https://github.com/folio-org/raml-module-builder/blob/v29.2.2/domain-models-runtime/src/main/resources/templates/db_scripts/main.ftl#L15
On upgrade compare the old schema.json and the new schema.json and create, update and delete accordingly.
Migration - How to initialize database schema.json entry
Module developers can provide any number of old schema.json version files alongside the current schema.json, adding the Edelweiss version is suggested. For example mod-inventory-storage should add schema.json-18.2.3 alongside schema.json in src/main/resources/templates/db_scripts.
If the database does not contain a schema.json then RMB upgrade will search for the schema.json-fromVersion file and initialize the database with it. If schema.json-fromVersion file is not found the old existing code for upgrading is used.
After upgrading the new schema.json file is saved in the database.
TestRail: Results
Attachments
Issue Links
- is blocked by
-
RMB-590 persist schema.json in rmb_internal
-
- Closed
-
- relates to
-
RMB-164 Incorrect moduleVersion and rmbVersion in rmb_internal table
-
- Closed
-
-
RMB-632 Tenant upgrade fails on foreignKey targetPath
-
- Closed
-
-
FOLIO-2017 Who should review RAML Module Builder Upgrades?
-
- Closed
-
-
RMB-552 smart index recreation on module upgrade
-
- Closed
-