Every change to MARLO’s database schema — whether it is a new table, a new column, or a modified constraint — ships as a versioned SQL migration file. MARLO uses Flyway to manage these migrations. Flyway applies them automatically in version order each time the application starts, ensuring that every environment (development, test, staging, production) goes through the same schema evolution steps. This page covers what Flyway does, how migrations are named and organized, and what administrators need to know when schema changes are deployed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CCAFS/MARLO/llms.txt
Use this file to discover all available pages before exploring further.
What Flyway does
Flyway maintains aflyway_schema_history table in the MARLO database. Every time the application starts, Flyway:
- Reads all migration files from the configured migrations directory.
- Compares their version numbers against the
flyway_schema_historytable. - Applies any migrations with version numbers higher than the last applied migration, in ascending version order.
- Records each applied migration in
flyway_schema_historywith its checksum, execution time, and success status.
flyway_schema_history and the application start is aborted. The database is left in the state it was in after the last successful migration.
Because Flyway runs at Tomcat startup, there is no separate step to run migrations in MARLO. Deploying a new version of the application automatically applies any new migrations.
Migration naming convention
All migration files follow a strict naming format:V<major>_<minor>_<patch>_<YYYYMMDD>_<HHMM>) determines the order in which Flyway applies migrations. Flyway sorts by this segment lexicographically, so the date and time portion (YYYYMMDD_HHMM) ensures correct ordering when multiple migrations share the same major/minor/patch version.
The <Description> segment after the double underscore (__) is for human readability only. It does not affect execution order or uniqueness.
The naming convention is a constitutional rule in MARLO. All schema changes must follow this format — no exceptions. Migrations that do not follow the pattern will either be ignored by Flyway or cause startup failures.
Where migrations live
All migration files are stored in:What administrators need to know
Migrations apply automatically on startup
You do not need to run migrations manually. When a new version of MARLO is deployed to Tomcat, Flyway applies any pending migrations before the application begins serving requests. If the migrations take a long time (for example, a migration that backfills data into a large table), Tomcat’s startup may appear slow — this is expected.Check migration status in the database
To see which migrations have been applied and whether any have failed, query theflyway_schema_history table:
success value of 1 means the migration was applied cleanly. A value of 0 means it failed. A failed migration will prevent the application from starting until it is either repaired or manually resolved.
Never edit applied migrations
Once a migration has been applied to any environment, treat it as immutable. If a migration contains an error:- Do not edit the existing file.
- Create a new migration file with a higher version number that corrects the issue.
Coordinate schema changes across environments
MARLO runs on three environments: Test (CIAT Palmira), Staging, and Production (AWS). A migration applied in Test must also be applied in Staging and Production when the containing release is promoted. Because migrations run automatically on startup, this happens as part of the normal deployment pipeline — but it means you should not deploy a new application version to Production until the migration has been validated in Test and Staging.Requesting schema changes
If your program needs a schema change — for example, a new specificity, a new configuration parameter, or a new data field — submit a request toMarlosupport@cgiar.org. Include:
- A description of what you need and why.
- Which program(s) are affected.
- Whether the change needs to be applied before or after a specific phase opens.