spark-server/migrations/0005_user_profile.sql
2026-09-23 17:11:56 +08:00

10 lines
846 B
SQL
Raw Permalink 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.

-- Profile fields on t_users. One ADD per statement (stock MySQL has no ADD COLUMN IF NOT EXISTS).
-- Re-running migrate ignores duplicate-column errors.
ALTER TABLE t_users ADD COLUMN qrcode VARCHAR(512) NOT NULL DEFAULT '' COMMENT '个人二维码对象存储 key 或 URL,不存图片二进制';
ALTER TABLE t_users ADD COLUMN birthday DATE NULL COMMENT '生日,未填为空';
ALTER TABLE t_users ADD COLUMN gender TINYINT NOT NULL DEFAULT 0 COMMENT '0=未知 1=男 2=女';
ALTER TABLE t_users ADD COLUMN last_login_at DATETIME(3) NULL COMMENT '最近一次登录时间';
ALTER TABLE t_users ADD COLUMN last_active_at DATETIME(3) NULL COMMENT '最近一次活跃时间(登录、心跳、发消息等)';
ALTER TABLE t_users COMMENT = '用户账号。主键 Snowflake 即 uid;登录身份在 t_user_emails,设备在 t_user_devices';