-
Notifications
You must be signed in to change notification settings - Fork 70
/
sql.sql
63 lines (63 loc) · 1.53 KB
/
sql.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
CREATE TABLE op_coordination
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
fileId INT NOT NULL,
spaceId INT NOT NULL
);
CREATE TABLE op_file
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
type VARCHAR(50) NOT NULL
);
CREATE TABLE op_file_document
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
fileId INT NOT NULL,
content LONGTEXT
);
CREATE TABLE op_file_slide
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
fileId INT NOT NULL
);
CREATE TABLE op_file_slidepart
(
slideId INT NOT NULL,
content LONGTEXT NOT NULL,
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT
);
CREATE TABLE op_space
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
spaceName VARCHAR(45) NOT NULL,
createUserId INT NOT NULL,
createDate DATETIME NOT NULL
);
CREATE TABLE op_user_space_join
(
userId INT NOT NULL,
spaceId INT NOT NULL
);
CREATE TABLE s_user
(
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
username VARCHAR(20) NOT NULL,
password VARCHAR(32) NOT NULL,
name VARCHAR(10) NOT NULL,
idcard VARCHAR(18) NOT NULL,
sex VARCHAR(2),
qq VARCHAR(15),
telephone VARCHAR(15),
email VARCHAR(45),
birth DATE,
department VARCHAR(40) NOT NULL,
balance INT DEFAULT 0,
createDate DATE,
latestLoginDate DATE,
setting VARCHAR(500),
remark LONGTEXT,
icon LONGTEXT
);
CREATE UNIQUE INDEX username_UNIQUE ON s_user ( username );
CREATE UNIQUE INDEX idcard_UNIQUE ON s_user ( idcard );