Two things need to be documented in relation to database migrations for v3.0:

  1. Moving from development to production-ready paradigm for database changes for each Service
  2. How to add database changes to a Service once the production-ready paradigm is in place

Moving to Production-ready Paradigm for Database Changes

Each Service is currently using Hibernate to auto-generate the DDL (schema) based on Hibernate annotations in the Java code and Spring Boot configuration properties (application.properties). This is convenient for developers when coding, since the schema is likely to be changed. However, this does not make sense in a production environment. Following are steps to move a Service to the new paradigm:

Additionally, for your Distribution (or the Reference Distribution, blue) to load demo (and starter) data:

Adding Database Changes in the Production-ready Paradigm

Once your Service is using Flyway for database changes, to add a change to the database:

Better Solution for Starter and Demo Data

A better way to load starter and demo data would be to create another Docker container that simply contains Flyway, where the "migrations" would be starter and demo data for each service. It makes more sense, because this data should not reside in each Service's image, but in something like the Reference Distribution. However, this would require a good amount of work to refactor out the demo and starter data from each Service into this new Flyway image/container. But it should be considered for future releases.