forked from babelouest/glewlwyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoauth2.mariadb.sql
23 lines (21 loc) · 894 Bytes
/
oauth2.mariadb.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DROP TABLE IF EXISTS gs_oauth2_session;
DROP TABLE IF EXISTS gs_oauth2_registration;
CREATE TABLE gs_oauth2_registration (
gsor_id INT(11) PRIMARY KEY AUTO_INCREMENT,
gsor_mod_name VARCHAR(128) NOT NULL,
gsor_provider VARCHAR(128) NOT NULL,
gsor_created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
gsor_username VARCHAR(128) NOT NULL,
gsor_userinfo_sub VARCHAR(128)
);
CREATE INDEX i_gsor_username ON gs_oauth2_registration(gsor_username);
CREATE TABLE gs_oauth2_session (
gsos_id INT(11) PRIMARY KEY AUTO_INCREMENT,
gsor_id INT(11),
gsos_created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
gsos_expires_at TIMESTAMP,
gsos_state TEXT NOT NULL,
gsos_session_export TEXT,
gsos_status TINYINT(1) DEFAULT 0, -- 0: registration, 1: authentication, 2: verified, 3: cancelled
FOREIGN KEY(gsor_id) REFERENCES gs_oauth2_registration(gsor_id) ON DELETE CASCADE
);