Data UI Backlog

set-model with no reset-tables

Load a changed model without dropping tables

The gap: after a snapshot restore onto a live image — or any edit to a loaded model's file — there is no one-call way to load the changed model without losing data. heal-model re-runs the idempotent tail (create-tables, roles, resources) but only against the already-compiled model; it cannot pick up a new file. set-model compiles the file on disk but first runs reset-tables, dropping the loaded model's user tables. Today the only escape is restarting the process: a fresh image has *compiled-model* nil, so set-model skips the drop and heals.

Ask: one call that compiles a (possibly changed) model file and runs the heal tail, dropping nothing. Preferred shape is an optional file argument on heal-model — (heal-model "backlog") resolves, reads, and compiles exactly like set-model, then runs the existing tail. heal-model's contract is already "catch up, drop nothing"; a set-model keyword instead (:skip-reset t) would turn the stateless rule "restored data → heal, never set" into "safe iff you remembered the flag" — identical keystrokes, catastrophic difference when forgotten. The nil guard keys off process state and cannot be typoed.

Non-goal: not a migration engine. No ALTER synthesis, no column drops, renames, or index changes — create-missing only, like today's heal. In-place schema changes stay hand SQL (see docs/migration.md for the recipe); the full machinery is its own item ("Migrations when the model changes", slot 15500).

Context: surfaced by the backlog :plans M2M conversion — restoring dev-backlog and loading the edited model currently requires a fresh REPL.

Slot
17500
Status
10 Open
Tags
mvp, backend, mig
Contributors
Donnie, Rosie, Fable-5-2