demos for spacedust
1create table if not exists accounts (
2 did text primary key,
3 first_seen text not null default CURRENT_TIMESTAMP,
4 role text null,
5 secret_password text null,
6
7 check(did like 'did:%')
8) strict;
9
10create table if not exists push_subs (
11 session text primary key, -- uuidv4, bound to signed browser cookie
12 account_did text not null,
13 subscription text not null, -- from browser, treat as opaque blob
14
15 created text not null default CURRENT_TIMESTAMP,
16
17 last_push text,
18 total_pushes integer not null default 0,
19
20 foreign key(account_did) references accounts(did)
21 on delete cascade on update cascade
22) strict;
23
24create table if not exists top_secret_passwords (
25 password text primary key,
26 added text not null default CURRENT_TIMESTAMP,
27 expired text null, -- timestamp
28
29 check(length(password) >= 3)
30) strict;