· 6 years ago · Jan 25, 2020, 12:12 PM
1/*!40101 SET NAMES utf8 */;
2
3/*!40101 SET SQL_MODE=''*/;
4
5/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
6/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
7/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
8/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
9
10/*Table structure for table `administrators` */
11
12DROP TABLE IF EXISTS `administrators`;
13
14CREATE TABLE `administrators` (
15 `idAdmin` int(11) NOT NULL AUTO_INCREMENT,
16 `login` varchar(50) NOT NULL DEFAULT '0',
17 `passwd` varchar(255) NOT NULL DEFAULT '0',
18 `privType` tinyint(1) NOT NULL DEFAULT '0',
19 `Name` varchar(100) NOT NULL DEFAULT '0',
20 `isSu` tinyint(1) DEFAULT '0',
21 `isActive` tinyint(1) NOT NULL DEFAULT '1',
22 `attempts` tinyint(1) NOT NULL DEFAULT '0',
23 `created` int(11) NOT NULL DEFAULT '1',
24 `updated` int(11) NOT NULL DEFAULT '1',
25 PRIMARY KEY (`idAdmin`)
26) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
27
28/*Data for the table `administrators` */
29
30insert into `administrators`(`idAdmin`,`login`,`passwd`,`privType`,`Name`,`isSu`,`isActive`,`attempts`,`created`,`updated`) values
31(1,'admin','$2y$10$pbLSn.Kt9VLsHFL6OrxDY.v3RQu0Droz604j655n8GPu.nnxMz086',1,'Super user',1,1,0,123,123);
32
33/*Table structure for table `apartments` */
34
35DROP TABLE IF EXISTS `apartments`;
36
37CREATE TABLE `apartments` (
38 `id` int(11) NOT NULL AUTO_INCREMENT,
39 `idUser` int(11) DEFAULT '0',
40 `type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'apartment',
41 `url` varchar(255) DEFAULT NULL,
42 `thumbnail` int(11) DEFAULT '0',
43 `isActive` tinyint(1) DEFAULT '0',
44 `isInRent` tinyint(1) DEFAULT '0',
45 `price` double(16,4) DEFAULT NULL,
46 `created` int(11) DEFAULT '0',
47 `updated` int(11) DEFAULT '0',
48 PRIMARY KEY (`id`)
49) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
50
51/*Data for the table `apartments` */
52
53/*Table structure for table `apartments_availability` */
54
55DROP TABLE IF EXISTS `apartments_availability`;
56
57CREATE TABLE `apartments_availability` (
58 `id` int(11) NOT NULL AUTO_INCREMENT,
59 `idParameter` int(11) DEFAULT NULL,
60 `availableFrom` int(11) DEFAULT '0',
61 `availableUntil` int(11) DEFAULT '0',
62 PRIMARY KEY (`id`),
63 KEY `idParameter` (`idParameter`),
64 CONSTRAINT `apartments_availability_ibfk_1` FOREIGN KEY (`idParameter`) REFERENCES `apartments_parameters` (`id`) ON DELETE CASCADE
65) ENGINE=InnoDB DEFAULT CHARSET=utf8;
66
67/*Data for the table `apartments_availability` */
68
69/*Table structure for table `apartments_descriptions` */
70
71DROP TABLE IF EXISTS `apartments_descriptions`;
72
73CREATE TABLE `apartments_descriptions` (
74 `id` int(11) NOT NULL AUTO_INCREMENT,
75 `idApartment` int(11) NOT NULL,
76 `title` varchar(200) DEFAULT NULL,
77 `description` text,
78 PRIMARY KEY (`id`),
79 KEY `Apartment ID from description` (`idApartment`),
80 CONSTRAINT `Apartment ID from description` FOREIGN KEY (`idApartment`) REFERENCES `apartments` (`id`) ON DELETE CASCADE
81) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
82
83/*Data for the table `apartments_descriptions` */
84
85/*Table structure for table `apartments_gallery` */
86
87DROP TABLE IF EXISTS `apartments_gallery`;
88
89CREATE TABLE `apartments_gallery` (
90 `id` int(11) NOT NULL AUTO_INCREMENT,
91 `idApartment` int(11) DEFAULT '0',
92 `targetFolder` varchar(50) DEFAULT NULL,
93 `hashName` varchar(255) DEFAULT NULL,
94 PRIMARY KEY (`id`)
95) ENGINE=InnoDB DEFAULT CHARSET=utf8;
96
97/*Data for the table `apartments_gallery` */
98
99/*Table structure for table `apartments_groups` */
100
101DROP TABLE IF EXISTS `apartments_groups`;
102
103CREATE TABLE `apartments_groups` (
104 `id` int(11) NOT NULL AUTO_INCREMENT,
105 `sysName` varchar(50) DEFAULT NULL,
106 `humanName` varchar(100) DEFAULT NULL,
107 PRIMARY KEY (`id`)
108) ENGINE=InnoDB DEFAULT CHARSET=utf8;
109
110/*Data for the table `apartments_groups` */
111
112/*Table structure for table `apartments_locations` */
113
114DROP TABLE IF EXISTS `apartments_locations`;
115
116CREATE TABLE `apartments_locations` (
117 `id` int(11) NOT NULL AUTO_INCREMENT,
118 `country` varchar(100) DEFAULT NULL,
119 `city` varchar(100) DEFAULT NULL,
120 `region` varchar(100) DEFAULT NULL,
121 `created` int(11) DEFAULT '0',
122 `updated` int(11) DEFAULT '0',
123 PRIMARY KEY (`id`)
124) ENGINE=InnoDB DEFAULT CHARSET=utf8;
125
126/*Data for the table `apartments_locations` */
127
128/*Table structure for table `apartments_parameters` */
129
130DROP TABLE IF EXISTS `apartments_parameters`;
131
132CREATE TABLE `apartments_parameters` (
133 `id` int(11) NOT NULL AUTO_INCREMENT,
134 `idApartment` int(11) NOT NULL,
135 `idDescription` int(11) DEFAULT NULL,
136 `location` varchar(255) DEFAULT NULL,
137 `children` int(2) DEFAULT '0',
138 `adults` int(2) DEFAULT '0',
139 `beds` int(2) DEFAULT '0',
140 `square` int(3) DEFAULT '0',
141 `additional` text,
142 `created` int(11) DEFAULT '0',
143 `updated` int(11) DEFAULT '0',
144 PRIMARY KEY (`id`),
145 KEY `Apartment description ID` (`idDescription`),
146 KEY `Apartment ID from params` (`idApartment`),
147 CONSTRAINT `Apartment ID from params` FOREIGN KEY (`idApartment`) REFERENCES `apartments` (`id`) ON DELETE CASCADE,
148 CONSTRAINT `Apartment description ID` FOREIGN KEY (`idDescription`) REFERENCES `apartments_descriptions` (`id`) ON DELETE CASCADE
149) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
150
151/*Data for the table `apartments_parameters` */
152
153/*Table structure for table `apartments_requests` */
154
155DROP TABLE IF EXISTS `apartments_requests`;
156
157CREATE TABLE `apartments_requests` (
158 `id` int(11) NOT NULL AUTO_INCREMENT,
159 `idUser` int(11) DEFAULT '0',
160 `idApartment` int(11) DEFAULT '0',
161 `requestNumber` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
162 `message` text,
163 `status` tinyint(1) DEFAULT '0',
164 `created` int(11) DEFAULT '0',
165 PRIMARY KEY (`id`)
166) ENGINE=InnoDB DEFAULT CHARSET=utf8;
167
168/*Data for the table `apartments_requests` */
169
170/*Table structure for table `auth_tokens` */
171
172DROP TABLE IF EXISTS `auth_tokens`;
173
174CREATE TABLE `auth_tokens` (
175 `idToken` int(11) NOT NULL AUTO_INCREMENT,
176 `token` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
177 `tokenFor` varchar(200) DEFAULT NULL,
178 `isActive` tinyint(1) DEFAULT '0',
179 `created` int(11) DEFAULT '0',
180 `updated` int(11) DEFAULT '0',
181 PRIMARY KEY (`idToken`)
182) ENGINE=InnoDB DEFAULT CHARSET=utf8;
183
184/*Data for the table `auth_tokens` */
185
186/*Table structure for table `chat_messages` */
187
188DROP TABLE IF EXISTS `chat_messages`;
189
190CREATE TABLE `chat_messages` (
191 `id` int(11) NOT NULL AUTO_INCREMENT,
192 `senderId` int(11) DEFAULT '0',
193 `userId` int(11) DEFAULT NULL,
194 `msg` text,
195 `isReadByAdmin` tinyint(1) DEFAULT '0',
196 `isRead` tinyint(1) DEFAULT '0',
197 `isAdmin` tinyint(1) DEFAULT '0',
198 `created` int(11) DEFAULT '0',
199 PRIMARY KEY (`id`)
200) ENGINE=InnoDB DEFAULT CHARSET=utf8;
201
202/*Data for the table `chat_messages` */
203
204/*Table structure for table `contact` */
205
206DROP TABLE IF EXISTS `contact`;
207
208CREATE TABLE `contact` (
209 `idMsg` int(11) NOT NULL AUTO_INCREMENT,
210 `contactEmail` varchar(150) DEFAULT '0',
211 `contactText` text,
212 `ip` varchar(150) DEFAULT NULL,
213 `answered` tinyint(11) DEFAULT '0',
214 `created` int(11) DEFAULT '0',
215 KEY `idMsg` (`idMsg`)
216) ENGINE=InnoDB DEFAULT CHARSET=utf8;
217
218/*Data for the table `contact` */
219
220/*Table structure for table `currencies` */
221
222DROP TABLE IF EXISTS `currencies`;
223
224CREATE TABLE `currencies` (
225 `id` int(11) NOT NULL AUTO_INCREMENT,
226 `currencyCode` varchar(5) DEFAULT NULL,
227 `currencyName` varchar(35) DEFAULT NULL,
228 `exchangeRate` double(16,5) DEFAULT '0.00000',
229 `created` int(11) DEFAULT NULL,
230 PRIMARY KEY (`id`)
231) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
232
233/*Data for the table `currencies` */
234
235insert into `currencies`(`id`,`currencyCode`,`currencyName`,`exchangeRate`,`created`) values
236(1,'EUR','Евро',18.50000,12313123),
237(2,'USD','Доллар',16.50000,1576895741);
238
239/*Table structure for table `orders_list` */
240
241DROP TABLE IF EXISTS `orders_list`;
242
243CREATE TABLE `orders_list` (
244 `id` int(11) NOT NULL AUTO_INCREMENT,
245 `idUser` int(11) DEFAULT NULL,
246 PRIMARY KEY (`id`)
247) ENGINE=InnoDB DEFAULT CHARSET=utf8;
248
249/*Data for the table `orders_list` */
250
251/*Table structure for table `push_clients` */
252
253DROP TABLE IF EXISTS `push_clients`;
254
255CREATE TABLE `push_clients` (
256 `id` int(11) NOT NULL AUTO_INCREMENT,
257 `pushToken` varchar(255) DEFAULT NULL,
258 `created` int(11) DEFAULT '0',
259 `updated` int(11) DEFAULT '0',
260 PRIMARY KEY (`id`)
261) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
262
263/*Data for the table `push_clients` */
264
265insert into `push_clients`(`id`,`pushToken`,`created`,`updated`) values
266(2,'W',1574466691,1574466691),
267(3,'WEIJFIWEJF293JWFIWENFWENF239WEFFIWIOJFIWQF2',1574545530,1574545530);
268
269/*Table structure for table `push_notifications` */
270
271DROP TABLE IF EXISTS `push_notifications`;
272
273CREATE TABLE `push_notifications` (
274 `int` int(11) NOT NULL AUTO_INCREMENT,
275 `fcmToken` varchar(255) DEFAULT NULL,
276 `userId` int(11) DEFAULT '0',
277 `msgTitle` varchar(100) DEFAULT NULL,
278 `msgContent` text,
279 `created` int(11) DEFAULT '0',
280 `updated` int(11) DEFAULT '0',
281 PRIMARY KEY (`int`)
282) ENGINE=InnoDB DEFAULT CHARSET=utf8;
283
284/*Data for the table `push_notifications` */
285
286/*Table structure for table `registered_users` */
287
288DROP TABLE IF EXISTS `registered_users`;
289
290CREATE TABLE `registered_users` (
291 `id` int(11) NOT NULL AUTO_INCREMENT,
292 `userName` varchar(100) DEFAULT NULL,
293 `userType` enum('guest','registered') DEFAULT NULL,
294 `authToken` varchar(100) DEFAULT NULL,
295 `idPushClient` int(11) DEFAULT '0',
296 `passwd` varchar(100) DEFAULT NULL,
297 `phoneNumber` varchar(70) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
298 `email` varchar(150) DEFAULT NULL,
299 `ipAddr` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
300 `fullName` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
301 `isActive` tinyint(1) DEFAULT '0',
302 `canSell` tinyint(1) DEFAULT '0',
303 `filterName` varchar(255) DEFAULT NULL,
304 `created` int(11) DEFAULT '0',
305 `updated` int(11) DEFAULT '0',
306 PRIMARY KEY (`id`)
307) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
308
309/*Data for the table `registered_users` */
310
311insert into `registered_users`(`id`,`userName`,`userType`,`authToken`,`idPushClient`,`passwd`,`phoneNumber`,`email`,`ipAddr`,`fullName`,`isActive`,`canSell`,`filterName`,`created`,`updated`) values
312(1,'qweqweqweqwe','registered','386b9729aec17ac4dd68',2,'$2y$10$3Ekwkj0Q9Nd9li7kklAh0eY2H2JEGlrG4IoLb94gV9YCNJEB9nqe2','+37377777158','tester@gmail.com','127.0.0.1','test test3QQ',0,1,'tesssstt',1573767136,1573767136),
313(5,'dratuti','guest','a072a59c81e8064cda00',3,NULL,'+37377777151','dratuti@gmail.com','127.0.0.1','дратути',1,0,NULL,1574545943,1574545943),
314(6,'admin',NULL,NULL,0,'$2y$10$Wc7aqUrzVaWiFiS/Aom8OOHbUVoN.JXfMgurfneoAIayt1g5HWto6','+37377747542','adminadmin@gmail.com','127.0.0.1','adminadminwqeq',1,1,NULL,1576897249,1576897249);
315
316/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
317/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
318/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
319/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;