-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sql
52 lines (42 loc) · 1.26 KB
/
init.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
DROP TABLE IF EXISTS `users`;
DROP TABLE IF EXISTS `time_cards`;
DROP TABLE IF EXISTS `items`;
CREATE TABLE `users` (
`uuid` char(36) NOT NULL,
`id` varchar(32) NOT NULL,
`point` int DEFAULT NULL,
`date` date NOT NULL,
PRIMARY KEY (`uuid`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `time_cards` (
`id` varchar(32),
`date` date,
`item_id` varchar(86) NOT NULL,
PRIMARY KEY (`id`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `items` (
`id` varchar(32) NOT NULL,
`description` varchar(86) DEFAULT NULL,
`point` int DEFAULT NULL,
`report` int DEFAULT NULL,
UNIQUE KEY `id` (`id`),
UNIQUE KEY `description` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `users` WRITE;
INSERT INTO `users` (`uuid`,`id`, `point`, `date`)
VALUES
("33a123f4-067b-4ec5-9060-4d03da4c4aca",'trap',2,"2023-06-17");
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_cards` WRITE;
INSERT INTO `time_cards` (`id`, `date`, `item_id`)
VALUES
('traP', '2023-06-17','Get');
/*!40000 ALTER TABLE `time_cards` DISABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `items` WRITE;
INSERT INTO `items` (`id`,`point`,`report`)
VALUES
('Get',3,5);
/*!40000 ALTER TABLE `items` DISABLE KEYS */;
UNLOCK TABLES;