...
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 nor are declarations of new indexes nor statements in the "import.sql" file. Changes in these resources will require explicit creation in a database that already is instantiated with data.
The . The default mode is "update" is it does not destroy data. This can be overridden by running with "-Dhibernate.hbm2ddl.auto=create"
...
- 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.
- Update mode will add new fields (which can be problematic if they are declared as nullable=false)
- Create mode will destroy the existnig database and remake it anew, including running statements in the "import.sql" file (in admin/mojo/src/main/resources)
Samples
Sample command line call of the admin tool to create a DB:
Code Block |
---|
% cd ~/code/admin/updatedb % mvn -Dhibernate.hbm2ddl.auto=createinstall -PUpdatedb -Drun.config=~/config/config.properties install-Dhibernate.hbm2ddl.auto=create |
Sample command line call of the admin tool to simply update an existing DB:
Code Block |
---|
% cd ~/code/admin/updatedb % mvn install -PUpdatedb -Drun.config=/home/ihtsdo/config/config.properties -PUpdatedbDhibernate.hbm2ddl.auto=update |
Sample Eclipse run configuration:
...