Date: 2024-03-19
Proposed
Right now, we have migration scripts in two different repositories: ris-backend-service
and ris-data-migration
. Although ris-backend-service
uses flyway to manage database changes, it doesn't have all the scripts needed to set up the database from scratch.
Also, the ris-data-migration
scripts contain comments that must not be made public due to copyright reasons.
This situation is causing several issues:
- It's confusing. (New) developers find it hard to set up their local development environment. Also it's often not intuitive where to put new migrations.
- Integration tests need to duplicate the migration scripts from
ris-data-migration
(seecreate_migration_scheme_and_extensions.sql
)
We will leverage the gradle multi-project setup of ris-data-migration
, add a new sub project and make a private library of the migration scripts. The ris-backend-service
will use this library.
All migration scripts will be in one place, making it easier for both projects to access the scripts needed to set up the database correctly.
Working with database migrations will involve more steps, like adding a script to ris-data-migration
, releasing a new library version, and updating ris-backend-service to use this new version.
Because ris-data-migration
is private, the local development environment as well as CI/CD will become more complex. However, we already solved the same issue for the neuris-juris-xml-export
and can probably use the same solution.