加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
springsecurityoauth2.sql 7.37 KB
一键复制 编辑 原始数据 按行查看 历史
xuguofeng 提交于 2020-10-29 20:06 . SQL脚本优化
/*
Navicat MySQL Data Transfer
Source Server : 本机
Source Server Version : 50562
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50562
File Encoding : 65001
Date: 2019-07-04 08:12:22
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for clientdetails
-- ----------------------------
DROP TABLE IF EXISTS `clientdetails`;
CREATE TABLE `clientdetails` (
`appId` varchar(255) NOT NULL,
`resourceIds` varchar(255) DEFAULT NULL,
`appSecret` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`grantTypes` varchar(255) DEFAULT NULL,
`redirectUrl` varchar(255) DEFAULT NULL,
`authorities` varchar(255) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additionalInformation` varchar(4096) DEFAULT NULL,
`autoApproveScopes` varchar(255) DEFAULT NULL,
PRIMARY KEY (`appId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of clientdetails
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_access_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_access_token`;
CREATE TABLE `oauth_access_token` (
`token_id` varchar(255) DEFAULT NULL,
`token` blob,
`authentication_id` varchar(255) NOT NULL,
`user_name` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`authentication` blob,
`refresh_token` varchar(255) DEFAULT NULL,
PRIMARY KEY (`authentication_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_access_token
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_approvals
-- ----------------------------
DROP TABLE IF EXISTS `oauth_approvals`;
CREATE TABLE `oauth_approvals` (
`userId` varchar(255) DEFAULT NULL,
`clientId` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`expiresAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lastModifiedAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_approvals
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
`client_id` varchar(255) NOT NULL,
`resource_ids` varchar(255) DEFAULT NULL,
`client_secret` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`authorized_grant_types` varchar(255) DEFAULT NULL,
`web_server_redirect_uri` varchar(255) DEFAULT NULL,
`authorities` varchar(255) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` text,
`autoapprove` varchar(255) DEFAULT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
INSERT INTO `oauth_client_details` VALUES ('net5ijy', null, '12345678', 'all,read,write', 'authorization_code,refresh_token,password', null, 'ROLE_TRUSTED_CLIENT', '43200', '43200', null, null);
INSERT INTO `oauth_client_details` VALUES ('tencent', null, '12345678', 'all,read,write', 'authorization_code,password', null, 'ROLE_TRUSTED_CLIENT', '1800', '1800', null, null);
-- ----------------------------
-- Table structure for oauth_client_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_token`;
CREATE TABLE `oauth_client_token` (
`token_id` varchar(255) DEFAULT NULL,
`token` blob,
`authentication_id` varchar(255) NOT NULL,
`user_name` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`authentication_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_client_token
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_code
-- ----------------------------
DROP TABLE IF EXISTS `oauth_code`;
CREATE TABLE `oauth_code` (
`code` varchar(255) DEFAULT NULL,
`authentication` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_code
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_refresh_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_refresh_token`;
CREATE TABLE `oauth_refresh_token` (
`token_id` varchar(255) DEFAULT NULL,
`token` blob,
`authentication` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_refresh_token
-- ----------------------------
-- ----------------------------
-- Table structure for springcloud_role
-- ----------------------------
DROP TABLE IF EXISTS `springcloud_role`;
CREATE TABLE `springcloud_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of springcloud_role
-- ----------------------------
INSERT INTO `springcloud_role` VALUES ('1', 'ADMIN');
INSERT INTO `springcloud_role` VALUES ('2', 'USER');
INSERT INTO `springcloud_role` VALUES ('3', 'DBA');
-- ----------------------------
-- Table structure for springcloud_user
-- ----------------------------
DROP TABLE IF EXISTS `springcloud_user`;
CREATE TABLE `springcloud_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`create_time` datetime DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`phone` varchar(11) DEFAULT NULL,
`username` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_bdjh7hkhwt42imfy9b9vp0odh` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=426 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of springcloud_user
-- ----------------------------
INSERT INTO `springcloud_user` VALUES ('1', '2019-03-26 08:47:48', '18900000000@189.cn', '$2a$10$808uxYoOsZ/5pI5vme0MKOLkJ/VdGYeXSDHkfBAnR3bbqFvP64nwa', '18902120812', 'admin1');
INSERT INTO `springcloud_user` VALUES ('218', '2019-05-31 10:08:39', '18900000001@189.cn', '$2a$10$DjCIGAvRTt3GTBMypYhFR.bYRXyfZkgcM1tbyJfBiBKY18PKxG3Wm', '18902120002', 'admin002');
INSERT INTO `springcloud_user` VALUES ('317', '2019-06-03 15:22:15', '18900000002@189.cn', '$2a$10$WcV5VFRRFeCCRdtXE3eUI.LKgV02SWkoxin9Jo5KtLo7lHFcx6hbe', '18902120001', 'admin0001');
-- ----------------------------
-- Table structure for springcloud_user_role
-- ----------------------------
DROP TABLE IF EXISTS `springcloud_user_role`;
CREATE TABLE `springcloud_user_role` (
`role_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
KEY `user_role_role_id` (`role_id`),
KEY `user_role_user_id` (`user_id`),
CONSTRAINT `user_role_role_id` FOREIGN KEY (`role_id`) REFERENCES `springcloud_role` (`id`),
CONSTRAINT `user_role_user_id` FOREIGN KEY (`user_id`) REFERENCES `springcloud_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of springcloud_user_role
-- ----------------------------
INSERT INTO `springcloud_user_role` VALUES ('1', '1');
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化