Skip to content

[FEAT] [MVP] establish and implement the database migration workflow #6

Description

@nicky-mezzina-lhc

Motivation

Database schema migrations earn their place in the beginning of development: build the discipline now, set up the tooling, make schema changes repeatable and transparent.

When we stop wiping and squashing schema migrations, everything should be ready, and documented.

Proposed Solution

Stack decisions pointed to Alembic for migrations. Use CI for builds and checks, and Make targets for commands.

Alternatives Considered

Alembic was pulled in by the SQLAlchemy stack decision.

Acceptance Criteria

  • CI builds the schema from empty: upgrade head succeeds
  • CI runs the round trip: downgrade base, then upgrade head
  • CI fails when the models and head disagree
  • Make targets cover the everyday migration commands
  • Documentation covers what needs a revision, how to review a generated one, what autogenerate misses (enum types on downgrade), and the wipe rules above

Additional Context

Feel free to add any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions