· 8 years ago · Nov 21, 2017, 07:36 PM
1-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
2--
3-- Host: localhost Database: quest_35_bdd
4-- ------------------------------------------------------
5-- Server version 5.6.35
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Current Database: `quest_35_bdd`
20--
21
22CREATE DATABASE /*!32312 IF NOT EXISTS*/ `quest_35_bdd` /*!40100 DEFAULT CHARACTER SET utf8 */;
23
24USE `quest_35_bdd`;
25
26--
27-- Table structure for table `bookings`
28--
29
30DROP TABLE IF EXISTS `bookings`;
31/*!40101 SET @saved_cs_client = @@character_set_client */;
32/*!40101 SET character_set_client = utf8 */;
33CREATE TABLE `bookings` (
34 `idbookings` int(11) NOT NULL AUTO_INCREMENT,
35 `rooms_idrooms` int(11) NOT NULL,
36 `users_idusers` int(11) NOT NULL,
37 `date` datetime DEFAULT NULL,
38 `duration` int(11) DEFAULT NULL,
39 PRIMARY KEY (`idbookings`),
40 KEY `fk_bookings_rooms1_idx` (`rooms_idrooms`),
41 KEY `fk_bookings_users1_idx` (`users_idusers`),
42 CONSTRAINT `fk_bookings_rooms1` FOREIGN KEY (`rooms_idrooms`) REFERENCES `rooms` (`idrooms`) ON DELETE NO ACTION ON UPDATE NO ACTION,
43 CONSTRAINT `fk_bookings_users1` FOREIGN KEY (`users_idusers`) REFERENCES `users` (`idusers`) ON DELETE NO ACTION ON UPDATE NO ACTION
44) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
45/*!40101 SET character_set_client = @saved_cs_client */;
46
47--
48-- Dumping data for table `bookings`
49--
50
51LOCK TABLES `bookings` WRITE;
52/*!40000 ALTER TABLE `bookings` DISABLE KEYS */;
53INSERT INTO `bookings` VALUES (1,1,1,'2017-11-01 00:00:00',1),(2,1,2,'2017-11-02 00:00:00',1),(3,1,3,'2017-11-03 00:00:00',1),(4,5,4,'2017-11-04 00:00:00',1),(5,5,5,'2017-11-05 00:00:00',1),(6,3,6,'2017-11-06 00:00:00',1),(7,6,7,'2017-11-07 00:00:00',1),(8,6,8,'2017-11-08 00:00:00',1),(9,6,9,'2017-11-09 00:00:00',1),(10,6,10,'2017-11-10 00:00:00',1);
54/*!40000 ALTER TABLE `bookings` ENABLE KEYS */;
55UNLOCK TABLES;
56
57--
58-- Table structure for table `languages`
59--
60
61DROP TABLE IF EXISTS `languages`;
62/*!40101 SET @saved_cs_client = @@character_set_client */;
63/*!40101 SET character_set_client = utf8 */;
64CREATE TABLE `languages` (
65 `idlanguages` int(11) NOT NULL AUTO_INCREMENT,
66 `name` varchar(45) DEFAULT NULL,
67 PRIMARY KEY (`idlanguages`)
68) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
69/*!40101 SET character_set_client = @saved_cs_client */;
70
71--
72-- Dumping data for table `languages`
73--
74
75LOCK TABLES `languages` WRITE;
76/*!40000 ALTER TABLE `languages` DISABLE KEYS */;
77INSERT INTO `languages` VALUES (1,'PHP'),(2,'JavaScript');
78/*!40000 ALTER TABLE `languages` ENABLE KEYS */;
79UNLOCK TABLES;
80
81--
82-- Table structure for table `roles`
83--
84
85DROP TABLE IF EXISTS `roles`;
86/*!40101 SET @saved_cs_client = @@character_set_client */;
87/*!40101 SET character_set_client = utf8 */;
88CREATE TABLE `roles` (
89 `idrole` int(11) NOT NULL AUTO_INCREMENT,
90 `name` varchar(45) DEFAULT NULL,
91 PRIMARY KEY (`idrole`)
92) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
93/*!40101 SET character_set_client = @saved_cs_client */;
94
95--
96-- Dumping data for table `roles`
97--
98
99LOCK TABLES `roles` WRITE;
100/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
101INSERT INTO `roles` VALUES (1,'Teacher'),(2,'Student'),(3,'Admin');
102/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
103UNLOCK TABLES;
104
105--
106-- Table structure for table `rooms`
107--
108
109DROP TABLE IF EXISTS `rooms`;
110/*!40101 SET @saved_cs_client = @@character_set_client */;
111/*!40101 SET character_set_client = utf8 */;
112CREATE TABLE `rooms` (
113 `idrooms` int(11) NOT NULL AUTO_INCREMENT,
114 `schools_idschools` int(11) NOT NULL,
115 `name` varchar(45) DEFAULT NULL,
116 PRIMARY KEY (`idrooms`),
117 KEY `fk_rooms_schools_idx` (`schools_idschools`),
118 CONSTRAINT `fk_rooms_schools` FOREIGN KEY (`schools_idschools`) REFERENCES `schools` (`idschools`) ON DELETE NO ACTION ON UPDATE NO ACTION
119) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
120/*!40101 SET character_set_client = @saved_cs_client */;
121
122--
123-- Dumping data for table `rooms`
124--
125
126LOCK TABLES `rooms` WRITE;
127/*!40000 ALTER TABLE `rooms` DISABLE KEYS */;
128INSERT INTO `rooms` VALUES (1,1,'Salle de dojo'),(2,1,'Salle de réunion'),(3,1,'Salle de repos'),(4,1,'Cuisine'),(5,1,'Bureau'),(6,1,'OpenSpace');
129/*!40000 ALTER TABLE `rooms` ENABLE KEYS */;
130UNLOCK TABLES;
131
132--
133-- Table structure for table `schools`
134--
135
136DROP TABLE IF EXISTS `schools`;
137/*!40101 SET @saved_cs_client = @@character_set_client */;
138/*!40101 SET character_set_client = utf8 */;
139CREATE TABLE `schools` (
140 `idschools` int(11) NOT NULL AUTO_INCREMENT,
141 `name` varchar(45) DEFAULT NULL,
142 PRIMARY KEY (`idschools`)
143) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
144/*!40101 SET character_set_client = @saved_cs_client */;
145
146--
147-- Dumping data for table `schools`
148--
149
150LOCK TABLES `schools` WRITE;
151/*!40000 ALTER TABLE `schools` DISABLE KEYS */;
152INSERT INTO `schools` VALUES (1,'Paris');
153/*!40000 ALTER TABLE `schools` ENABLE KEYS */;
154UNLOCK TABLES;
155
156--
157-- Table structure for table `users`
158--
159
160DROP TABLE IF EXISTS `users`;
161/*!40101 SET @saved_cs_client = @@character_set_client */;
162/*!40101 SET character_set_client = utf8 */;
163CREATE TABLE `users` (
164 `idusers` int(11) NOT NULL AUTO_INCREMENT,
165 `languages_idlanguages` int(11) NOT NULL,
166 `roles_idrole` int(11) NOT NULL,
167 `firstname` varchar(45) DEFAULT NULL,
168 `lastname` varchar(45) DEFAULT NULL,
169 PRIMARY KEY (`idusers`),
170 KEY `fk_users_languages1_idx` (`languages_idlanguages`),
171 KEY `fk_users_roles1_idx` (`roles_idrole`),
172 CONSTRAINT `fk_users_languages1` FOREIGN KEY (`languages_idlanguages`) REFERENCES `languages` (`idlanguages`) ON DELETE NO ACTION ON UPDATE NO ACTION,
173 CONSTRAINT `fk_users_roles1` FOREIGN KEY (`roles_idrole`) REFERENCES `roles` (`idrole`) ON DELETE NO ACTION ON UPDATE NO ACTION
174) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
175/*!40101 SET character_set_client = @saved_cs_client */;
176
177--
178-- Dumping data for table `users`
179--
180
181LOCK TABLES `users` WRITE;
182/*!40000 ALTER TABLE `users` DISABLE KEYS */;
183INSERT INTO `users` VALUES (1,1,2,'Student 1','Student 1'),(2,1,2,'Student 2','Student 2'),(3,1,2,'Student 3','Student 3'),(4,1,2,'Student 4','Student 4'),(5,1,2,'Student 5','Student 5'),(6,1,2,'Student 6','Student 6'),(7,1,2,'Student 7','Student 7'),(8,1,2,'Student 8','Student 8'),(9,1,1,'Teacher 1','Teacher 1'),(10,2,1,'Teacher 2','Teacher 2');
184/*!40000 ALTER TABLE `users` ENABLE KEYS */;
185UNLOCK TABLES;
186/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
187
188/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
189/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
190/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
191/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
192/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
193/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
194/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
195
196-- Dump completed on 2017-11-20 10:51:46