You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
driver-sql: schema sync adds a new storage.notNull field to an existing table as NOT NULL with no default — on SQLite the whole object's sync fails and the object becomes unwritable #37258
Filing gate: ① · Source: fleet (found by the hotcrm lane on objectstack-ai/hotcrm#2746, PR objectstack-ai/hotcrm#2787)
Grade: area:data · Bug · p2 (an author adding a required-with-column-constraint field to an existing object loses writes to the whole object on upgrade; the hotcrm card avoided it by dropping storage.notNull, so nothing is blocked) · reach: measured on a dev boot, @objectstack 18.6.0, SQLite · evidence measured.
Reader: the domain:data seat.
Dedupe: searched "Cannot add a NOT NULL column" (1: #23847, closed, Turso remote face never emits NOT NULL — the opposite case), "schema sync add NOT NULL column existing table" (0), "tighten_not_null" (13, all closed, Turso/migrate-apply or ownership ceremony). None covers the local SQL add-column path.
HotCRM added crm_contract.name (Field.text, required: true). Booting it with storage: { notNull: true } against a database created before the field existed:
alter table crm_contract add column name text not null - Cannot add a NOT NULL column with default value NULL
The contract object's whole schema sync fails and contracts become unwritable — on SQLite this happens even with zero rows, because SQLite refuses ADD COLUMN … NOT NULL without a default.
Expected
As the storage.notNull describe promises ("a destructive migration gated by the schema-drift ceremony (backfill first)"): schema sync adds the new column nullable, reports tighten_not_null drift, and the tightening runs through the ceremony after a backfill. required keeps refusing nameless writes meanwhile.
Done when
Adding a storage.notNull field to an object with an existing table boots cleanly on SQLite (and Postgres), the column exists nullable, drift reports tighten_not_null for it, and the object stays writable. A test pins it.
Related: objectstack-ai/hotcrm#2746 (would declare storage.notNull on crm_contract.name once this lands and installs have run its backfill).
First touch 2026-11-25T08:34Z. Confirmed as filed: area:data · domain:data · Bug · p2 · pm:queue → seat 7 (data p2). The grade holds even though the hotcrm card worked around it: any author who adds a storage.notNull field to an existing object loses writes to that whole object on SQLite upgrade, measured on 18.6.0.
Claim: PM loop (seat-run dev)
Session: session_011y7As5bdhV5T4N9vpjmZzH
Account: os-alice
Branch: claude/issue-37258-add-column-notnull-nullable
Worktree: objectstack-issue-37258
Domain: domain:data
Seat: repo:objectstack#7
File surface: packages/drivers/driver-sql/src/** (add-column path in sql-driver-column-creation.ts / sql-driver-schema-sync.ts, schema-drift.ts reporting) and its tests, .changeset/** (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: default opus (no path-derived mandate), effort: high
Clause-②: no
Metadata-protocol: none
Responsibility: objectstack (driver-sql schema sync add-column path) | hotcrm#2746 / hotcrm#2787 | an author adding a storage.notNull field to an existing object
Thread-read: 7157220711
Premise: holds (measured by the filer on 18.6.0 SQLite; reproduce first)
Serial constraints cleared: no seat dev in flight (concurrency 1); PR #37268 armed.
Activity
objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
First touch 2026-11-25T08:34Z. Confirmed as filed: area:data · domain:data · Bug · p2 ·
pm:queue→ seat 7 (data p2). The grade holds even though the hotcrm card worked around it: any author who adds astorage.notNullfield to an existing object loses writes to that whole object on SQLite upgrade, measured on 18.6.0.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
Claim: PM loop (seat-run dev)
Session:
session_011y7As5bdhV5T4N9vpjmZzHAccount:
os-aliceBranch:
claude/issue-37258-add-column-notnull-nullableWorktree:
objectstack-issue-37258Domain:
domain:dataSeat:
repo:objectstack#7File surface:
packages/drivers/driver-sql/src/**(add-column path in sql-driver-column-creation.ts / sql-driver-schema-sync.ts, schema-drift.ts reporting) and its tests,.changeset/**(stop on breach; explain in the report)Container & model:
M,mode:subagent,model: default opus (no path-derived mandate),effort: highClause-②: no
Metadata-protocol: none
Responsibility:
objectstack (driver-sql schema sync add-column path) | hotcrm#2746 / hotcrm#2787 | an author adding a storage.notNull field to an existing objectThread-read: 7157220711
Premise: holds (measured by the filer on 18.6.0 SQLite; reproduce first)
Serial constraints cleared: no seat dev in flight (concurrency 1); PR #37268 armed.