Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Database module using liquibase
Draft experiment/early proposal to identify edges cases
Main goals are:
Content of the draft README.md
Database initialization
Liquibase is used to manage database schema creation and changes and the configuration is made in
changelog.xml.When adding new entities or making changes to existing ones, please make sure
to update the database changelog accordingly by adding a new file in the
changesets directory.Numbering is important to keep track of the order of changes, so please follow the existing pattern when naming new changeset files.
When a feature is backported in various branches, the numbering ensure that the changesets are applied in the correct order.
eg.
maincan contain changesets 001 to 010, while4.2.xcontains changesets 001 to 006 and 009 which was backported.Liquibase track changes applied to the current database in the
DATABASECHANGELOGandDATABASECHANGELOGLOCKtables.Old database initialization and migration system proposal
GeoNetwork using its own mechanism based on Java and SQL to migrate from version to version.
This mechanism does not work well when backporting changes to previous versions and does not support all possible migration paths.
It is proposed the following strategy to move to Liquibase: Old GeoNetwork system is used until version 4.4.x, then starting from version 4.6.x Liquibase only is used.
This means:
This approach avoid to migrate all existing migration steps to Liquibase, which is hard to do because of:
Liquibase implementation status
Draft experiment to implement initial database creation and initial data loading using Liquibase.
changelog.xmlas main changelog fileinitial_data.xmlanddatabase_migration.xmldb.migration_onstartupproperty / Hibernatehbm2ddlproperty set tononeTestDatabasePopulatorGeoNetwork 5 and Liquibase
GeoNetwork 5 can depend on the GeoNetwork 4 database module to initialize the database using Liquibase.
To enable liquibase in GeoNetwork 5 by:
pom.xml:Example of a conditional changeset:
shared/gn-domain/pom.xml:application.yml:Then both GeoNetwork 4 and GeoNetwork 5 can use Liquibase to initialize the database schema and data.
Liquibase has a lock mechanism to avoid multiple instances to apply changes at the same time.
Questions
To be investigated:
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentationInspired by work done by @joachimnielandt in https://metadata.vlaanderen.be/
Looking for funding