Files
asd-backend/migrations/010_rename_paid_fields.sql

19 lines
723 B
PL/PgSQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ============================================
-- 迁移: 010_rename_paid_fields.sql
-- 目的: 将 users 表中的 is_paid/paid_expires_at 重命名为
-- is_member/membership_expires_at语义更准确
-- 日期: 2026-05-25
-- 依赖: 001_add_payment_fields.sql
-- ============================================
BEGIN;
ALTER TABLE users RENAME COLUMN is_paid TO is_member;
ALTER TABLE users RENAME COLUMN paid_expires_at TO membership_expires_at;
-- 更新 audit_log 中的备注(不阻塞)
COMMENT ON COLUMN users.is_member IS '会员身份凭证:曾经拥有过会员资格(即使已过期)';
COMMENT ON COLUMN users.membership_expires_at IS '会员到期时间NULL 表示永久会员';
COMMIT;