VNOX-Server/hub/migrations/0008_desktop_auth.sql
loki5512344 c18ccadf99
chore(server): checkpoint deployed services and unfinished forums
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
2026-11-01 15:31:20 +01:00

17 lines
662 B
SQL

CREATE TABLE desktop_authorizations (
device_hash TEXT PRIMARY KEY,
code_hash TEXT NOT NULL UNIQUE,
public_key TEXT NOT NULL,
user_id TEXT REFERENCES accounts(user_id) ON DELETE CASCADE,
expires_at INTEGER NOT NULL
);
CREATE INDEX desktop_authorization_expiry ON desktop_authorizations(expires_at);
CREATE TABLE desktop_devices (
refresh_hash TEXT PRIMARY KEY,
device_hash TEXT NOT NULL UNIQUE,
public_key TEXT NOT NULL,
user_id TEXT NOT NULL REFERENCES accounts(user_id) ON DELETE CASCADE,
created_at INTEGER NOT NULL,
expires_at INTEGER NOT NULL
);
CREATE INDEX desktop_device_expiry ON desktop_devices(expires_at);