-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
34 lines (34 loc) · 941 Bytes
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DROP TABLE IF EXISTS Accounts;
DROP TABLE IF EXISTS Loops;
DROP TABLE IF EXISTS Logs;
CREATE TABLE IF NOT EXISTS Accounts (
AccountId INTEGER PRIMARY KEY,
Username VARCHAR(15) NOT NULL,
Password VARCHAR(100) NOT NULL,
Level INTEGER,
IsBanned BOOLEAN,
Loops JSON,
Unusable BOOLEAN
);
CREATE TABLE IF NOT EXISTS Loops (
LoopId INTEGER PRIMARY KEY,
Name VARCHAR(30) NOT NULL,
Title VARCHAR(100) NOT NULL,
ForumId INTEGER NOT NULL,
Description VARCHAR(300),
FirstMessage VARCHAR(16000) NOT NULL,
Answers JSON,
Times JSON NOT NULL,
Accounts JSON NOT NULL,
LastPosts JSON,
UserStatus VARCHAR(10) NOT NULL,
Disabled BOOLEAN NOT NULL
);
CREATE TABLE IF NOT EXISTS Logs (
LogId INTEGER PRIMARY KEY,
LogType VARCHAR(20) NOT NULL,
LogMessage VARCHAR(200) NOT NULL,
Operation VARCHAR(10000) NOT NULL,
Details VARCHAR(16000),
LogDate DATETIME NOT NULL
);