2024-04-26 21:12:56 +01:00
|
|
|
DROP TABLE IF EXISTS users;
|
|
|
|
DROP TABLE IF EXISTS userdata;
|
|
|
|
DROP TABLE IF EXISTS sessions;
|
2024-04-28 11:09:38 +01:00
|
|
|
DROP TABLE IF EXISTS blacklist;
|
2024-04-26 21:12:56 +01:00
|
|
|
DROP TABLE IF EXISTS oauth;
|
|
|
|
|
|
|
|
CREATE TABLE users (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
created TEXT NOT NULL,
|
|
|
|
username TEXT NOT NULL,
|
2024-04-28 10:45:58 +01:00
|
|
|
password TEXT NOT NULL,
|
2024-07-26 19:25:41 +01:00
|
|
|
uniqueid TEXT NOT NULL,
|
|
|
|
migrated INTEGER NOT NULL DEFAULT 0
|
2024-04-26 21:12:56 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE userdata (
|
|
|
|
creator INTEGER NOT NULL,
|
|
|
|
appId TEXT NOT NULL,
|
|
|
|
secret TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE sessions (
|
|
|
|
sessionid INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
session TEXT NOT NULL,
|
|
|
|
id INTEGER NOT NULL,
|
2024-04-28 21:24:50 +01:00
|
|
|
device TEXT NOT NULL DEFAULT '?'
|
2024-04-26 21:12:56 +01:00
|
|
|
);
|
|
|
|
|
2024-04-28 10:45:58 +01:00
|
|
|
CREATE TABLE blacklist (
|
2024-04-28 11:13:06 +01:00
|
|
|
openid TEXT NOT NULL,
|
2024-04-28 10:45:58 +01:00
|
|
|
blacklisted BOOLEAN NOT NULL DEFAULT true,
|
|
|
|
token TEXT NOT NULL
|
2024-04-28 11:08:57 +01:00
|
|
|
);
|
2024-04-28 10:45:58 +01:00
|
|
|
|
2024-04-26 21:12:56 +01:00
|
|
|
CREATE TABLE oauth (
|
2024-07-26 19:25:41 +01:00
|
|
|
appId TEXT NOT NULL UNIQUE,
|
2024-04-26 21:12:56 +01:00
|
|
|
secret TEXT NOT NULL,
|
|
|
|
creator INTEGER NOT NULL,
|
2024-07-26 19:25:41 +01:00
|
|
|
redirectUri TEXT NOT NULL,
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
keyShareUri TEXT NOT NULL DEFAULT 'none',
|
|
|
|
scopes TEXT NOT NULL DEFAULT '["openid"]'
|
2024-04-26 21:12:56 +01:00
|
|
|
)
|