7b22460f5e
Rollout note: the owner_notices table starts empty, so the first pass after deploy sends for conditions already true — correct per one-row-per-episode; say so rather than have it reported as a bug. Prod step: create the webhook, set DISCORD_WEBHOOK_URL on the deployment, redeploy — unset is silent by design, and without that step the feature ships dark. Security invariants preserved: the webhook address is a secret in the class of TOKEN_KEY (never logged, never on a config-printing line), and the owner gate is unchanged.
13 lines
561 B
SQL
13 lines
561 B
SQL
-- Owner notices (issue #171): one row per episode, remembered only as "the
|
|
-- owner was told". The row's presence is the whole state — the poller checks
|
|
-- it before sending, writes it after a successful send, and clears it when
|
|
-- the condition no longer holds. site is '' for a fault that is not one
|
|
-- Site's; the composite primary key is what makes the row a lock against a
|
|
-- second message for the same episode.
|
|
CREATE TABLE owner_notices (
|
|
condition text NOT NULL,
|
|
site text NOT NULL,
|
|
notified_at bigint NOT NULL,
|
|
PRIMARY KEY (condition, site)
|
|
);
|