Files
yunzerwebsiteallinone/go/docs/sql/create_auth_mini_register.sql
T
2026-11-16 17:22:50 +08:00

17 lines
1.1 KiB
SQL
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.
CREATE TABLE IF NOT EXISTS `yz_auth_mini_register` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`scene` VARCHAR(64) NOT NULL COMMENT '注册会话标识(小程序码 scene)',
`openid` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '确认用户的小程序 openid',
`unionid` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '确认用户的 unionid(同主体多端互通)',
`mobile` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '手机号快速验证拿到的手机号(可选)',
`app_id` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '确认时所用的小程序 AppID(多应用场景)',
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '0待确认 1已确认 2已核销 3已过期',
`expire_at` DATETIME NOT NULL COMMENT '过期时间',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_scene` (`scene`),
KEY `idx_openid` (`openid`),
KEY `idx_expire_at` (`expire_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信小程序扫码注册核验会话';