-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.sql
85 lines (77 loc) · 2.6 KB
/
database.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-- DROP TABLE IF EXISTS `activity`;
CREATE TABLE `activity` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`project` int(11) DEFAULT NULL,
`name` varchar(150) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`name` varchar(150) DEFAULT NULL,
`number` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `project`;
CREATE TABLE `project` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`customer` int(11) DEFAULT NULL,
`name` varchar(150) DEFAULT NULL,
`start` datetime(3) DEFAULT NULL,
`end` datetime(3) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `team_project`;
CREATE TABLE `team_project` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`team_kimai_id` int(11) DEFAULT NULL,
`project_kimai_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `team_user`;
CREATE TABLE `team_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`team_kimai_id` int(11) DEFAULT NULL,
`user_kimai_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `team`;
CREATE TABLE `team` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `timesheet`;
CREATE TABLE `timesheet` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`activity` int(11) DEFAULT NULL,
`project` int(11) DEFAULT NULL,
`user` int(11) DEFAULT NULL,
`begin` datetime(3) DEFAULT NULL,
`end` datetime(3) DEFAULT NULL,
`duration` int(11) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`rate` double DEFAULT NULL,
`internalRate` double DEFAULT NULL,
`billable` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kimai_id` int(11) DEFAULT NULL,
`alias` varchar(60) DEFAULT NULL,
`username` varchar(60) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `kimai_id` (`kimai_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;