install.sql 1.7 KB

123456789101112131415161718192021222324252627282930
  1. CREATE TABLE IF NOT EXISTS `__PREFIX__third` (
  2. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  3. `user_id` int(10) unsigned DEFAULT '0' COMMENT '会员ID',
  4. `platform` varchar(30) DEFAULT '' COMMENT '第三方应用',
  5. `apptype` varchar(50) DEFAULT '' COMMENT '应用类型',
  6. `unionid` varchar(100) DEFAULT '' COMMENT '第三方UNIONID',
  7. `openid` varchar(100) DEFAULT '' COMMENT '第三方OPENID',
  8. `openname` varchar(100) DEFAULT '' COMMENT '第三方会员昵称',
  9. `access_token` varchar(255) NULL DEFAULT '' COMMENT 'AccessToken',
  10. `refresh_token` varchar(255) DEFAULT 'RefreshToken',
  11. `expires_in` int(10) unsigned DEFAULT '0' COMMENT '有效期',
  12. `createtime` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
  13. `updatetime` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
  14. `logintime` int(10) unsigned DEFAULT NULL COMMENT '登录时间',
  15. `expiretime` int(10) unsigned DEFAULT NULL COMMENT '过期时间',
  16. PRIMARY KEY (`id`),
  17. UNIQUE KEY `platform` (`platform`,`openid`),
  18. KEY `user_id` (`user_id`,`platform`),
  19. KEY `unionid` (`platform`,`unionid`)
  20. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='第三方登录表';
  21. ALTER TABLE `__PREFIX__third` ADD COLUMN `apptype` varchar(50) NULL DEFAULT '' COMMENT '应用类型' AFTER `platform`;
  22. ALTER TABLE `__PREFIX__third` ADD COLUMN `unionid` varchar(100) NULL DEFAULT '' COMMENT '第三方UnionID' AFTER `apptype`;
  23. ALTER TABLE `__PREFIX__third` ADD INDEX `unionid`(`platform`, `unionid`);
  24. ALTER TABLE `__PREFIX__third` CHARACTER SET = utf8mb4, COLLATE = utf8mb4_general_ci;
  25. ALTER TABLE `__PREFIX__third` MODIFY COLUMN `openname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '第三方会员昵称' AFTER `unionid`;