Add persistence, migrations, and rollback for dashboard models #4

Closed
opened 2026-06-18 16:12:03 +02:00 by vince · 0 comments
Owner

Parent: #1

Goal

Store dashboard models as durable, versioned product state with safe rollback, rather than as raw files edited in place.

Scope

  • Add SQLite-backed persistence for dashboard documents.
  • Use drizzle-orm and drizzle-kit for schema definition and migrations.
  • Store dashboard revisions/snapshots with timestamps and actor metadata.
  • Add a migration path for dashboard model versions.
  • Add read APIs for current dashboard, specific revision, and revision history.
  • Add transactional write helpers that validate before commit.
  • Add rollback support to restore a prior valid revision.
  • Add seed loading for the initial Dimension Lab dashboard model.

Acceptance criteria

  • The app can load the active dashboard from SQLite.
  • Drizzle migrations can create/update the database schema reproducibly.
  • Every model write records a revision.
  • Rollback restores a previous valid revision without manual database edits.
  • Failed validation prevents writes and leaves current state unchanged.
  • Tests cover create, update, invalid update, revision history, and rollback.
  • The schema leaves a practical path to Postgres later without designing for Postgres prematurely.

Out of scope

  • Agent-facing mutation tools.
  • Visual editor UI.
  • Live telemetry polling.
Parent: #1 ## Goal Store dashboard models as durable, versioned product state with safe rollback, rather than as raw files edited in place. ## Scope - Add SQLite-backed persistence for dashboard documents. - Use `drizzle-orm` and `drizzle-kit` for schema definition and migrations. - Store dashboard revisions/snapshots with timestamps and actor metadata. - Add a migration path for dashboard model versions. - Add read APIs for current dashboard, specific revision, and revision history. - Add transactional write helpers that validate before commit. - Add rollback support to restore a prior valid revision. - Add seed loading for the initial Dimension Lab dashboard model. ## Acceptance criteria - The app can load the active dashboard from SQLite. - Drizzle migrations can create/update the database schema reproducibly. - Every model write records a revision. - Rollback restores a previous valid revision without manual database edits. - Failed validation prevents writes and leaves current state unchanged. - Tests cover create, update, invalid update, revision history, and rollback. - The schema leaves a practical path to Postgres later without designing for Postgres prematurely. ## Out of scope - Agent-facing mutation tools. - Visual editor UI. - Live telemetry polling.
vince added the
backend
agent
labels 2026-06-18 16:12:03 +02:00
vince closed this issue 2026-06-18 18:18:03 +02:00
Sign in to join this conversation.
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: vince/dimensionlab-website#4
No description provided.