···11+-- V012: OAuth token endpoint schema additions
22+-- Applied in a single transaction by the migration runner.
33+--
44+-- Adds DPoP key thumbprint (jkt) to oauth_tokens for DPoP-bound refresh tokens.
55+-- Creates oauth_signing_key single-row table for the server's persistent ES256 keypair.
66+77+-- DPoP key thumbprint — NULL for tokens issued before V012 or without DPoP binding.
88+ALTER TABLE oauth_tokens ADD COLUMN jkt TEXT;
99+1010+-- Single-row table for the server's persistent ES256 signing keypair.
1111+-- WITHOUT ROWID: the key is always fetched by its id (primary key lookup).
1212+CREATE TABLE oauth_signing_key (
1313+ id TEXT NOT NULL, -- UUID key identifier
1414+ public_key_jwk TEXT NOT NULL, -- JWK JSON string (EC P-256 public key)
1515+ private_key_encrypted TEXT NOT NULL, -- base64(nonce(12) || ciphertext(32) || tag(16))
1616+ created_at TEXT NOT NULL, -- ISO 8601 UTC
1717+ PRIMARY KEY (id)
1818+) WITHOUT ROWID;