|
@@ -23,15 +23,15 @@ DROP TABLE IF EXISTS `forecast`;
|
23
|
23
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
24
|
24
|
/*!40101 SET character_set_client = utf8 */;
|
25
|
25
|
CREATE TABLE `forecast` (
|
26
|
|
- `user` int(11) NOT NULL,
|
|
26
|
+ `user` int(11) unsigned NOT NULL,
|
27
|
27
|
`ticket` int(10) unsigned NOT NULL,
|
28
|
28
|
`pessimist_forecast` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
29
|
29
|
`medium_forecast` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
30
|
30
|
`optimist_forecast` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
31
|
31
|
PRIMARY KEY (`user`,`ticket`),
|
32
|
32
|
KEY `ticket` (`ticket`),
|
33
|
|
- CONSTRAINT `forecast_ibfk_1` FOREIGN KEY (`user`) REFERENCES `users` (`id`),
|
34
|
|
- CONSTRAINT `forecast_ibfk_2` FOREIGN KEY (`ticket`) REFERENCES `ticket` (`id`)
|
|
33
|
+ CONSTRAINT `forecast_author` FOREIGN KEY (`user`) REFERENCES `user` (`id`),
|
|
34
|
+ CONSTRAINT `forecast_ticket` FOREIGN KEY (`ticket`) REFERENCES `ticket` (`id`)
|
35
|
35
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
36
|
36
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
37
|
37
|
|
|
@@ -59,11 +59,11 @@ CREATE TABLE `ticket` (
|
59
|
59
|
`project` int(10) unsigned DEFAULT NULL,
|
60
|
60
|
`done_time` timestamp NULL DEFAULT NULL,
|
61
|
61
|
`description` varchar(255) DEFAULT NULL,
|
62
|
|
- `author` int(11) DEFAULT NULL,
|
|
62
|
+ `author` int(11) unsigned DEFAULT NULL,
|
63
|
63
|
PRIMARY KEY (`id`),
|
64
|
64
|
KEY `project` (`project`),
|
65
|
65
|
KEY `ticket_author` (`author`),
|
66
|
|
- CONSTRAINT `ticket_author` FOREIGN KEY (`author`) REFERENCES `users` (`id`),
|
|
66
|
+ CONSTRAINT `ticket_author` FOREIGN KEY (`author`) REFERENCES `user` (`id`),
|
67
|
67
|
CONSTRAINT `ticket_ibfk_1` FOREIGN KEY (`project`) REFERENCES `ticket` (`id`)
|
68
|
68
|
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4;
|
69
|
69
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
@@ -79,14 +79,14 @@ INSERT INTO `ticket` VALUES (1,'tests oriented php-api-crud','2021-02-10 18:58:4
|
79
|
79
|
UNLOCK TABLES;
|
80
|
80
|
|
81
|
81
|
--
|
|
82
|
+-- Table structure for table `user`
|
82
|
83
|
--
|
83
|
84
|
|
84
|
85
|
DROP TABLE IF EXISTS `user`;
|
85
|
86
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
86
|
87
|
/*!40101 SET character_set_client = utf8 */;
|
87
|
88
|
CREATE TABLE `user` (
|
88
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
89
|
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
89
|
90
|
`username` varchar(255) NOT NULL,
|
90
|
91
|
`password` varchar(255) NOT NULL,
|
91
|
92
|
PRIMARY KEY (`id`)
|
|
@@ -94,13 +94,13 @@ CREATE TABLE `user` (
|
94
|
94
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
95
|
95
|
|
96
|
96
|
--
|
|
97
|
+-- Dumping data for table `user`
|
97
|
98
|
--
|
98
|
99
|
|
99
|
100
|
LOCK TABLES `user` WRITE;
|
100
|
|
-/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
|
101
|
+/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
101
|
102
|
INSERT INTO `user` VALUES (1,'nas','jJU6TkYuHMdAQ'),(2,'anon','murmure'),(3,'adminitrateur','$2y$10$1GqKFWKC4vchHqgf7qvyv.NA7VKyAjLfdkyjU5eZ9Wj.TbPBelaiW');
|
102
|
|
-/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
|
103
|
+/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
103
|
104
|
UNLOCK TABLES;
|
104
|
105
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
105
|
106
|
|
|
@@ -116,18 +116,18 @@ UNLOCK TABLES;
|
116
|
116
|
|
117
|
117
|
-- Dev staging --
|
118
|
118
|
--
|
|
119
|
+-- Table structure for table `user`
|
119
|
120
|
--
|
120
|
121
|
|
121
|
122
|
DROP TABLE IF EXISTS `assignment`;
|
122
|
123
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
123
|
124
|
/*!40101 SET character_set_client = utf8 */;
|
124
|
125
|
CREATE TABLE `assignment` (
|
125
|
|
- `user` int(11) NOT NULL,
|
126
|
|
- `ticket` int(11) NOT NULL,
|
|
126
|
+ `user` int(11) unsigned NOT NULL,
|
|
127
|
+ `ticket` int(10) unsigned NOT NULL,
|
127
|
128
|
`assigned` timestamp DEFAULT CURRENT_TIMESTAMP,
|
128
|
129
|
`minutesSpent` int(11),
|
129
|
|
- PRIMARY KEY (`id`, `ticket`),
|
|
130
|
+ PRIMARY KEY (`user`, `ticket`),
|
130
|
131
|
FOREIGN KEY (`user`) REFERENCES user(`id`),
|
131
|
132
|
FOREIGN KEY (`ticket`) REFERENCES ticket(`id`)
|
132
|
133
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
|