Files
story/migrations/000072_trusted_login_device.up.sql
T
Codex Local bf1233d5df
ci / verify (push) Canceled after 0s
feat: expand companion platform, device controls, and memoir workflows
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
2026-10-08 10:06:44 +08:00

14 lines
507 B
PL/PgSQL

BEGIN;
CREATE TABLE trusted_login_device (
token_hash char(64) PRIMARY KEY,
realm text NOT NULL CHECK (realm IN ('customer','operator')),
phone_digest char(64) NOT NULL,
credential_digest char(64) NOT NULL,
verified_at timestamptz NOT NULL,
expires_at timestamptz NOT NULL,
revoked_at timestamptz
);
CREATE INDEX trusted_login_device_phone_idx ON trusted_login_device(realm,phone_digest);
CREATE INDEX trusted_login_device_expiry_idx ON trusted_login_device(expires_at);
COMMIT;