OLE DB Refresh Process & Changes

OLE has two different application schemas for OLEFS and OLEDOCSTORE respectively. All different schemas come with a baseline dataset that is required for the application's basic functionality. Details of individual application schemas, baseline data sets and process for adding or updating different tables in the respective schemas 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 that has 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. 
  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.
    1. ole-liquibase-changeset - This module contains the definitions for any updates that needs to be made to the base OLE schema that contains the base KFS/Rice tables/data. The updates could include creation of new tables, populating with some data etc..
  3. ole-sql - SQL Files under the various sub-modules are auto-generated by maven commands. 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.

      cd ole-app/ole-db/ole-liquibase/ole-liquibase-changeset
      mvn clean install -Psql,mysql -Dscm.phase=none
      mvn clean install -Psql,oracle -Dscm.phase=none
    2. ole-master-sql - These are auto-generated sql files from the ole-impex-master module.
    3. ole-rice-sql - These are auto generated sql files from the ole-impex-rice module.

      cd into ole-impex
      mvn clean install -Psql -Dimpex.scm.phase=none

B. The main db module for the Docstore application is under ole-docstore/ole-db. Refer to the db-reset process below to find out how to reset the docstore database and start clean.

 

C. DB reset

The DB reset involves dropping existing application schemas, re-creating them, 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

cd ole-docstore

# For MySQL
mvn initialize -Pdb -Djdbc.dba.username=[fill me] -Djdbc.dba.password=[fill me]
 
#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