You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

This page documents the use of admin tools to create or update a DB schema.

 

Used to create or update the schema to accommodate new builds/installations or updating of schema.

Notes:

  • For this mojo to run, the database must already be created (e.g. Create database mappingservicedb; )
  • Connection parameters for the database must be set in a local java properties config file.
  • When running, pass a run.config parameter whose value is the path to the java properties config file.

  • Note, the default behavior is to run with the hibernate.hbm2ddl.auto setting set to "update".  
    • This can be overridden by running with a -Dhibernate.hbm2ddl.auto=create setting.

 

Details

This tool is used to create an initial DB schema, or update the schema upon code changes to add or change existing fields.  NOTE: fields that get removed are not handled by this process.  Following are some details about the implementation of this tool

 

Mojo: UpdateDbMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)

Project: admin/updatedb

Configuration Parameters

  • run.config - the standard configuration file
  • hibernate.hbm2ddl.auto - defaulted to "update" can be used with "create" for an initial creation.

 

Sample Call

 

% cd admin/updatedb
% mvn [-Dhibernate.hbm2ddl.auto=create] -Drun.config=/home/ihtsdo/data/config.properties clean install

  • No labels