SQL update
parent
f29908b73f
commit
6e3c22808b
|
@ -12,29 +12,40 @@
|
||||||
-- ###############
|
-- ###############
|
||||||
-- Domain: User
|
-- Domain: User
|
||||||
-- ###############
|
-- ###############
|
||||||
Drop table if exists user_;
|
Drop table if exists user_;
|
||||||
CREATE TABLE user_ (
|
CREATE TABLE user_
|
||||||
id int(11) NOT NULL auto_increment,
|
(
|
||||||
guid varchar(255) not null unique,
|
id int(11) NOT NULL auto_increment,
|
||||||
create_time datetime ,
|
guid varchar(255) not null unique,
|
||||||
archived tinyint(1) default '0',
|
create_time datetime,
|
||||||
email varchar(255),
|
archived tinyint(1) default '0',
|
||||||
password varchar(255) not null,
|
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
phone varchar(255),
|
username varchar(255) not null unique,
|
||||||
username varchar(255) not null unique,
|
password varchar(255) not null,
|
||||||
default_user tinyint(1) default '0',
|
enabled tinyint(1) default '1',
|
||||||
last_login_time datetime ,
|
phone varchar(255),
|
||||||
PRIMARY KEY (id)
|
email varchar(255),
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
|
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;
|
||||||
|
|
||||||
|
|
||||||
-- ###############
|
-- ###############
|
||||||
-- Domain: Privilege
|
-- Domain: Privilege
|
||||||
-- ###############
|
-- ###############
|
||||||
Drop table if exists user_privilege;
|
Drop table if exists user_privilege;
|
||||||
CREATE TABLE user_privilege (
|
CREATE TABLE user_privilege
|
||||||
user_id int(11),
|
(
|
||||||
privilege varchar(255),
|
user_id int(11),
|
||||||
KEY user_id_index (user_id)
|
privilege varchar(255),
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
KEY user_id_index (user_id)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
|
|
@ -1,66 +1,84 @@
|
||||||
--
|
--
|
||||||
-- Oauth sql -- MYSQL
|
-- Oauth sql -- MYSQL v3.0.0
|
||||||
--
|
--
|
||||||
|
|
||||||
Drop table if exists oauth_client_details;
|
Drop table if exists oauth2_registered_client;
|
||||||
create table oauth_client_details (
|
CREATE TABLE oauth2_registered_client
|
||||||
client_id VARCHAR(255) PRIMARY KEY,
|
(
|
||||||
resource_ids VARCHAR(255),
|
id varchar(100) NOT NULL,
|
||||||
client_secret VARCHAR(255),
|
archived TINYINT(1) DEFAULT '0',
|
||||||
scope VARCHAR(255),
|
create_time DATETIME,
|
||||||
authorized_grant_types VARCHAR(255),
|
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
web_server_redirect_uri VARCHAR(255),
|
client_id varchar(100) NOT NULL,
|
||||||
authorities VARCHAR(255),
|
client_id_issued_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||||
access_token_validity INTEGER,
|
client_secret varchar(200) DEFAULT NULL,
|
||||||
refresh_token_validity INTEGER,
|
client_secret_expires_at datetime DEFAULT NULL,
|
||||||
additional_information TEXT,
|
client_name varchar(200) NOT NULL,
|
||||||
create_time timestamp default now(),
|
client_authentication_methods varchar(1000) NOT NULL,
|
||||||
archived tinyint(1) default '0',
|
authorization_grant_types varchar(1000) NOT NULL,
|
||||||
trusted tinyint(1) default '0',
|
redirect_uris varchar(1000) DEFAULT NULL,
|
||||||
autoapprove VARCHAR (255) default 'false'
|
post_logout_redirect_uris varchar(1000) DEFAULT NULL,
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
scopes varchar(1000) NOT NULL,
|
||||||
|
client_settings varchar(2000) NOT NULL,
|
||||||
|
token_settings varchar(2000) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
-- authorization
|
||||||
|
Drop table if exists oauth2_authorization;
|
||||||
|
CREATE TABLE oauth2_authorization
|
||||||
|
(
|
||||||
|
id varchar(100) NOT NULL,
|
||||||
|
registered_client_id varchar(100) NOT NULL,
|
||||||
|
principal_name varchar(200) NOT NULL,
|
||||||
|
authorization_grant_type varchar(100) NOT NULL,
|
||||||
|
authorized_scopes varchar(1000) DEFAULT NULL,
|
||||||
|
attributes blob DEFAULT NULL,
|
||||||
|
state varchar(500) DEFAULT NULL,
|
||||||
|
authorization_code_value blob DEFAULT NULL,
|
||||||
|
authorization_code_issued_at datetime DEFAULT NULL,
|
||||||
|
authorization_code_expires_at datetime DEFAULT NULL,
|
||||||
|
authorization_code_metadata blob DEFAULT NULL,
|
||||||
|
access_token_value blob DEFAULT NULL,
|
||||||
|
access_token_issued_at datetime DEFAULT NULL,
|
||||||
|
access_token_expires_at datetime DEFAULT NULL,
|
||||||
|
access_token_metadata blob DEFAULT NULL,
|
||||||
|
access_token_type varchar(100) DEFAULT NULL,
|
||||||
|
access_token_scopes varchar(1000) DEFAULT NULL,
|
||||||
|
oidc_id_token_value blob DEFAULT NULL,
|
||||||
|
oidc_id_token_issued_at datetime DEFAULT NULL,
|
||||||
|
oidc_id_token_expires_at datetime DEFAULT NULL,
|
||||||
|
oidc_id_token_metadata blob DEFAULT NULL,
|
||||||
|
refresh_token_value blob DEFAULT NULL,
|
||||||
|
refresh_token_issued_at datetime DEFAULT NULL,
|
||||||
|
refresh_token_expires_at datetime DEFAULT NULL,
|
||||||
|
refresh_token_metadata blob DEFAULT NULL,
|
||||||
|
user_code_value blob DEFAULT NULL,
|
||||||
|
user_code_issued_at datetime DEFAULT NULL,
|
||||||
|
user_code_expires_at datetime DEFAULT NULL,
|
||||||
|
user_code_metadata blob DEFAULT NULL,
|
||||||
|
device_code_value blob DEFAULT NULL,
|
||||||
|
device_code_issued_at datetime DEFAULT NULL,
|
||||||
|
device_code_expires_at datetime DEFAULT NULL,
|
||||||
|
device_code_metadata blob DEFAULT NULL,
|
||||||
|
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
|
||||||
Drop table if exists oauth_access_token;
|
-- authorization consent
|
||||||
create table oauth_access_token (
|
Drop table if exists oauth2_authorization_consent;
|
||||||
create_time timestamp default now(),
|
CREATE TABLE oauth2_authorization_consent
|
||||||
token_id VARCHAR(255),
|
(
|
||||||
token BLOB,
|
registered_client_id varchar(100) NOT NULL,
|
||||||
authentication_id VARCHAR(255) UNIQUE,
|
principal_name varchar(200) NOT NULL,
|
||||||
user_name VARCHAR(255),
|
authorities varchar(1000) NOT NULL,
|
||||||
client_id VARCHAR(255),
|
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
authentication BLOB,
|
PRIMARY KEY (registered_client_id, principal_name)
|
||||||
refresh_token VARCHAR(255)
|
) ENGINE = InnoDB
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
DEFAULT CHARSET = utf8;
|
||||||
|
|
||||||
|
|
||||||
Drop table if exists oauth_refresh_token;
|
|
||||||
create table oauth_refresh_token (
|
|
||||||
create_time timestamp default now(),
|
|
||||||
token_id VARCHAR(255),
|
|
||||||
token BLOB,
|
|
||||||
authentication BLOB
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
|
|
||||||
Drop table if exists oauth_code;
|
|
||||||
create table oauth_code (
|
|
||||||
create_time timestamp default now(),
|
|
||||||
code VARCHAR(255),
|
|
||||||
authentication BLOB
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Add indexes
|
|
||||||
create index token_id_index on oauth_access_token (token_id);
|
|
||||||
create index authentication_id_index on oauth_access_token (authentication_id);
|
|
||||||
create index user_name_index on oauth_access_token (user_name);
|
|
||||||
create index client_id_index on oauth_access_token (client_id);
|
|
||||||
create index refresh_token_index on oauth_access_token (refresh_token);
|
|
||||||
|
|
||||||
create index token_id_index on oauth_refresh_token (token_id);
|
|
||||||
|
|
||||||
create index code_index on oauth_code (code);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue