fabro/lib/foundation/fabro-db/migrations
Bryan Helmkamp 4942788297
Drop the run_events table and narrow the runs row
Every run is a Petri run whose history is `petri_records` and
`platform_records`, so the legacy run event log has no reader left.
The new migration drops `run_events` (with its indexes), the two
one-time activation tables, and rebuilds `runs` without the columns
only that log wrote or read: `source_last_seq` and the six token and
file-count columns nothing read, as VIEWS.md records. Pre-cutover
development runs are discarded, as decided; the surviving columns of
existing rows are copied across.

fabro-db loses the three migration consts of the dropped schema and the
session-owner preflight that inspected `run_events`, and gains
`DROP_RUN_EVENTS_MIGRATION_SQL` so fixtures that install the runs
schema reach the production shape. The run summary upsert binds only
the surviving columns.

Tests: the `run_events` schema, query-plan and preflight tests are
deleted; `runs_schema_has_its_final_shape_without_the_legacy_event_log`
pins the final columns and indexes, and
`dropping_the_event_log_keeps_the_run_rows` migrates a database left by
an older binary and checks the run row survives.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 14:37:18 -04:00
..
2026063001_variables.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026063002_environments.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026071101_secrets.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026071102_mcp_servers.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026071103_automations.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026071104_runs.sql refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
2026072501_auth_sessions.sql Add SQLite-backed AuthSessionStore 2026-07-25 23:42:14 -04:00
2026081301_blobs.sql Add SQLite blob store foundation 2026-08-18 17:41:29 -04:00
2026082201_oauth_authorization_codes.sql Move pending CLI authorizations to SQLite 2026-08-24 17:25:19 -04:00
2026082601_automation_run_targets.sql Simplify automation run-target plumbing 2026-08-26 18:17:22 -04:00
2026082701_run_events.sql Add inactive SQL run storage foundation 2026-08-27 13:32:01 -04:00
2026082801_automation_environments.sql Require a server-managed environment for automations 2026-08-30 09:58:13 -04:00
2026082802_run_history_activation.sql Harden SQLite activation and run history consistency 2026-08-31 12:19:16 -04:00
2026082803_automation_workflow_sources.sql Align remote workflow selectors with run targets 2026-08-31 17:13:20 -04:00
2026083101_run_event_session_owner.sql Index session ownership from creation events 2026-08-31 14:16:58 -04:00
2026090901_environment_provider_kinds.sql Open sandbox provider identity to plugin kinds 2026-09-09 15:17:32 -06:00
2026091101_run_session_records.sql Run agent stages, Ask Fabro, and fabro exec on pebble's CodingAgent 2026-09-11 14:19:15 -06:00
2026091701_petri_records.sql Implement Petri's run store over Fabro's SQLite database 2026-09-17 19:30:30 -04:00
2026091801_petri_projection.sql Add platform records and the Petri projection tables 2026-09-17 21:46:21 -04:00
2026091802_run_session_events.sql Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
2026091803_drop_run_events.sql Drop the run_events table and narrow the runs row 2026-09-18 14:37:18 -04:00