Skip to content
Myr

0005_standing_postures.sql

This file

Path

apps/platform/migrations/0005_standing_postures.sql

16 lines · 713 bytes · SQL

Last changed by

Merge build/1213-platform-performance-and-agent-surfacesoscabrielbefore adoption1d75a0d

History of this file

Take it

1-- Each listed project's standing posture, as a list last read it from the2-- project's own record, kept by packages/project/src/projection-d1 (its3-- tables.ts holds this text). A cache: a row lost costs one read. The4-- projection deletes a project's row in the same write as any event that5-- can move its posture, and a list writes a row only while the projection6-- has applied no event of the project later than the one the read saw.78CREATE TABLE standing_postures (9  project TEXT PRIMARY KEY,10  posture TEXT NOT NULL,11  -- when the posture moves by the clock alone (ISO 8601), absent when only12  -- an event moves it13  moves_at TEXT,14  -- the project's last event the read saw15  seen INTEGER NOT NULL16);