fix: 修复付费会员累加逻辑和迁移误判问题

- 修复 confirm_payment_order 累加逻辑:GREATEST(COALESCE(paid_expires_at, NOW()), NOW()) + days
- 永久会员改为 2099-12-31 而非 NULL,避免与未付费用户的 NULL 混淆
- 禁用 003_set_all_users_paid.sql 迁移(将所有已有用户设为永久付费)
- 后端部署后已回滚 Dev 数据库中 73 个被误设为付费的用户
This commit is contained in:
2026-05-07 15:55:37 +08:00
parent d884914338
commit a588478ab0
2 changed files with 69 additions and 38 deletions

View File

@@ -1 +1,6 @@
UPDATE users SET is_paid = true WHERE is_paid = false;
-- ATTENTION: This migration was originally `UPDATE users SET is_paid = true WHERE is_paid = false`
-- which incorrectly made ALL existing users permanent paid members (paid_expires_at = NULL → permanent).
-- The accumulation logic now handles membership correctly in confirm_payment_order.
-- DO NOT re-enable without understanding the full consequences.
-- This file is kept empty as a placeholder to prevent migration numbering gaps.
SELECT 1 WHERE 1 = 1; -- no-op