···185185 unique (did, session_did, session_rkey, reaction_id)
186186 );
187187188188+ create table if not exists notifications (
189189+ id integer primary key autoincrement,
190190+191191+ recipient_did text not null,
192192+ actor_did text not null,
193193+ subject_uri text not null,
194194+195195+ state text not null default 'unread' check(state in ('unread', 'read')),
196196+ type text not null check(type in ('follow', 'reaction')),
197197+198198+ created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
199199+200200+ foreign key (recipient_did) references profiles(did) on delete cascade,
201201+ foreign key (actor_did) references profiles(did) on delete cascade
202202+ );
203203+188204 create table if not exists resources (
189205 id integer primary key autoincrement,
190206