Differences From
Artifact [b4d8dee98e]:
30 30 on delete cascade, -- null origin = local actor
31 31 knownsince timestamp not null default now(),
32 32 bio text,
33 33 avatarid bigint, -- artifact id, null if remote
34 34 avataruri text, -- null if local
35 35 rank smallint not null default 0,
36 36 quota integer not null default 1000,
37 + invites integer not null default 0,
37 38 key bytea, -- private if localactor; public if remote
38 39 epithet text,
39 40 authtime timestamp not null default now(), -- cookies earlier than this timepoint will not be accepted
40 41
41 42 unique (handle,origin)
42 43 );
43 44
................................................................................
142 143
143 144 create table parsav_room_members (
144 145 room bigint not null references parsav_rooms(id) on delete cascade,
145 146 member bigint not null references parsav_actors(id) on delete cascade,
146 147 rank smallint not null default 0,
147 148 admin boolean not null default false, -- non-admins with rank can only moderate + invite
148 149 title text, -- admin-granted title like reddit flair
149 - vouchedby bigint references parsav_actors(id)
150 + vouchedby bigint references parsav_actors(id) on delete set null
150 151 );
151 152
152 153 create table parsav_invites (
153 154 id bigint primary key default (1+random()*(2^63-1))::bigint,
154 155 -- when a user is created from an invite, the invite is deleted and the invite
155 156 -- ID becomes the user ID. privileges granted on the invite ID during the invite
156 157 -- process are thus inherited by the user