OLE Database Change Management

KOLE has one schema called OLE for all the financial, library and bibliographic and associated data. Details of baseline data sets and process for adding or updating different tables has been explained below;

A. The main db module can be located under ole-app/ole-db. This has database definition and data files for OLE tables.

The four different maven modules for OLEFS DB are as follows;

  1. ole-impex- This is the parent module with sub-modules that contains baseline OLEFS/LS/Rice datasets.
    1. ole-impex-master - This module has all the table definitions (schema.xml) along with data xml files for the base OLEFS/KFS datasets. This doesn't have any Rice related tables or data. For future KFS upgrades, any KFS table changes have to be updated here.
    2. ole-impex-rice - This module strictly contains the Rice table definitions (schema.xml) along with data xml files. The schema.xml that contains all the table definitions are modified for KFS needs, and so wont match with the schema.xml of the rice bootstrap dataset. Any future rice version upgrade changes will need to be accounted here (should come from KFS as KFS had modified rice tables)
    3. ole-impex-ls - This module contains all the table definitions (schema.xml) along with data.xml files for the base OLELS (Circulation and other library functions) datasets. 
    4. ole-impex-ds - This module contains all the table definitions (schema.xml) for the base OLEDS (Docstore related functions) datasets.
    5. ole-impex-test - This module contains definition for one single table (schema.xml). Essentially tests in OLE are run on a schema that contains this special table "EN_UNITTEST_T". This is to ensure production schemas are not affected. 
  2. ole-liquibase- This module allows injecting data easily by the use of liquibase tooling. Typically all the data files should go in the ole-impex module, but anything that is more demo specific and needs to be ingested for development purposes go here. This is also a way to load data incrementally or changeset. 
    1. ole-liquibase-changeset - This module has data files in .csv and divided into three categories; bootstrap, demo and institutional data sets. The bootstrap and demo data folders are populated with data thats get loaded during initial setup. Institution folder has empty template files that suggest files that will need to be populated with institution specific data.
  3. ole-sql - SQL Files under the various sub-modules are auto-generated by maven commands as explained in Impex, Bootstrap, Demo and Local Data (# 9). The various commands to produce sql statements for both MySQL and Oracle are explained below.

    The various SQL files are auto generated by the maven process on the ole-impex and ole-liquibase modules. Do not attempt to manually update the sql files as they will be overridden anytime the build process is run on the ole-impex and ole-liquibase modules.

    1. ole-liquibase-sql - These are auto-generated sql files from the ole-liquibase-changeset module.

      In order to generate the sql for liquibase change sets, run the following maven commands; The commands take care of generating sql for both MySQL and Oracle.

      cd ole-app/ole-db/ole-liquibase/ole-liquibase-changeset
      mvn clean install -Psql,mysql -Dimpex.scm.phase=none
      mvn clean install -Psql,oracle -Dimpex.scm.phase=none
    2. ole-ls-sql - These are auto generated sql files from the ole-impex-ls module which contains definitions and date for the circulation modules.
    3. ole-ds-sql - These are auto generated sql files from the ole-impex-ds module which contains definitions for the docstore module.
    4. ole-master-sql - These are auto-generated sql files from the ole-impex-master module.
    5. ole-rice-sql - These are auto generated sql files from the ole-impex-rice module.

    6. ole-test-sql - These are auto generated sql files from ole-impex-test module.
    7. ole-sql-controller - This module contains the logic that loads the necessary sql files into the database during the db-reset process. This should never be touched and as a matter of fact any folder/files under the ole-sql module shouldn't be touched.

B. DB reset

The DB reset involves dropping existing application schema, re-creating it, creating tables, adding data and finally adding all the necessary constraints.

 

cd ole-app
mvn clean install -DskipTests=true
 
cd olefs

# For MySQL
mvn initialize -Pdb -Djdbc.dba.username=[fill me in] -Djdbc.dba.password=[fill me in]

#For Oracle
mvn initialize -Pdb,oracle -Djdbc.username=OLE -Doracle.dba.url=jdbc:oracle:thin:system/manager@localhost:1521:XE

 

 

Operated as a Community Resource by the Open Library Foundation