SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for t_system_authority_info -- ---------------------------- DROP TABLE IF EXISTS `t_system_authority_info`; CREATE TABLE `t_system_authority_info` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘权限ID‘, `name` varchar(100) DEFAULT NULL COMMENT ‘权限标识‘, `cnname` varchar(100) DEFAULT NULL COMMENT ‘权限中文标识‘, `insert_date` datetime DEFAULT NULL COMMENT ‘插入时间‘, `update_date` datetime DEFAULT NULL COMMENT ‘更新时间‘, `order_index` int(4) DEFAULT NULL COMMENT ‘排序‘, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- ---------------------------- -- Table structure for t_system_authority_resource -- ---------------------------- DROP TABLE IF EXISTS `t_system_authority_resource`; CREATE TABLE `t_system_authority_resource` ( `authority_id` int(11) NOT NULL COMMENT ‘权限ID‘, `resource_id` int(11) NOT NULL COMMENT ‘资源ID‘, PRIMARY KEY (`resource_id`,`authority_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- ---------------------------- -- Table structure for t_system_resource_info -- ---------------------------- DROP TABLE IF EXISTS `t_system_resource_info`; CREATE TABLE `t_system_resource_info` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘资源ID‘, `name` varchar(50) NOT NULL COMMENT ‘资源标识‘, `path` varchar(200) NOT NULL COMMENT ‘资源URL‘, `cnname` varchar(50) DEFAULT NULL COMMENT ‘资源中文标识‘, `insert_date` datetime DEFAULT NULL COMMENT ‘插入时间‘, `update_date` datetime DEFAULT NULL COMMENT ‘更新时间‘, `order_index` int(4) DEFAULT NULL COMMENT ‘排序‘, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) USING BTREE, UNIQUE KEY `path` (`path`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for t_system_role_authority -- ---------------------------- DROP TABLE IF EXISTS `t_system_role_authority`; CREATE TABLE `t_system_role_authority` ( `role_id` int(11) NOT NULL DEFAULT ‘0‘ COMMENT ‘角色ID‘, `authority_id` int(11) NOT NULL DEFAULT ‘0‘ COMMENT ‘权限ID‘, PRIMARY KEY (`role_id`,`authority_id`), KEY `index_role_id` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for t_system_role_info -- ---------------------------- DROP TABLE IF EXISTS `t_system_role_info`; CREATE TABLE `t_system_role_info` ( `id` int(11) NOT NULL COMMENT ‘角色ID‘, `name` varchar(50) NOT NULL COMMENT ‘角色名称‘, `cnname` varchar(50) DEFAULT NULL COMMENT ‘角色中文名称‘, `parent_id` int(11) DEFAULT NULL COMMENT ‘父角色ID‘, `is_use` tinyint(4) DEFAULT ‘1‘ COMMENT ‘1在用,0停用‘, `insert_date` datetime DEFAULT NULL COMMENT ‘插入时间‘, `update_date` datetime DEFAULT NULL COMMENT ‘更新时间‘, `order_index` int(4) DEFAULT NULL COMMENT ‘排序‘, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for t_system_user_info -- ---------------------------- DROP TABLE IF EXISTS `t_system_user_info`; CREATE TABLE `t_system_user_info` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘用户ID‘, `username` varchar(50) NOT NULL COMMENT ‘用户名称‘, `password` varchar(50) NOT NULL COMMENT ‘密码‘, `enabled` tinyint(4) DEFAULT ‘1‘ COMMENT ‘可用(1表示可用,0表示停用)‘, `default_role_id` int(11) DEFAULT NULL COMMENT ‘默认使用的角色ID‘, `cnname` varchar(50) DEFAULT NULL COMMENT ‘中文名称‘, `email` varchar(50) DEFAULT NULL COMMENT ‘邮箱‘, `mobile` varchar(50) DEFAULT NULL COMMENT ‘电话‘, `department_code` varchar(3) DEFAULT NULL COMMENT ‘组织代码(暂时保留)‘, `insert_date` datetime DEFAULT NULL COMMENT ‘插入时间‘, `update_date` datetime DEFAULT NULL COMMENT ‘更新时间‘, `last_login_date` datetime DEFAULT NULL COMMENT ‘最后登录时间‘, `operator_ip` varchar(50) DEFAULT NULL COMMENT ‘操作IP‘, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for t_system_user_role -- ---------------------------- DROP TABLE IF EXISTS `t_system_user_role`; CREATE TABLE `t_system_user_role` ( `user_id` int(11) NOT NULL DEFAULT ‘0‘ COMMENT ‘用户ID‘, `role_id` int(11) NOT NULL DEFAULT ‘0‘ COMMENT ‘角色ID‘, PRIMARY KEY (`user_id`,`role_id`), KEY `roleId` (`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
数据库设计并没有给表建立相关外键,如有需要请自行添加外键。
数据库模型如图:
时间: 2024-10-07 05:24:38