Conversation
709b335 to
483fd2e
Compare
8fe59c0 to
8662416
Compare
|
|
@fxprunayre, I think for this pull request it should be relevant to create a |
Yes if it is decided to move forward on this, a dedicated new main branch would be needed. The main reason would be because of the past migrations steps that would be quite hard to migrate in liquibase changesets I think. Maybe you've other ideas about how to deal with that? For now, this PR is more a place to investigate if this is a good option or not and what are difficulties. So when to create the new main branch is more dependent on others "major" 4.4.x PRs and confirmation for funding for this one. |
|
As a comment: liquibase has been a part of our fork update strategy for a while now. It has been integral in, e.g.,
|
…looking for category (Category table is now empty on init).
…e is now empty on init)
…e is now empty on init) To run one test, we can use mvn integration-test -Pit -Dtest=None -DfailIfNoTests=false -DskipIntegrationTests=false -DskipTests=false -Dit.test=org.fao.geonet.kernel.datamanager.BaseMetadataCategoryTest
…ed when webapp is used. Liquibase CLI does not work with it.
…(for domain test), with minimal test data (ie. no extra languages) for core testing.
66007a4 to
3b327f8
Compare
* Centralize plugin config * Reduce log level
…which does not use proper type - Fixed in Page and TextFile entity by adding correct annotation.
NPE does not happen on github but this test is failing locally on mac and linux ``` cd core mvn integration-test -Pit -DfailIfNoTests=false -DskipIntegrationTests=false -DskipTests=false -Dtest=None -Dit.test=org.fao.geonet.kernel.XmlSerializerIntegrationTest ``` Adding a check to avoid the NPE.
mvn jetty:run -Dgeonetwork.system.site.name=CustomName can be use to customize setting when populating the database.
To use a custom schema, use env variable GEONETWORK_DB_CONNECTION_PROPERTIES. For example, for Postgres: GEONETWORK_DB_CONNECTION_PROPERTIES=currentSchema=test
…ame surname as before.
…tead of removed SQL files). A question is later, how do we load additional language specific data not in initial changeset?
|
| PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); | ||
| // Search for file ending with -initial-data-language-{langCode}.sql eg. 00012-initial-data-language-geo.sql | ||
| // TODO: Q: How to deal with future language data? | ||
| org.springframework.core.io.Resource[] resources = resolver.getResources("classpath*:db/changesets/*-initial-data-language-" + langCode + ".sql"); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low







Proposal
Liquibase is used to manage database schema creation and changes on a per-feature basis.
Main goals are:
-Dgeonetwork.settings.system.server.host=...)GeoNetwork 4.4 (and before) is using its own custom 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: Custom GeoNetwork system is used until version 4.4.x, then starting from version 4.6.x Liquibase only is used.
Proposal to be discussed and planned :
See https://github.com/geonetwork/core-geonetwork/tree/feature/liquibase/database for details
Actions:
changelog.xmlas main changelog fileinitial_data.xmlanddatabase_migration.xmldb.migration_onstartupproperty / Hibernatehbm2ddlproperty set tononeTestDatabasePopulator00023-initial-data-language-tur.sql)?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/
Funded by BRGM