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

Compare with Current View Page History

« Previous Version 28 Next »

Overview

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

This admin tool is used to create the schema (for a new installation) or update it (for a deployment of updated model objects).

Prerequisites

  • MySQL database must already exist (e.g. "mappingservicedb").
  • MySQL database connection parameters must be defined in the properties file specified by "run.config".

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.  The default mode is "update" is it does not destroy data. This can be overridden by running with "-Dhibernate.hbm2ddl.auto=create"

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

  • A profile of "Updatedb" must be specified
  • run.config - the standard configuration file specified as a -D parameter
  • hibernate.hbm2ddl.auto - defaulted to "update" can be used with "create" for an initial creation.

Samples

Sample command line call of the admin tool to create a DB:

% cd ~/code/admin/updatedb
% mvn -Dhibernate.hbm2ddl.auto=create -PUpdatedb -Drun.config=~/config/config.properties install

Sample command line call of the admin tool to simply update an existing:

% cd ~/code/admin/updatedb
% mvn install -Drun.config=/home/ihtsdo/config/config.properties -PUpdatedb

 

Sample Eclipse run configuration:

  • n/a

 

 

  • No labels