Skip to content

fix(driver-sql): a column's literal DEFAULT follows the field's declaration on an existing table - #36564

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-a7tzee
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-a7tzee

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36245
Clause-②: no
Metadata-protocol: none

维护者速读

  • 字段删掉或改掉默认值后,老数据库的这一列也跟着改:开发环境重启、发布对象、制品启动、执行迁移命令时自动修好;生产环境普通启动只报出、不改。
  • 属于数据层的修复,也是给通知偏好「摘要」字段拆掉临时补丁铺路。
  • 修错了只影响以后不填该字段的新记录存什么,已有记录一行不改;改动可直接回退。
  • 要你做的一件事:定夺通知偏好那个临时补丁现在拆还是等生产启动也能自动改列再拆(见下方 Acceptance notes,席位会转决策)。

What changes

createColumn emits a field's literal defaultValue as the column DEFAULT once, when it builds the column; the additive sync never revisits an existing column, and the differ read defaultValue only for runtime tokens (#4560). So a table an earlier release created kept the old DEFAULT after the field dropped or changed it, and detectManagedDrift answered [].

  • schema-drift.ts: diffManagedTable gains a literal-default arm. A column carrying a literal DEFAULT under a field that declares none reports drop_column_default; a literal that differs from the declared one reports the new op set_column_default. Both safe, kind default_mismatch, message ending with the shared SAFE_COLUMN_REMEDY. Judged only where createColumn itself emits a literal: tokens, object defaults, multi-value columns and physical expressions (NOW() defaults, sequences) are never touched, and a temporal literal is never compared (the dialect renders it its own way). Two pure helpers say what a physical DEFAULT is (physicalDefaultLiteral) and when it already matches (physicalLiteralMatches); the spellings they read were measured on SQLite, Postgres 16 and MariaDB 10.11.
  • sql-driver-schema-sync.ts: applyDriftOpInPlace applies set_column_default with ALTER TABLE … ALTER COLUMN … SET DEFAULT on Postgres and MySQL (the MODIFY-free form, like drop_column_default), reading the declared literal at apply time and inlining it as the client escapes it; the SQLite rebuild honours it (it already re-emits every column's declared default).
  • driver-turso: REMOTE_DRIFT_OP_ANSWERS answers set_column_default as needs-table-rebuild, as it does drop_column_default.

Who applies the entries is unchanged: dev auto-reconcile, a publish of the object (applyPublishedColumnChanges, which takes every safe column entry), the artifact-pinned boot and os migrate apply. A plain production boot alters no existing column and logs the entry.

Tests

src/sql-driver-36245-stale-literal-default.test.ts, through declareDialectCell on every cell:

  • §1 (no server): 20 physical spellings read as literal / none / expression; 13 literal-vs-declared pairs.
  • §2 per dialect, two boots over one database: the removed default stores NULL on an unset insert after the second boot; the changed literal stores the new value; the kept default is stored and never reported; a row stored before keeps its value; with no auto-reconcile both entries are reported safe and applyMigrationEntries applies them.
Readings (head 3862c8b unless noted)
  • Premise on main d463c46, two SqlDriver boots over one database, digest dropping defaultValue: 'none' and changed going 'a' to 'b': SQLite file, Postgres 16, MariaDB 10.11, with and without autoMigrate: 'safe' — every cell stored digest: "none", changed: "a", and detectManagedDrift answered [].
  • Same probe on the fix: drift=[set_column_default changed, drop_column_default digest] without auto-reconcile; with it, digest: null, changed: "b", drift=[] on all three.
  • False-positive sweep on the fix: a table built by initObjects with 27 fields carrying string / quoted / empty / number / decimal / negative / boolean / select / text / date / time / datetime / NOW() / json / multi-value / current_user / URL-with-parentheses defaults reports no default entry on SQLite, Postgres or MariaDB.
  • New file, all three cells (OS_TEST_POSTGRES_URL, OS_TEST_MYSQL_URL set): 39/39 passed.
  • pnpm --filter @objectstack/driver-sql test (SQLite cells): Test Files 269 passed, 13 skipped; Tests 4539 passed, 262 skipped. With a live Postgres too: 4 failures, all the three-way timezone-skew guards (this local server runs in UTC; CI's is not), none in a default or drift suite.
  • pnpm --filter @objectstack/driver-sql typecheck, pnpm --filter @objectstack/driver-turso typecheck: exit 0. pnpm --filter @objectstack/driver-turso test: 103 files passed, 2647 tests passed.
  • Ablation 1, the drop arm disabled (if (dv === undefined || dv === null) → if (false as boolean)), committed fix first, on-disk mutation proven by scripts/ablation-replace.mjs (anchor 1 → 0, blob c1c48d28 → cb129bf6): 5 of the §2 cases red (expected 'none' to be null, the drift list missing digest), restored blob == HEAD.
  • Ablation 2, a kept literal read as different (return true → return false on the text compare; blob c1c48d28 → 36666e6a): 9 red, including the kept-default assertion detectManagedDrift(...) toEqual([]) on every cell; restored blob == HEAD.

Acceptance notes

  • The messaging: a member's own 'none' digest or empty quiet hours falls back to the organisation default #35123 stopgap hook is NOT removed in this PR, against the card's "remove that hook and its pin in the same PR", which also allows "a follow-up named here". Measured reason: the repair reaches a database through dev auto-reconcile, a publish, the artifact-pinned boot or os migrate apply; a plain production boot never alters an existing column (reconcileAndWarnDrift: "schema is never auto-altered in production"). sys_notification_preference is a service's own object, so no publish or package install applies it either. Removing the hook now would bring back, on every upgraded production database where nobody runs os migrate apply, the silent digest opt-out ruling 7073270426 rejected; the only new thing is that the boot now logs the entry. Upgraded production databases get this fix through os migrate apply, or through any of the drift-applying paths above (dev auto-reconcile, a publish, the artifact-pinned boot). The hook's removal, and repointing its comment, are carried by follow-up Remove the #35123 digest stopgap hook once column-default drift reaches upgraded production databases #36570 (Blocked-by this PR).
  • A hand-set literal DEFAULT on a column whose field declares none is now reported and, through the doors above, dropped — the card's ruling reverses the old "a hand-edited DEFAULT is a DBA's business" note on FieldDef.defaultValue, rewritten here.
  • Not covered, same family: a field that GAINS a defaultValue after its table exists (the column has no DEFAULT; restating one is outside the ruling's two verbs, and on MySQL a TEXT column cannot carry it); a NOW() default the field no longer declares (a physical expression, never touched); a temporal literal that changed (never compared). MySQL 8 reports a string literal bare; a bare all-capitals or multi-word value is read as an expression and left alone. MySQL 8 itself was not measured here (MariaDB 10.11 was); CI's live MySQL cell runs the new file.

Verification

Two minutes: OS_TEST_POSTGRES_URL=… pnpm --filter @objectstack/driver-sql exec vitest run src/sql-driver-36245-stale-literal-default.test.ts — expect 39 passed with both live URLs set, 35 on SQLite alone with the two live cells reported NOT RUN by name.

Read first: packages/drivers/driver-sql/src/schema-drift.ts (the literal-default arm in diffManagedTable and physicalDefaultLiteral, where a misread spelling would drop a DEFAULT nobody asked to drop), then setDeclaredColumnDefault in sql-driver-schema-sync.ts (the inlined literal).


Generated by Claude Code

…ration on an existing table

Schema drift now reports a literal column DEFAULT the field no longer
declares (drop_column_default) and one whose declared literal changed
(set_column_default), both safe: applied by dev auto-reconcile, a publish,
the artifact-pinned boot and os migrate apply, in place on Postgres and
MySQL and by the table rebuild on SQLite.

Claude-Session: https://claude.ai/code/session_01JQwxbY6wSVQZ9QBM4hLeYw
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/driver-sql, @objectstack/driver-turso, touching 20 documentable anchor(s).

9 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/drivers.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/data-modeling/index.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/data-modeling/queries.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/permissions/tenant-audit-census.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/kernel/index.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/kernel/lifecycle.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/objectql/query-syntax.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/objectql/types.mdx (via SqlDriver (symbol, a top-level class))

⛔ 5 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via DriftOp (symbol, a top-level type), SqlDriver (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/releases/v18/18-5.mdx (via SqlDriver (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: current_user (literal, 45 pages)
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 18 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ad50d611a168c035e468fc41b5a9e550c9d8e265 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c2d02f9dd16befb38edc51bf477a065cb66da646 — the merge of head 3862c8b173bc737a3ed2fe8a9926ed5400d2a885 into base ad50d611a168c035e468fc41b5a9e550c9d8e265, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c2d02f9dd16befb38edc51bf477a065cb66da646 && git checkout c2d02f9dd16befb38edc51bf477a065cb66da646
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ad50d611a168c035e468fc41b5a9e550c9d8e265 3862c8b173bc737a3ed2fe8a9926ed5400d2a885 && git checkout -B drift-repro ad50d611a168c035e468fc41b5a9e550c9d8e265 && git merge --no-ff 3862c8b173bc737a3ed2fe8a9926ed5400d2a885

node scripts/docs-audit/affected-docs.mjs --json ad50d611a168c035e468fc41b5a9e550c9d8e265

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ad50d611a168c035e468fc41b5a9e550c9d8e265 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

删掉或改掉字段默认值后,老库的列现在会跟着改:迁移计划里会出现「撤掉旧默认」或「改成新默认」两类安全项,三种数据库都实测修好,已有记录一行不动。
生产环境普通启动仍不自动改已有列,只打日志;跑 os migrate apply 或发布对象时生效。所以 #35123 的临时补丁先保留,拆除另立卡 #36570。
CI 全绿,464 行,非受管面,席位落地。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 3862c8b1 · 2026-11-22T23:58Z

  • Shape: Fixes #36245; packages/drivers/driver-sql/src/schema-drift.ts, sql-driver-schema-sync.ts, sql-driver.ts, packages/drivers/driver-turso/src/turso-driver.ts, one new test file, one changeset (driver-sql, driver-turso patch). +444/−20. Tier S (no governed path); no L2 face (Clause-②: no, no packages/spec/src/**, no narrowing).
  • Premise measured by the card thread on main d463c46f on SQLite, Postgres 16 and MariaDB 10.11: a removed or changed literal default left the old DEFAULT and the drift report was empty.
  • Read: the new arm in diffManagedTable acts only on a physical LITERAL (physicalDefaultLiteral): expressions (NOW(), sequences, unknown keywords) and multi-value columns are left alone; temporal literals are never compared (null = unjudgeable, not reported); it does not overlap the data: the SQL driver emits the current_user framework token as a literal column DEFAULT, so the database itself writes a non-id into a lookup('sys_user') #4560 token arm (that arm needs a declared token, this one a missing or non-token literal). set_column_default re-reads the declaration at apply time and skips (answers false) when it no longer carries a literal; the literal is inlined via the client's escaping. Both ops are safe and rewrite no stored row. One deliberate reversal, as the card's ruling orders: a hand-set literal DEFAULT on a field that declares none is now reported and dropped by the drift-applying paths (the old comment called it "a DBA's business").
  • Gates: 39 success · 18 skipped · 0 red on 3862c8b1; mergeable clean; landing-k K = 1. Temporal Conformance (live PG + MySQL) is skipped on PR runs, so the new file's live cells rest on the thread's local readings (PG 16, MariaDB 10.11), recorded in the PR body.
  • Accepted deviation: the messaging: a member's own 'none' digest or empty quiet hours falls back to the organisation default #35123 stopgap hook stays — the card allows "a follow-up named here"; filed Remove the #35123 digest stopgap hook once column-default drift reaches upgraded production databases #36570 (Blocked-by: #36564). The PR body names it.
  • Landing: ready + auto-merge now. Claim 7087194712's Branch: is claude/project-thread-a7tzee.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 23:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit b572420 Nov 23, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-a7tzee branch November 23, 2026 00:35
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… never leaves a NOT NULL column refusing writes (objectstack-ai#36600)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Jy8bxCRdEndf2kW8g6WXtd)_

Fixes objectstack-ai#36596
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 修复 main 变红:字段删掉默认值后,MySQL 8 上不填该字段的新记录会被数据库拒绝,现在改为存空值,和
Postgres、SQLite 一致。
- 对「不允许为空」的列,删默认值不再单独执行:字段允许为空时和「放开非空」一起执行;字段仍要求非空时原样保留,只报出。
- 已有记录一行不改;改动可直接回退。

## The cause (premise correction)

The card says the dropped DEFAULT "leaves the column NOT NULL". Measured
on MySQL 8.0.46, it does not: `digest` is `IS_NULLABLE = YES`
throughout. The cause is MySQL 8's `ALTER COLUMN … DROP DEFAULT`, which
leaves even a **nullable** column with no default at all, so a
strict-mode insert that omits it fails with ER 1364 "Field 'digest'
doesn't have a default value". `SET DEFAULT NULL` stores NULL. Round 1
(objectstack-ai#36564) was measured on MariaDB 10.11, which stores NULL after `DROP
DEFAULT`, and the live MySQL leg did not run on that PR.

```
mysql> CREATE TABLE p (id varchar(36) PRIMARY KEY, digest varchar(255) DEFAULT 'none');
mysql> ALTER TABLE p ALTER COLUMN digest DROP DEFAULT;
mysql> INSERT INTO p (id) VALUES ('a');
ERROR 1364 (HY000): Field 'digest' doesn't have a default value
mysql> ALTER TABLE p ALTER COLUMN digest SET DEFAULT NULL;
mysql> INSERT INTO p (id) VALUES ('a');   -- stores NULL
```

## What changes

`packages/drivers/driver-sql/**` only, plus this changeset.

- **MySQL `drop_column_default`** (`sql-driver-schema-sync.ts`): on a
nullable column it is now `ALTER COLUMN … SET DEFAULT NULL`; a NOT NULL
column keeps `DROP DEFAULT`. This also covers the objectstack-ai#4560 token arm, which
used the same statement.
- **A NOT NULL column with a stale literal DEFAULT**
(`schema-drift.ts`): the drop never travels alone, because an omitting
insert would then be refused.
- When the declaration does not hold the column NOT NULL (the differ
already proposes `relax_not_null`: `storage: { notNull: false }` in
words, or no storage declaration on a non-`required` field), the drop is
reported **with** that relax at the relax's category, `needs_confirm`.
`os migrate apply` applies both; the publish and the managed package
install (objectstack-ai#33724) apply both when the field says `storage: { notNull:
false }`. An unset insert then stores NULL. Dev auto-reconcile applies
neither (ADR-0113 D5), so the column keeps storing the old default and
is never left refusing writes.
- Otherwise (`storage: { notNull: true }`, a `required` field, the
ceremony-owned tenant column), the column is left alone. The entry is
`destructive`, so no automatic or non-destructive path applies it, and
it is warned at boot and listed by `os migrate plan`.
- `isPublishedColumnChange` / `isInstallRelaxation` select the paired
drop alongside the declared relax (`isDeclaredRelaxPair`).

## Tests

`sql-driver-36245-stale-literal-default.test.ts`: §1 and §2 unchanged
(not skipped, quarantined or narrowed); §2 now passes on live MySQL 8.
New §3, per dialect cell (SQLite, live PG, live MySQL), on a NOT NULL
column with `DEFAULT 'none'`:

1. No default, no storage declaration, not required: drift is
`drop_column_default` + `relax_not_null`, both `needs_confirm`; dev boot
leaves the column (unset insert stores `'none'`);
`applyMigrationEntries` applies both; unset insert stores NULL; no drift
after.
2. `storage: { notNull: false }`: `applyPublishedColumnChanges` applies
both; unset insert stores NULL.
3. `storage: { notNull: true }`: one `destructive` entry; boot, publish
and non-destructive apply leave the column NOT NULL with its default.
4. `required: true`, no storage: same as 3.

## Live PG + MySQL evidence (in-container, CI's own setup)

Servers: MySQL 8.0.46 (`STRICT_TRANS_TABLES`, `innodb_strict_mode=1`,
`SET GLOBAL time_zone='+08:00'`) and PostgreSQL 16 (`ALTER SYSTEM SET
timezone='Asia/Shanghai'`). Run exactly as the "Temporal Conformance
(live PG + MySQL)" step runs it: `TZ=America/New_York
OS_EXPECT_LIVE_DIALECT_MATRIX=1 OS_TEST_POSTGRES_URL=…
OS_TEST_MYSQL_URL=… pnpm --filter @objectstack/driver-sql test`.

**Before (origin/main 79d9c14), the red reproduced on live MySQL 8:**

```
 FAIL  sql-driver-36245-stale-literal-default.test.ts > … objectstack-ai#36245 §2 … (live mysql) > the second boot drops the removed default …
Error: insert into `os36245_pref` (`id`, `title`) values ('after', 'after') - Field 'digest' doesn't have a default value
 FAIL  sql-driver-36245-stale-literal-default.test.ts > … objectstack-ai#36245 §2 … (live mysql) > without auto-reconcile the divergence is reported `safe` …
Error: insert into `os36245_pref` (`id`, `title`) values ('repaired', 'repaired') - Field 'digest' doesn't have a default value
```

**After (head f972c24), the file, verbose:** 51 passed (51). Every §2
and §3 case passes on `sqlite`, `live postgres` and `live mysql` (18
two-boot cases, 6 per dialect); `driver-sql live-dialect coverage: all 3
dialects were exercised (sqlite, live postgres, live mysql)`.

**After, the whole driver-sql suite under the CI step's setup:**

```
 Test Files  1 failed | 280 passed | 1 skipped (282)
      Tests  1 failed | 7007 passed | 10 skipped (7018)
 FAIL  sql-driver-11565-row-byte-budget.test.ts > … row byte budget on live MySQL (objectstack-ai#11565) > reports InnoDB page-limit refusals with the page limit, not the row budget
```

The one failure is not this PR's: it fails identically at origin/main
79d9c14 against the same local server (same command, main's `src/`),
and passes on main's CI `mysql:8.0` image. The difference is this
container's Ubuntu MySQL build, not the code: the case expects the
server to refuse a new 40-column table, and this server accepts it. This
PR touches no create path.

**Ablations** (`scripts/ablation-replace.mjs`, each restored to HEAD,
run on all three cells):

| Mutation | Result |
|---|---|
| MySQL drop back to `DROP DEFAULT` on a nullable column | 4 fail: both
§2 MySQL cases (ER 1364, the main-red failure), and the two MySQL §3
cases that relax then drop |
| NOT NULL column drop emitted `safe` and unpaired, as on main | 9 fail
across all three dialects |
| Publish/install no longer select the paired drop | 3 fail: the
`storage: { notNull: false }` publish case on each dialect |
| Pair the drop even when the declaration holds NOT NULL | 6 fail: the
`notNull: true` and `required` cases on each dialect |

## Follow-ups (not in this PR)

- `content/docs/deployment/cli.mdx` (the publish paragraph under the
drift-category table) says the publish applies "every `safe` column
change, and a `relax_not_null` whose field declares `storage: { notNull:
false }`". It now also applies the paired `drop_column_default`. That
page is outside this card's file surface, so it is not edited here.
- On MySQL, `relax_not_null` runs `MODIFY … NULL`, which also drops a
column's declared literal DEFAULT (measured: `NOT NULL DEFAULT 'x'`
becomes `DEFAULT NULL`); the objectstack-ai#36245 `set_column_default` arm restates it
on the next sync. Pre-existing and unchanged here.
- The "Temporal Conformance (live PG + MySQL)" job is path-filtered and
skipped on PRs, which is how round 1 reached main. Making it run on a
`driver-sql` PR is a `.github/workflows/ci.yml` change: governed (Tier
H) and outside this card's file surface, so it is not made here.
Evidence from in-container live servers is pasted instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbY6wSVQZ9QBM4hLeYw

<!-- signed: repo:objectstack#1 · os-warren ·
session_01JQwxbY6wSVQZ9QBM4hLeYw -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants