USE exchange_cas;

-- ----------------------------
-- Table structure for basic_school
-- ----------------------------
DROP TABLE IF EXISTS `basic_school`;
CREATE TABLE `basic_school` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `code` varchar(20) CHARACTER NOT NULL COMMENT '学校编码',
                                `name` varchar(100) CHARACTER DEFAULT NULL COMMENT '学校名称',
                                `enable` tinyint NOT NULL DEFAULT '1' COMMENT '是否启用，false：停用，true：启用',
                                `access_key` varchar(50) CHARACTER DEFAULT NULL COMMENT '访问key',
                                `access_secret` varchar(50) CHARACTER DEFAULT NULL COMMENT '访问秘钥',
                                `remark` text CHARACTER COMMENT '备注',
                                `create_id` bigint DEFAULT NULL COMMENT '创建人',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                `update_id` bigint DEFAULT NULL COMMENT '更新人',
                                `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                                `logo` varchar(500) CHARACTER DEFAULT NULL COMMENT '学校logo',
                                PRIMARY KEY (`id`) USING BTREE,
                                UNIQUE KEY `code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学校表';

-- ----------------------------
-- Table structure for sys_setting
-- ----------------------------
DROP TABLE IF EXISTS `sys_setting`;
CREATE TABLE `sys_setting` (
                               `id` bigint NOT NULL,
                               `school_id` bigint NOT NULL COMMENT '学校Id',
                               `parameter_object` mediumtext CHARACTER NOT NULL COMMENT '参数对象（json）',
                               `create_id` bigint DEFAULT NULL COMMENT '创建人',
                               `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                               `update_id` bigint DEFAULT NULL COMMENT '更新人',
                               `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                               PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统设置';

-- ----------------------------
-- Table structure for t_s_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_s_auth`;
CREATE TABLE `t_s_auth` (
                            `id` bigint NOT NULL COMMENT '主键',
                            `school_id` bigint NOT NULL COMMENT '学校id',
                            `access_key` varchar(255) CHARACTER DEFAULT NULL COMMENT 'accessKey',
                            `access_secret` varchar(255) CHARACTER DEFAULT NULL COMMENT 'accessSecret',
                            `description` text CHARACTER COMMENT '离线授权证书',
                            `type` varchar(16) CHARACTER NOT NULL COMMENT '授权类型',
                            `create_id` bigint DEFAULT NULL COMMENT '创建人',
                            `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                            `update_id` bigint DEFAULT NULL COMMENT '更新人',
                            `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                            `expire_time` bigint DEFAULT NULL COMMENT '过期时间',
                            `file` mediumblob COMMENT '文件数据',
                            PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='激活授权配置表';