feat: auto grant one-time low balance gift for new users

This commit is contained in:
john
2026-06-30 20:39:46 +08:00
parent f7c35f37e5
commit cd1ff6758d
4 changed files with 232 additions and 9 deletions
+12
View File
@@ -359,6 +359,18 @@ export async function migrateSchema(pool) {
);
}
if (!(await columnExists(pool, 'h5_users', 'low_balance_gift_eligible'))) {
await pool.query(
`ALTER TABLE h5_users ADD COLUMN low_balance_gift_eligible TINYINT(1) NOT NULL DEFAULT 0 AFTER signup_source`,
);
}
if (!(await columnExists(pool, 'h5_users', 'low_balance_gift_granted_at'))) {
await pool.query(
`ALTER TABLE h5_users ADD COLUMN low_balance_gift_granted_at BIGINT NULL AFTER low_balance_gift_eligible`,
);
}
if (!(await columnExists(pool, 'h5_user_sessions', 'goosed_node'))) {
await pool.query(
`ALTER TABLE h5_user_sessions ADD COLUMN goosed_node TINYINT UNSIGNED NOT NULL DEFAULT 0`,