2013-11-19 09:39:23 +00:00
|
|
|
-- ###############
|
2014-03-20 03:31:03 +00:00
|
|
|
-- create MySQL database , if need create, cancel the comment
|
2013-11-19 09:39:23 +00:00
|
|
|
-- ###############
|
2018-04-19 15:10:19 +00:00
|
|
|
-- create database if not exists oauth2_boot default character set utf8;
|
|
|
|
-- use oauth2_boot set default character = utf8;
|
2013-11-19 09:39:23 +00:00
|
|
|
|
|
|
|
-- ###############
|
2015-07-26 14:07:55 +00:00
|
|
|
-- grant privileges to oauth2/oauth2
|
2013-11-19 09:39:23 +00:00
|
|
|
-- ###############
|
2015-07-26 14:07:55 +00:00
|
|
|
-- GRANT ALL PRIVILEGES ON oauth2.* TO oauth2@localhost IDENTIFIED BY "oauth2";
|
2013-11-19 09:39:23 +00:00
|
|
|
|
|
|
|
-- ###############
|
|
|
|
-- Domain: User
|
|
|
|
-- ###############
|
2023-10-13 01:55:51 +00:00
|
|
|
Drop table if exists user_;
|
|
|
|
CREATE TABLE user_
|
|
|
|
(
|
|
|
|
id int(11) NOT NULL auto_increment,
|
|
|
|
guid varchar(255) not null unique,
|
|
|
|
create_time datetime,
|
|
|
|
archived tinyint(1) default '0',
|
|
|
|
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
|
username varchar(255) not null unique,
|
|
|
|
password varchar(255) not null,
|
|
|
|
enabled tinyint(1) default '1',
|
|
|
|
phone varchar(255),
|
|
|
|
email varchar(255),
|
|
|
|
address varchar(255),
|
|
|
|
nickname varchar(255),
|
|
|
|
updated_at int(15) default 0,
|
|
|
|
default_user tinyint(1) default '0',
|
|
|
|
last_login_time datetime,
|
|
|
|
PRIMARY KEY (id),
|
|
|
|
index idx_username (username)
|
|
|
|
) ENGINE = InnoDB
|
|
|
|
AUTO_INCREMENT = 20
|
|
|
|
DEFAULT CHARSET = utf8;
|
2013-11-19 09:39:23 +00:00
|
|
|
|
2015-05-15 07:36:39 +00:00
|
|
|
|
|
|
|
-- ###############
|
|
|
|
-- Domain: Privilege
|
|
|
|
-- ###############
|
2023-10-13 01:55:51 +00:00
|
|
|
Drop table if exists user_privilege;
|
|
|
|
CREATE TABLE user_privilege
|
|
|
|
(
|
|
|
|
user_id int(11),
|
|
|
|
privilege varchar(255),
|
|
|
|
KEY user_id_index (user_id)
|
|
|
|
) ENGINE = InnoDB
|
|
|
|
DEFAULT CHARSET = utf8;
|
2015-05-15 07:36:39 +00:00
|
|
|
|