Configure database migrations with Alembic #2

Open
opened 2025-09-23 14:16:33 +00:00 by boris · 0 comments
Owner

As a developer, I need Alembic migrations so that the database schema is versioned and reproducible across environments

Acceptance Criteria (G/W/T)

  • Given a fresh Postgres instance, when I run alembic upgrade head, then the base tables are created: users, servers, ssh_keys, access_requests, audit_events.
  • Given CI, when the workflow runs, then Alembic applies migrations successfully using KEYWARDEN_POSTGRES_* env vars (with sensible defaults).
  • Given a code change to models, when I run alembic revision --autogenerate, then a migration file is produced showing only intended diffs.

Notes / Non-functional

  • Alembic does not import full app settings (no SECRET_KEY required).
  • Naming convention applied (stable constraint/index names).
As a developer, I need Alembic migrations so that the database schema is versioned and reproducible across environments Acceptance Criteria (G/W/T) - [x] Given a fresh Postgres instance, when I run alembic upgrade head, then the base tables are created: users, servers, ssh_keys, access_requests, audit_events. - [x] Given CI, when the workflow runs, then Alembic applies migrations successfully using KEYWARDEN_POSTGRES_* env vars (with sensible defaults). - [ ] Given a code change to models, when I run alembic revision --autogenerate, then a migration file is produced showing only intended diffs. Notes / Non-functional - [x] Alembic does not import full app settings (no SECRET_KEY required). - [x] Naming convention applied (stable constraint/index names).
boris added this to the Minimum Viable Product milestone 2025-09-23 14:16:33 +00:00
boris added the
Kind/Feature
Priority
High
2
labels 2025-09-23 14:16:33 +00:00
boris self-assigned this 2025-09-23 14:16:33 +00:00
boris added this to the Keywarden project 2025-09-23 14:16:33 +00:00
boris moved this to Review in Keywarden on 2025-09-23 14:16:35 +00:00
Sign in to join this conversation.
No description provided.