-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbscript.txt
54 lines (34 loc) · 1.8 KB
/
dbscript.txt
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
CREATE DATABASE backlog_mgmgt;
use backlog_mgmgt;
CREATE TABLE Users(id int NOT NULL AUTO_INCREMENT,
userName varchar(20),
password varchar(20),
role varchar(2),
email varchar(50),
PRIMARY KEY(id) );
CREATE TABLE Tasks(id int NOT NULL AUTO_INCREMENT,
title varchar(20),
description varchar(250),
creatorId int,
assigneeId int,
logHours int DEFAULT 0,
dueDate timestamp,
done int DEFAULT 0,
priority varchar(2) DEFAULT 'S',
PRIMARY KEY(id),
FOREIGN KEY(creatorId) REFERENCES Users(id),
FOREIGN KEY(assigneeId) REFERENCES Users(id));
#insert users
INSERT INTO Users(id, userName, password, role, email) VALUES(1,'Penda', 'pass', 'D','[email protected]');
INSERT INTO Users(id, userName, password, role, email) VALUES(2,'Pijo', 'pass', 'PO','[email protected]');
#insert tasks
INSERT INTO Tasks(id, title, description, creatorId, assigneeId, logHours, dueDate, done, priority)
VALUES(1, 'hash passwords', 'Hash user passwords before storing into database', 2, 1, 0, '2018-01-30', 1, 'XL');
INSERT INTO Tasks(id, title, description, creatorId, assigneeId, logHours, dueDate, done, priority)
VALUES(2, 'user management tab', 'Create tab for user management for admins', 2, 1, 0, '2018-02-10', 0, 'L');
INSERT INTO Tasks(id, title, description, creatorId, assigneeId, logHours, dueDate, done, priority)
VALUES(3, 'user creation', 'Introduce functionality for creating users', 2, 1, 1, '2018-02-20',2, 'XL');
INSERT INTO Tasks(id, title, description, creatorId, assigneeId, logHours, dueDate, done, priority)
VALUES(4, 'introduce more roles', 'Hash user passwords before storing into database', 2, 1, 2, '2018-02-30', 0, 'M');
INSERT INTO Tasks(id, title, description, creatorId, assigneeId, logHours, dueDate, done, priority)
VALUES(5, 'documentation', 'document user managment functionalities', 2, 1, 0, '2018-03-01',0, 'S');