Skip to main content

max / makenotwork

815 B · 18 lines History Blame Raw
1 -- Fan+ perks: signature columns + denormalised perk flags.
2 --
3 -- `is_fan_plus` and `is_creator` mirror the latest MNW `/oauth/userinfo`
4 -- `perks` snapshot for this user. They're cached here so post rendering can
5 -- gate the + badge and signature display by JOINing against users instead of
6 -- making per-post calls to MNW. Refreshed on login + `POST /auth/refresh`
7 -- (see `src/auth.rs`).
8 --
9 -- Signature: free-text markdown shown beneath each post by Fan+ subscribers.
10 -- We store both the source markdown and pre-rendered HTML, matching the
11 -- pattern used for posts. Render at save time only.
12
13 ALTER TABLE users
14 ADD COLUMN signature_markdown TEXT,
15 ADD COLUMN signature_html TEXT,
16 ADD COLUMN is_fan_plus BOOLEAN NOT NULL DEFAULT FALSE,
17 ADD COLUMN is_creator BOOLEAN NOT NULL DEFAULT FALSE;
18