Automatically load archetypes on database migration

Description

Extend the toolbox database --update command to automatically load archetypes if they have changed since last being loaded.

For simplicity, archetypes will only be loaded if a checksum generated during build time is different to that stored when the database migration was last run. It will not take into account:

  • users manually changing archetypes

  • 3rd party archetypes being loaded using toolbox archetype --load

Neither of these operations will change the stored checksum.

The checksum will be generated by a new openvpms-archetype:checksum goal that will write a file META-INF/openvpms-archetypes.properties containing either:

  • checksum.default - the default checksum

  • checksum.override - overrides the default checksum. This can be used by sites that repackage archetypes to override the default checksum and therefore automatically load their archetypes as well.

It is an error to duplicate either property - migration will fail if checksum.default or checksum.override appear multiple times on the classpath.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Time tracking

18h logged

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created September 21, 2017 at 11:40 PM
Updated October 30, 2021 at 1:29 AM
Resolved January 24, 2021 at 11:06 AM
Who's Looking?