Skip to content

feat(v3-ref-seller): Alembic migration scaffold replacing Base.metadata.create_all #382

@bokelley

Description

@bokelley

Context

The v3 reference seller boots via Base.metadata.create_all. This is idempotent on table existence, but does NOT detect:

  • column renames
  • column type changes
  • new columns on existing tables
  • removed columns
  • index changes

Production adopters cloning this example need a real migration story. Without one, the example is misleading — adopters will copy create_all into prod and get burned the first time the schema evolves.

Refs:

  • examples/v3_reference_seller/src/app.py (boot path with create_all)
  • examples/v3_reference_seller/src/models.py

Acceptance Criteria

  • Minimal Alembic setup under examples/v3_reference_seller/alembic/ (env.py, alembic.ini, versions/)
  • One initial migration that matches the current schema exactly
  • Boot path runs alembic upgrade head (or refuses to start if migrations are out of date) instead of create_all
  • README documents the workflow: how to generate a new migration, how to apply, how to roll back
  • Integration test runs migrations against a clean database and asserts schema matches Base.metadata

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions