feat(db): versioned migration system with auth tables #26

Merged
addison merged 12 commits from exe-dev-bot/kiosk:feat/database-migrations into main 2026-02-21 06:03:54 -05:00
Contributor

Versioned migration system replacing inline CREATE TABLE IF NOT EXISTS. Adds v0 (baseline feed/setting) and v1 (user, user_permission, api_key, otp_code, audit_log, auth_failure). Enables foreign keys. Installs agent skills (design-discussion, reflect, shelley-handoff). Marks spec 002 as in-progress (11/130).

Versioned migration system replacing inline `CREATE TABLE IF NOT EXISTS`. Adds v0 (baseline feed/setting) and v1 (user, user_permission, api_key, otp_code, audit_log, auth_failure). Enables foreign keys. Installs agent skills (design-discussion, reflect, shelley-handoff). Marks spec 002 as in-progress (11/130).
Implement schema_version table tracking and sequential migration
execution. Each migration runs in its own transaction with automatic
rollback on failure.

v0: baseline schema (feed, setting tables)
v1: auth tables (user, user_permission, api_key, otp_code,
    audit_log, auth_failure)
Co-authored-by: Shelley <shelley@exe.dev>
Remove the const schema and CREATE TABLE IF NOT EXISTS calls.
InitDB now enables foreign keys and delegates schema creation
to RunMigrations.

Co-authored-by: Shelley <shelley@exe.dev>
Cover three scenarios: migrations run sequentially on a fresh
database, migrations skip already-applied versions, and a failed
migration rolls back its transaction while preserving prior
committed migrations.

Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kwila/kiosk!26
No description provided.