#583: DB creation and migration configuration
-------------------------+--------------------------------------------------
Reporter: fxp | Owner: geonetwork-devel@…
Type: enhancement | Status: new
Priority: major | Milestone: v2.7.0
Component: General | Version:
Keywords: |
-------------------------+--------------------------------------------------
Right now db creation and migration are based on file and directory naming
conventions (eg. 2.6.0-to-2.7.0).
The improvement consists of:
* create a file config-db.xml which defines what are the SQL file needed
for each db tasks:
{{{
<tasks>
<create>
<file path="WEB-INF/classes/setup/sql/create" filePrefix="db-"/>
...
</create>
<data>
<file path="WEB-INF/classes/setup/sql/data" filePrefix="data-"/>
...
</data>
<migrate>
<file path="WEB-INF/classes/setup/sql/migrate" filePrefix="270"
version="270"/>
</migrate>
</tasks>
}}}
In this configuration file, we could:
* have a set of sql files to run for each task so we could for example:
* separate all language specific files (for easier maintenance - or load
only required files) :
{{{
<file path="WEB-INF/classes/setup/sql/create" filePrefix="data-"/>
<file path="WEB-INF/classes/setup/sql/create" filePrefix="loc-en-"/>
<file path="WEB-INF/classes/setup/sql/create" filePrefix="loc-fr-"/>
}}}
* separate all migrations scripts :
{{{
<sql path="WEB-INF/classes/setup/sql/migrate" filePrefix="263"
version="263"/>
<sql path="WEB-INF/classes/setup/sql/migrate" filePrefix="264"
version="264"/>
}}}
* order of file element will be important (run in tag order)
* keep the mechanism to use the db type to look for SQL files and if not
found use the "default"
For the migration, we could check the db version, webapp version, remove
the "." to convert "2.7.0" in 270 and then run all migration scripts
between db and webapp version so we will have only one migration script
per version instead of a combination of source-to-destination scripts
(which is hard to maintain).
This config-db.xml could be altered on startup by the config overrides
mechanism (see #513).
--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/583>
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/>
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.