Spooky Doors: doors may repeat a visit campaign after doorRepeatDays (7) via visit_repeat; Earn and refuels stay once-ever

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-02 14:51:10 -05:00
parent 3b57bbc9cf
commit dbbce34202
5 changed files with 98 additions and 1 deletions
+11
View File
@@ -217,6 +217,17 @@ async function bootstrap() {
ts BIGINT NOT NULL,
INDEX (campaign_id, ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
// repeat door visits after the cooldown (Spooky Doors, 2026-10-02); visit_seen keeps its one-row-per-campaign rule
await q(`CREATE TABLE IF NOT EXISTS visit_repeat (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
campaign_id INT NOT NULL,
email VARCHAR(190) NOT NULL,
day CHAR(10) NOT NULL,
ts BIGINT NOT NULL,
kind VARCHAR(8) NOT NULL DEFAULT 'door',
INDEX (email, day, kind),
INDEX (email, campaign_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
await q(`CREATE TABLE IF NOT EXISTS visit_seen (
campaign_id INT NOT NULL,
email VARCHAR(190) NOT NULL,