The column was `integer DEFAULT 0` (nullable) since the initial schema. Counters should not be nullable — the semantics are a count, not an optional measurement. `consecutive_auth_failures` (added later) was correctly declared NOT NULL; tightening `consecutive_failures` to match removes the drift and eliminates the "|null" burden everywhere the value is read. SQLite does not support in-place ALTER … SET NOT NULL, so drizzle-kit cannot auto-generate this. The manual migration uses the standard SQLite recreate pattern (new table + INSERT SELECT + DROP + RENAME + recreate index) under `PRAGMA defer_foreign_keys = ON` so the existing federation_outbox → federation_peers FK survives the swap. The COPY step coalesces any hypothetical NULL to 0 defensively; live probes on both test instances (nova, orbit) showed zero NULL rows so no actual backfill is required. Verified by applying the full migration chain against a copy of the VM's live DB: column ends as `notnull=1 dflt=0`, the peer row is preserved, the unique index on origin is recreated, NULL inserts are rejected, and `PRAGMA foreign_key_check` reports no violations. Server `SanitizedPeer.consecutiveFailures` tightened to `number` to match the new drizzle inference and the shared `FederationPeer` shape. Follow-up #22 from S2S DM unification backlog.
41 lines
777 B
JSON
41 lines
777 B
JSON
{
|
|
"version": "7",
|
|
"dialect": "sqlite",
|
|
"entries": [
|
|
{
|
|
"idx": 0,
|
|
"version": "6",
|
|
"when": 1775687181033,
|
|
"tag": "0000_initial",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 1,
|
|
"version": "6",
|
|
"when": 1775734599940,
|
|
"tag": "0001_clear_earthquake",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 2,
|
|
"version": "6",
|
|
"when": 1776689384005,
|
|
"tag": "0002_peer_approval_requests",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 3,
|
|
"version": "6",
|
|
"when": 1776789567488,
|
|
"tag": "0003_classy_loki",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 4,
|
|
"version": "6",
|
|
"when": 1776802580650,
|
|
"tag": "0004_cooing_black_knight",
|
|
"breakpoints": true
|
|
}
|
|
]
|
|
} |