Branchwell

Become a Pro / website · becomeapro.ai / d1 / migrations / 0005_biolock.sql

Raw 793 B on d27a4e234d2622fe12dfe92667dd00367e1dc2de
1-- BioLock: sign in with this device's own fingerprint or face reader. Google and Apple sign-in are gone.
2CREATE TABLE biolock_credential (
3 id TEXT PRIMARY KEY,
4 user_id TEXT NOT NULL REFERENCES "user" ("id") ON DELETE CASCADE,
5 public_key TEXT NOT NULL,
6 alg INTEGER NOT NULL,
7 counter INTEGER NOT NULL DEFAULT 0,
8 name TEXT NOT NULL,
9 created_at INTEGER NOT NULL,
10 last_used INTEGER
11);
12CREATE INDEX biolock_credential_user ON biolock_credential (user_id);
13
14-- One-time, 10-minute links that add another device to an account.
15CREATE TABLE biolock_link (
16 token_hash TEXT PRIMARY KEY,
17 user_id TEXT NOT NULL REFERENCES "user" ("id") ON DELETE CASCADE,
18 expires_at INTEGER NOT NULL,
19 used INTEGER NOT NULL DEFAULT 0
20);
21
22-- Old Google/Apple sessions end now.
23DELETE FROM "session";