-
Notifications
You must be signed in to change notification settings - Fork 1
/
dbStructureBackup.sql
263 lines (217 loc) · 6.67 KB
/
dbStructureBackup.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 07, 2020 at 01:32 AM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `MainLand`
--
-- --------------------------------------------------------
--
-- Table structure for table `Action_log`
--
CREATE TABLE `Action_log` (
`id` int(11) NOT NULL,
`description` text NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `admin_login`
--
CREATE TABLE `admin_login` (
`id` int(11) NOT NULL,
`token` text NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `Houses`
--
CREATE TABLE `Houses` (
`id` int(11) NOT NULL,
`description` text NOT NULL,
`fixed_price` varchar(50) NOT NULL,
`onInstalment` tinyint(1) NOT NULL DEFAULT '0',
`status` set('listed','unlisted','sold') NOT NULL DEFAULT 'listed',
`size_measure_unit` set('sqft','sqm','sqkm','hectare','car park') NOT NULL DEFAULT 'car park',
`size_measurement` int(11) NOT NULL,
`category` set('new','distressed') NOT NULL,
`address` varchar(255) NOT NULL,
`Country` set('Nigeria') NOT NULL DEFAULT 'Nigeria',
`State` set('Lagos') NOT NULL DEFAULT 'Lagos',
`area_located` varchar(50) NOT NULL,
`propType` set('detached','semi-detached','terraced') NOT NULL,
`houseCategory` set('Duplex','Shopping Complex','bungalow') NOT NULL DEFAULT 'Duplex',
`fixed_price_currency` set('NGN') NOT NULL DEFAULT 'NGN',
`room` int(11) NOT NULL,
`bath` int(11) NOT NULL,
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`amenities` text,
`features` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `House_instalment_plan`
--
CREATE TABLE `House_instalment_plan` (
`id` int(11) NOT NULL,
`house_id` int(11) NOT NULL,
`per` set('week','month','year') NOT NULL,
`instalment` varchar(50) NOT NULL,
`minPayTimes` int(11) NOT NULL,
`maxPayTimes` int(11) NOT NULL,
`currency` set('NGN') NOT NULL DEFAULT 'NGN'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `House_photo_gallery`
--
CREATE TABLE `House_photo_gallery` (
`id` int(11) NOT NULL,
`view` set('front','back','bath','dinning','right','left','kitchen','bed','palour') DEFAULT NULL,
`house_id` int(11) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`ext` varchar(100) NOT NULL,
`date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`image` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `House_request`
--
CREATE TABLE `House_request` (
`id` int(11) NOT NULL,
`email` varchar(100) NOT NULL,
`fullName` varchar(100) NOT NULL,
`personal_note` varchar(255) DEFAULT NULL,
`payment_duration` int(11) NOT NULL DEFAULT '1',
`house_id` int(11) NOT NULL,
`offer` set('full','installment') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `site_setting`
--
CREATE TABLE `site_setting` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `Action_log`
--
ALTER TABLE `Action_log`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `admin_login`
--
ALTER TABLE `admin_login`
ADD UNIQUE KEY `id` (`id`),
ADD UNIQUE KEY `username` (`username`);
--
-- Indexes for table `Houses`
--
ALTER TABLE `Houses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `House_instalment_plan`
--
ALTER TABLE `House_instalment_plan`
ADD PRIMARY KEY (`id`),
ADD KEY `house_id` (`house_id`);
--
-- Indexes for table `House_photo_gallery`
--
ALTER TABLE `House_photo_gallery`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `image` (`image`),
ADD KEY `house_id` (`house_id`);
--
-- Indexes for table `House_request`
--
ALTER TABLE `House_request`
ADD PRIMARY KEY (`id`),
ADD KEY `house_id` (`house_id`);
--
-- Indexes for table `site_setting`
--
ALTER TABLE `site_setting`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `Action_log`
--
ALTER TABLE `Action_log`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `admin_login`
--
ALTER TABLE `admin_login`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `Houses`
--
ALTER TABLE `Houses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `House_instalment_plan`
--
ALTER TABLE `House_instalment_plan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `House_photo_gallery`
--
ALTER TABLE `House_photo_gallery`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `House_request`
--
ALTER TABLE `House_request`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `site_setting`
--
ALTER TABLE `site_setting`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `House_instalment_plan`
--
ALTER TABLE `House_instalment_plan`
ADD CONSTRAINT `House_instalment_plan_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `Houses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `House_photo_gallery`
--
ALTER TABLE `House_photo_gallery`
ADD CONSTRAINT `House_photo_gallery_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `Houses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `House_request`
--
ALTER TABLE `House_request`
ADD CONSTRAINT `House_request_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `Houses` (`id`) ON UPDATE 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 */;