3 CREATE TABLE category (
4 idcategory INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
5 name VARCHAR(45) NOT NULL
8 CREATE TABLE statuses (
9 idstatus INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
10 name ENUM('TODO', 'START', 'DONE', 'CANCEL') NOT NULL
13 CREATE TABLE deadline (
14 iddeadline INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
18 CREATE TABLE schedule (
19 idschedule INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
24 iduser INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
25 fname VARCHAR(45) NOT NULL ,
26 lname VARCHAR(45) NOT NULL ,
27 job VARCHAR(45) NOT NULL ,
28 email VARCHAR(20) NOT NULL ,
30 nickname VARCHAR(45) NULL ,
31 password VARCHAR(65) NOT NULL
35 idboss INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
36 iduser INT(11) NOT NULL REFERENCES users (iduser )
39 CREATE TABLE priority (
40 idpriority INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
41 name ENUM('A', 'B', 'C') NOT NULL
45 idtask INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
46 idpriority INT(11) NULL REFERENCES priority (idpriority ),
47 idboss INT(11) NOT NULL REFERENCES boss (idboss ),
48 idschedule INT(11) NULL REFERENCES schedule (idschedule ),
49 iddeadline INT(11) NULL REFERENCES deadline (iddeadline ),
50 idcategory INT(11) NULL REFERENCES category (idcategory ),
51 idstatus INT(11) NULL REFERENCES statuses (idstatus ),
52 name VARCHAR(45) NOT NULL
55 CREATE TABLE subtask (
56 idsubtask INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
57 idtask INT(11) NOT NULL REFERENCES task (idtask ),
58 idstatus INT(11) NULL REFERENCES statuses (idstatus ),
59 iddeadline INT(11) NULL REFERENCES deadline (iddeadline ),
60 idschedule INT(11) NULL REFERENCES schedule (idschedule ),
61 idpriority INT(11) NULL REFERENCES priority (idpriority ),
62 name VARCHAR(45) NOT NULL
65 CREATE TABLE comments (
66 idcomment INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
67 idtask INT(11) NOT NULL REFERENCES task (idtask ),
68 idsubtask INT(11) NOT NULL REFERENCES subtask (idsubtask ),
69 comments TEXT NOT NULL
73 idtask INT(11) NOT NULL,
74 tag VARCHAR(45) NOT NULL REFERENCES task (idtask ),
75 PRIMARY KEY (idtask, tag)
78 CREATE TABLE members (
79 idmember INT(11) NOT NULL AUTO_INCREMENT,
80 iduser INT(11) NOT NULL REFERENCES users (iduser ),
81 idtask INT(11) NOT NULL REFERENCES task (idtask ),
82 PRIMARY KEY (idmember, iduser, idtask)