Skip to main content

Local Database Schema

Source: lib/local-db.ts (14.8KB) The local database defines the V12 Instance-Dependent schema — two core tables with zero foreign key constraints and a Nuke and Pave migration strategy.

Schema Version: 12


Table: local_tasks

The master task entity table. Mirrors the Convex tasks collection with JSON columns for complex nested structures:

Table: task_instances

Individual commitment occurrences. Orphan-safe with zero FK constraints:

Nuke and Pave Migration

There are no incremental migrations. The migration function checks PRAGMA user_version against DATABASE_VERSION:
VACUUM eliminates ghost WAL boundaries from the old schema, preventing the Kotlin Accessibility Service from reading stale page headers.

Three Recovery Tiers