This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathhotel.sql
172 lines (142 loc) · 5.8 KB
/
hotel.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Apr 23, 2024 at 10:14 AM
-- Server version: 5.7.34
-- PHP Version: 7.4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `hotel`
--
-- --------------------------------------------------------
--
-- Table structure for table `booking`
--
CREATE TABLE `booking` (
`id` int(11) UNSIGNED NOT NULL,
`cid` int(11) UNSIGNED NOT NULL,
`status` varchar(100) COLLATE utf8mb4_unicode_520_ci DEFAULT 'pending',
`notes` varchar(500) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `booking`
--
INSERT INTO `booking` (`id`, `cid`, `status`, `notes`) VALUES
(12, 10, 'CONFIRMED', NULL),
(13, 10, 'confirmed', NULL),
(14, 10, 'CANCELLED', NULL),
(15, 13, 'CANCELLED', NULL),
(16, 13, 'CONFIRMED', NULL),
(17, 13, 'CANCELLED', NULL),
(18, 13, 'PENDING', NULL),
(19, 13, 'PENDING', NULL),
(20, 13, 'PENDING', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`cid` int(11) UNSIGNED NOT NULL,
`fullname` varchar(100) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`email` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`password` varchar(150) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`phone` varchar(25) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`isadmin` int(1) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`cid`, `fullname`, `email`, `password`, `phone`, `isadmin`) VALUES
(10, 'Martha Smith', '[email protected]', '$2y$10$L8elMrSO59YGZdGjnQxURuWK7FZUJpL8QgZPT7pKIwCu42PvU8Mm2', '5149991111', 0),
(11, '[email protected]', '[email protected]', '$2y$10$nfud5jYwEnMmqv8YgUF3p.wh3EVGAONlRUUiu2TqFiNW.GsU6QKGm', '', 1),
(12, '[email protected]', '[email protected]', '$2y$10$4FJtbVGCIpFnNxcDvSSXUueMESuDDoZvtygT/O4J9UHB1vfdO3Vza', '', 1),
(13, 'leo raymart ssdllllllc', '[email protected]', '$2y$10$OCKnJrI.F.AkEX1kASFr8Os8CnlnT0OYIH4ypwR2x4FSnSsO8ZfdG', 'hello there how are you d', 0),
(14, 'test', '[email protected]', '$2y$10$NvBB7Yiejyp1ZoMn3KpQ6.E35OWVLspbvpUjfe/h.51gbajAJzub2', '', 0);
-- --------------------------------------------------------
--
-- Table structure for table `reservation`
--
CREATE TABLE `reservation` (
`id` int(11) UNSIGNED NOT NULL,
`start` varchar(30) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`end` varchar(30) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`type` varchar(100) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`requirement` varchar(100) COLLATE utf8mb4_unicode_520_ci DEFAULT 'no preference',
`adults` int(2) NOT NULL,
`children` int(2) DEFAULT '0',
`requests` varchar(500) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`hash` varchar(100) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Dumping data for table `reservation`
--
INSERT INTO `reservation` (`id`, `start`, `end`, `type`, `requirement`, `adults`, `children`, `requests`, `timestamp`, `hash`) VALUES
(12, '2018-05-09', '2018-05-11', 'double', 'non smoking', 2, 0, '', '2018-04-19 22:04:42', '5ad9127abbdf6'),
(13, '2018-04-24', '2018-04-25', 'deluxe', 'no preference', 1, 0, '', '2018-04-23 15:45:33', '5addff9dafa97'),
(14, '2018-04-27', '2018-04-30', 'deluxe', 'no preference', 1, 0, '', '2018-04-24 05:27:13', '5adec03166177'),
(15, '2023-03-01', '2023-03-11', 'Single', 'non smoking', 3, 0, 'asd', '2023-02-26 20:42:39', '63fbc43fe4661'),
(16, '2023-03-02', '2023-03-10', 'Double', 'no preference', 2, 0, 'alert("hello");', '2023-02-26 20:48:43', '63fbc5abf0486'),
(17, '2023-02-27', '2023-03-11', 'Double', 'no preference', 2, 0, '', '2023-02-26 22:11:01', '63fbd8f561240'),
(18, '2023-02-27', '2023-03-05', 'Single', 'no preference', 1, 0, '', '2023-02-26 22:29:00', '63fbdd2c9e8dc'),
(19, '2023-02-26', '2023-03-11', 'Single', 'no preference', 1, 0, '', '2023-02-27 01:18:37', '63fc04ed64776'),
(20, '2023-02-26', '2023-03-11', 'Double', 'no preference', 1, 0, '', '2023-02-27 04:34:17', '63fc32c9c651c');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `booking`
--
ALTER TABLE `booking`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `booking_id_uindex` (`id`),
ADD KEY `booking_customer__fk` (`cid`);
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`cid`),
ADD UNIQUE KEY `id_UNIQUE` (`cid`);
--
-- Indexes for table `reservation`
--
ALTER TABLE `reservation`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `booking`
--
ALTER TABLE `booking`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
MODIFY `cid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `booking`
--
ALTER TABLE `booking`
ADD CONSTRAINT `booking_customer__fk` FOREIGN KEY (`cid`) REFERENCES `customer` (`cid`) ON DELETE CASCADE;
--
-- Constraints for table `reservation`
--
ALTER TABLE `reservation`
ADD CONSTRAINT `reservation_booking__fk` FOREIGN KEY (`id`) REFERENCES `booking` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;