diff --git a/ads.js b/ads.js index a132a92..eab988f 100644 Binary files a/ads.js and b/ads.js differ diff --git a/db.js b/db.js index c440a24..c0c3c8f 100644 --- a/db.js +++ b/db.js @@ -75,6 +75,7 @@ async function bootstrap() { await alterSafe0('ALTER TABLE earned_credits ADD COLUMN purchase_grade INT NOT NULL DEFAULT 0'); // part of the pool that is refunded/credited PURCHASED money: shows as purchased, funds login ads await alterSafe0('ALTER TABLE earned_credits ADD COLUMN login_day CHAR(10) NULL'); // last daily-login-bonus day await alterSafe0('ALTER TABLE earned_credits ADD COLUMN login_streak INT NOT NULL DEFAULT 0'); // consecutive-day streak + await alterSafe0('ALTER TABLE earned_credits ADD COLUMN login_ts BIGINT NOT NULL DEFAULT 0'); // when the last sign-in bonus was paid: enforces a 20h floor, whatever the day string says // additive columns (MySQL 8 has no IF NOT EXISTS for columns) const alterSafe = async sql => { try { await q(sql); }