logicsrc/apps/pwa/src/migrations/008_recovery_tokens.sql
2026-10-29 13:21:27 +00:00

10 lines
374 B
SQL

CREATE TABLE IF NOT EXISTS recovery_tokens (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL UNIQUE,
created_at INTEGER NOT NULL,
expires_at INTEGER NOT NULL,
used_at INTEGER,
revoked_at INTEGER
);
CREATE INDEX IF NOT EXISTS idx_recovery_tokens_user ON recovery_tokens(user_id);