Repository navigation
Database and migrations
Home / Technical documentation / Developing CARLOS
A schema change can outlive the code change that introduced it. Begin by finding the existing table, its callers, and any province-specific behavior before creating a migration. Think through old records, new installs, and upgrades from an earlier release; each path needs to end in a usable database.
Look up the relevant model and DAO in the source tree, then inspect the matching schema migration. Structured chart data and uploaded documents are stored differently; a database change alone may not cover files or generated PDFs. Write down the records a clinic task reads and writes before adding a column or changing a query.
CARLOS uses Flyway migrations. Add a new migration following the numbering and province rules in database schema management. A migration already published in a release is checksum-frozen. Do not edit it; add a new migration for the correction. Test a fresh database and an upgrade from the previous supported state, including data already present. On a package installation, sudo carlos-ctl db-info and db-validate report schema state; db-migrate changes it and requires a backup.
SCREENSHOT NEEDED — DEV-DB: Capture an editor view of the release/2026.08 migration directories and one short migration header, with a synthetic
db-inforesult. Show common and province-specific paths without database credentials.
A failed migration needs investigation of the exact error and a recovery plan. db-repair changes migration history; it is not a general fix for data that did not migrate.
Test the migration with representative fictional data and inspect the result, not only the process exit code. Include a rollback or repair plan for a partially applied change. Reviewers should be able to see why the new field or index is needed and how older data will behave.
CARLOS documentation · Using CARLOS · Technical documentation
All topics · Get help · Improve this page
© 2026 CARLOS Contributors. Documentation licensed under CC BY-SA 4.0, except where otherwise noted.
Getting started and everyday reference
Office staff
Clinical staff and doctors
Clinic managers and administrators
Technical overview · Reference