← ClaudeAtlas

db-migrationslisted

Adding a column, table or migration to the ClankerMux SQLite database. Read this before editing packages/database/src/migrations.ts or adding any schema change — there is a two-step requirement whose omission fails silently on every existing live database.
d4rken/clankermux · ★ 7 · API & Backend · score 78
Install: claude install-skill d4rken/clankermux
# Database migrations (SQLite only) SQLite is the only backend — there is **no PostgreSQL support** and no `migrations-pg.ts`. Fresh installs get the **complete** schema from `ensureSchema()` in `packages/database/src/migrations.ts`. Existing live DBs are brought forward by `runMigrations()`, which applies only the columns added since they were created. ## The supported floor `runMigrations()` can only carry a DB forward from the oldest schema we declare support for. That floor is the schema a fresh install produced from the newest `migrations.ts` available when the repository went public on 2026-05-13 — commit `0e4ad752`. Anything older (a private pre-public ClankerMux DB, or an upstream better-ccflare / ccflare one) is deliberately unsupported. The floor is not a claim, it is a fixture: `packages/database/src/__tests__/schema-floor.fixture.ts` holds the floor DDL, the first-shipped column set of every table created since, and the list of deliberately retired columns and tables. It is **frozen historical data** — measured by executing the floor commit's own `ensureSchema()`/`runMigrations()`, never regenerated from the current schema. Refreshing it from HEAD would make the floor tests assert that the current schema equals itself. Legitimate edits to it: a baseline for a table you just added, a `RETIRED_AFTER_FLOOR` entry for something you deliberately dropped, and (only by explicit decision) re-measuring `FLOOR_SCHEMA_SQL` to raise the floor. ## Order: ALTERs first, t