Skip to content

Commit fc7ca43

Browse files
author
Zahrun
committed
Database backup
1 parent e4c38dd commit fc7ca43

File tree

2 files changed

+350
-48
lines changed

2 files changed

+350
-48
lines changed

SopraBD-2015-11-04.sql

+271
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 3.4.11.1deb2+deb7u2
3+
-- http://www.phpmyadmin.net
4+
--
5+
-- Host: localhost
6+
-- Generation Time: Dec 04, 2015 at 08:51 AM
7+
-- Server version: 5.5.46
8+
-- PHP Version: 5.4.4-14+deb7u5
9+
10+
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11+
SET time_zone = "+00:00";
12+
13+
14+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17+
/*!40101 SET NAMES utf8 */;
18+
19+
--
20+
-- Database: `SopraBD`
21+
--
22+
23+
-- --------------------------------------------------------
24+
25+
--
26+
-- Table structure for table `Equipments`
27+
--
28+
29+
CREATE TABLE IF NOT EXISTS `Equipments` (
30+
`equipmentID` int(3) unsigned NOT NULL AUTO_INCREMENT,
31+
`description` text COLLATE utf8_unicode_ci,
32+
PRIMARY KEY (`equipmentID`)
33+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
34+
35+
--
36+
-- Dumping data for table `Equipments`
37+
--
38+
39+
INSERT INTO `Equipments` (`equipmentID`, `description`) VALUES
40+
(1, 'Visio'),
41+
(2, 'Téléphone'),
42+
(3, 'Salle Digilab'),
43+
(4, 'Sécurisée');
44+
45+
-- --------------------------------------------------------
46+
47+
--
48+
-- Table structure for table `InvitedUsers`
49+
--
50+
51+
CREATE TABLE IF NOT EXISTS `InvitedUsers` (
52+
`invitedUserID` int(10) unsigned NOT NULL AUTO_INCREMENT,
53+
`reservationRef` int(10) unsigned NOT NULL,
54+
`userRef` int(10) unsigned NOT NULL,
55+
PRIMARY KEY (`invitedUserID`),
56+
KEY `userRef` (`userRef`),
57+
KEY `reservationRef` (`reservationRef`)
58+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
59+
60+
--
61+
-- Dumping data for table `InvitedUsers`
62+
--
63+
64+
INSERT INTO `InvitedUsers` (`invitedUserID`, `reservationRef`, `userRef`) VALUES
65+
(1, 1, 2),
66+
(2, 2, 2),
67+
(3, 3, 1);
68+
69+
-- --------------------------------------------------------
70+
71+
--
72+
-- Table structure for table `OldInvitedUsers`
73+
--
74+
75+
CREATE TABLE IF NOT EXISTS `OldInvitedUsers` (
76+
`oldInvitedUserID` int(10) unsigned NOT NULL AUTO_INCREMENT,
77+
`oldReservationRef` int(12) unsigned NOT NULL,
78+
`userRef` int(10) unsigned NOT NULL,
79+
PRIMARY KEY (`oldInvitedUserID`),
80+
KEY `oldReservationRef` (`oldReservationRef`),
81+
KEY `oldInvitedUserID` (`userRef`)
82+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
83+
84+
-- --------------------------------------------------------
85+
86+
--
87+
-- Table structure for table `OldReservations`
88+
--
89+
90+
CREATE TABLE IF NOT EXISTS `OldReservations` (
91+
`oldReservationID` int(12) unsigned NOT NULL AUTO_INCREMENT,
92+
`roomRef` int(10) unsigned NOT NULL,
93+
`start` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
94+
`end` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
95+
`ownerRef` int(10) unsigned NOT NULL,
96+
PRIMARY KEY (`oldReservationID`),
97+
KEY `roomRef` (`roomRef`),
98+
KEY `ownerRef` (`ownerRef`)
99+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
100+
101+
-- --------------------------------------------------------
102+
103+
--
104+
-- Table structure for table `Reservations`
105+
--
106+
107+
CREATE TABLE IF NOT EXISTS `Reservations` (
108+
`reservationID` int(10) unsigned NOT NULL AUTO_INCREMENT,
109+
`roomRef` int(5) unsigned NOT NULL,
110+
`start` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
111+
`end` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
112+
`ownerRef` int(10) unsigned NOT NULL,
113+
PRIMARY KEY (`reservationID`),
114+
KEY `roomRef` (`roomRef`),
115+
KEY `ownerRef` (`ownerRef`)
116+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
117+
118+
--
119+
-- Dumping data for table `Reservations`
120+
--
121+
122+
INSERT INTO `Reservations` (`reservationID`, `roomRef`, `start`, `end`, `ownerRef`) VALUES
123+
(1, 1, '2015-12-07 11:18:54', '2015-12-11 10:20:54', 1),
124+
(2, 3, '2015-12-22 09:00:00', '2015-12-22 13:00:00', 1),
125+
(3, 3, '2015-12-15 23:00:00', '2015-12-17 22:59:59', 2);
126+
127+
-- --------------------------------------------------------
128+
129+
--
130+
-- Table structure for table `RoomEquipments`
131+
--
132+
133+
CREATE TABLE IF NOT EXISTS `RoomEquipments` (
134+
`roomEquipmentID` int(10) unsigned NOT NULL AUTO_INCREMENT,
135+
`roomRef` int(5) unsigned NOT NULL,
136+
`equipmentRef` int(3) unsigned NOT NULL,
137+
PRIMARY KEY (`roomEquipmentID`),
138+
KEY `roomRef` (`roomRef`),
139+
KEY `equipmentRef` (`equipmentRef`)
140+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
141+
142+
--
143+
-- Dumping data for table `RoomEquipments`
144+
--
145+
146+
INSERT INTO `RoomEquipments` (`roomEquipmentID`, `roomRef`, `equipmentRef`) VALUES
147+
(1, 1, 1),
148+
(2, 1, 2),
149+
(3, 2, 4),
150+
(4, 3, 3),
151+
(5, 3, 1),
152+
(6, 3, 2);
153+
154+
-- --------------------------------------------------------
155+
156+
--
157+
-- Table structure for table `Rooms`
158+
--
159+
160+
CREATE TABLE IF NOT EXISTS `Rooms` (
161+
`roomID` int(5) unsigned NOT NULL AUTO_INCREMENT,
162+
`siteRef` int(4) unsigned NOT NULL,
163+
`number` text COLLATE utf8_unicode_ci NOT NULL,
164+
`capacity` smallint(4) NOT NULL,
165+
PRIMARY KEY (`roomID`),
166+
KEY `siteRef` (`siteRef`)
167+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
168+
169+
--
170+
-- Dumping data for table `Rooms`
171+
--
172+
173+
INSERT INTO `Rooms` (`roomID`, `siteRef`, `number`, `capacity`) VALUES
174+
(1, 1, 'Salle Fourier', 60),
175+
(2, 1, 'Salle 102', 30),
176+
(3, 2, 'Salle 3', 3);
177+
178+
-- --------------------------------------------------------
179+
180+
--
181+
-- Table structure for table `Sites`
182+
--
183+
184+
CREATE TABLE IF NOT EXISTS `Sites` (
185+
`siteID` int(4) unsigned NOT NULL AUTO_INCREMENT,
186+
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
187+
`address` text COLLATE utf8_unicode_ci NOT NULL,
188+
`description` text COLLATE utf8_unicode_ci,
189+
PRIMARY KEY (`siteID`)
190+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
191+
192+
--
193+
-- Dumping data for table `Sites`
194+
--
195+
196+
INSERT INTO `Sites` (`siteID`, `name`, `address`, `description`) VALUES
197+
(1, 'INSA Toulouse', 'Avenue de Rangueil', 'Le meilleur endroit du monde'),
198+
(2, 'GEI', 'Impasse de l''informatique', NULL);
199+
200+
-- --------------------------------------------------------
201+
202+
--
203+
-- Table structure for table `Users`
204+
--
205+
206+
CREATE TABLE IF NOT EXISTS `Users` (
207+
`userID` int(10) unsigned NOT NULL AUTO_INCREMENT,
208+
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
209+
`surname` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
210+
`mailAddress` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
211+
`password` text COLLATE utf8_unicode_ci NOT NULL,
212+
`admin` tinyint(1) NOT NULL DEFAULT '0',
213+
PRIMARY KEY (`userID`)
214+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
215+
216+
--
217+
-- Dumping data for table `Users`
218+
--
219+
220+
INSERT INTO `Users` (`userID`, `name`, `surname`, `mailAddress`, `password`, `admin`) VALUES
221+
(1, 'Le Botlan', 'Didier', '[email protected]', 'pizza', 1),
222+
(2, 'Marre', 'Daniel', '[email protected]', 'marre', 0);
223+
224+
--
225+
-- Constraints for dumped tables
226+
--
227+
228+
--
229+
-- Constraints for table `InvitedUsers`
230+
--
231+
ALTER TABLE `InvitedUsers`
232+
ADD CONSTRAINT `InvitedUsers_ibfk_2` FOREIGN KEY (`userRef`) REFERENCES `Users` (`userID`),
233+
ADD CONSTRAINT `InvitedUsers_ibfk_1` FOREIGN KEY (`reservationRef`) REFERENCES `Reservations` (`reservationID`);
234+
235+
--
236+
-- Constraints for table `OldInvitedUsers`
237+
--
238+
ALTER TABLE `OldInvitedUsers`
239+
ADD CONSTRAINT `OldInvitedUsers_ibfk_2` FOREIGN KEY (`userRef`) REFERENCES `Users` (`userID`),
240+
ADD CONSTRAINT `OldInvitedUsers_ibfk_1` FOREIGN KEY (`oldReservationRef`) REFERENCES `OldReservations` (`oldReservationID`);
241+
242+
--
243+
-- Constraints for table `OldReservations`
244+
--
245+
ALTER TABLE `OldReservations`
246+
ADD CONSTRAINT `OldReservations_ibfk_2` FOREIGN KEY (`ownerRef`) REFERENCES `Users` (`userID`),
247+
ADD CONSTRAINT `OldReservations_ibfk_1` FOREIGN KEY (`roomRef`) REFERENCES `Rooms` (`roomID`);
248+
249+
--
250+
-- Constraints for table `Reservations`
251+
--
252+
ALTER TABLE `Reservations`
253+
ADD CONSTRAINT `Reservations_ibfk_2` FOREIGN KEY (`ownerRef`) REFERENCES `Users` (`userID`),
254+
ADD CONSTRAINT `Reservations_ibfk_1` FOREIGN KEY (`roomRef`) REFERENCES `Rooms` (`roomID`);
255+
256+
--
257+
-- Constraints for table `RoomEquipments`
258+
--
259+
ALTER TABLE `RoomEquipments`
260+
ADD CONSTRAINT `RoomEquipments_ibfk_1` FOREIGN KEY (`roomRef`) REFERENCES `Rooms` (`roomID`),
261+
ADD CONSTRAINT `RoomEquipments_ibfk_2` FOREIGN KEY (`equipmentRef`) REFERENCES `Equipments` (`equipmentID`);
262+
263+
--
264+
-- Constraints for table `Rooms`
265+
--
266+
ALTER TABLE `Rooms`
267+
ADD CONSTRAINT `Rooms_ibfk_1` FOREIGN KEY (`siteRef`) REFERENCES `Sites` (`siteID`);
268+
269+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
270+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
271+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

0 commit comments

Comments
 (0)