10 Star 57 Fork 3

辰风沐阳 / 微擎小程序TP6.0框架

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
upgrade.php 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
<?php
// +----------------------------------------------------------------------
// | 升级模块执行: 创建新的数据表、给指定的表追加新的字段
// +----------------------------------------------------------------------
// | Author: liang 辰风沐阳 23426945@qq.com Blog: https://www.itqaq.com
// +----------------------------------------------------------------------
// 创建新的数据表: 当该表不存在时执行建表语句
// if (!pdo_tableexists('applet_user')) {
// pdo_query("CREATE TABLE IF NOT EXISTS `ims_applet_user` (
// `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户id',
// `uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '平台id',
// `unionid` varchar(30) DEFAULT '' COMMENT '开发平台唯一标识',
// `openid` varchar(50) NOT NULL DEFAULT '' COMMENT '用户openid',
// `nickName` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '微信昵称',
// `avatarUrl` varchar(255) NOT NULL DEFAULT '' COMMENT '微信头像',
// `gender` tinyint(1) NOT NULL DEFAULT '0' COMMENT '性别 0 未知 1 男 2 女',
// `balance` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '余额,单位:元',
// `session_key` varchar(60) DEFAULT NULL COMMENT '会话密钥',
// `create_time` int(11) NOT NULL COMMENT '添加时间',
// `update_time` int(11) DEFAULT NULL COMMENT '修改时间',
// `delete_time` int(11) DEFAULT NULL COMMENT '软删除',
// PRIMARY KEY (`id`) USING BTREE,
// UNIQUE KEY `uniacid` (`uniacid`,`openid`) USING BTREE
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';");
// }
// 老的数据表新增字段: 当该数据表字段不存在时执行场景
// if (!pdo_fieldexists('applet_user', 'session_key')) {
// pdo_query("ALTER TABLE " . tablename('applet_user') . " ADD `session_key` varchar(60) DEFAULT NULL COMMENT '会话密钥'");
// }
PHP
1
https://gitee.com/u1s1it/wechat-applet.git
git@gitee.com:u1s1it/wechat-applet.git
u1s1it
wechat-applet
微擎小程序TP6.0框架
master

搜索帮助