SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
-- Table `about`
CREATE TABLE `about` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` int(10) NOT NULL,
`title` varchar(100) NOT NULL,
`content` longtext NOT NULL,
`image` varchar(300) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `about` (`id`, `title`, `content`, `image`) VALUES
(10, 'About Us', '<div id=\"pgc-w5d0dcc3394ac1-0-0\" class=\"panel-grid-cell\">\r\
n<div id=\"panel-w5d0dcc3394ac1-0-0-0\" class=\"so-panel widget widget_sow-editor
panel-first-child panel-last-child\" data-index=\"0\">\r\n<div class=\"so-widget-
sow-editor so-widget-sow-editor-base\">\r\n<div class=\"siteorigin-widget-tinymce
textwidget\">\r\n<p class=\"text_all_p_tag_css\">This is a demo about us page for
this project. This is a demo about us page for this project. This is a demo about
us page for this project. This is a demo about us page for this project.</p>\r\n<p
class=\"text_all_p_tag_css\">This is a demo about us page for this project.This is
a demo about us page for this project.This is a demo about us page for this
project.This is a demo about us page for this project.This is a demo about us page
for this project. (codeastro.com). This is a demo about us page for this project.
This is a demo about us page for this project. This is a demo about us page for
this project. This is a demo about us page for this project. This is a demo about
us page for this project. This is a demo about us page for this project.</p>\r\
n<div id=\"pgc-w5d0dcc3394ac1-0-0\" class=\"panel-grid-cell\">\r\n<div id=\"panel-
w5d0dcc3394ac1-0-0-0\" class=\"so-panel widget widget_sow-editor panel-first-child
panel-last-child\" data-index=\"0\">\r\n<div class=\"so-widget-sow-editor so-
widget-sow-editor-base\">\r\n<div class=\"siteorigin-widget-tinymce textwidget\">\
r\n<p class=\"text_all_p_tag_css\">This is a demo about us page for this project.
This is a demo about us page for this project. This is a demo about us page for
this project.</p>\r\n<p class=\"text_all_p_tag_css\">This is a demo about us page
for this project.This is a demo about us page for this project.This is a demo about
us page for this project.This is a demo about us page for this project.
(codeastro.com) This is a demo about us page for this project.This is a demo about
us page for this project.This is a demo about us page for this project.This is a
demo about us page for this project.This is a demo about us page for this
project.This is a demo about us page for this project.</p>\r\n</div>\r\n</div>\r\
n</div>\r\n</div>\r\n</div>\r\n</div>\r\n</div>\r\n</div>', 'condos-pool.png');
-- Table `admin`
CREATE TABLE `admin` (
`aid` int(10) NOT NULL AUTO_INCREMENT,
`auser` varchar(50) NOT NULL,
`aemail` varchar(50) NOT NULL,
`apass` varchar(50) NOT NULL,
`adob` date NOT NULL,
`aphone` varchar(15) NOT NULL,
PRIMARY KEY (`aid`),
INDEX `idx_aemail` (`aemail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `admin` (`aid`, `auser`, `aemail`, `apass`, `adob`, `aphone`) VALUES
(9, 'admin', '[email protected]', '6812f136d636e737248d365016f8cfd5139e387c', '1994-
12-06', '1470002569');
-- Table `state`
CREATE TABLE `state` (
`sid` int(50) NOT NULL AUTO_INCREMENT,
`sname` varchar(100) NOT NULL,
PRIMARY KEY (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `state` (`sid`, `sname`) VALUES
(2, 'California'),
(3, 'Texas'),
(5, 'New York'),
(7, 'Florida'),
(9, 'Washington'),
(15, 'Oregon');
-- Table `city`
CREATE TABLE `city` (
`cid` int(50) NOT NULL AUTO_INCREMENT,
`cname` varchar(100) NOT NULL,
`sid` int(50) NOT NULL,
PRIMARY KEY (`cid`),
KEY `idx_sid` (`sid`),
CONSTRAINT `fk_city_sid` FOREIGN KEY (`sid`) REFERENCES `state` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `city` (`cid`, `cname`, `sid`) VALUES
(9, 'Olisphis', 3),
(10, 'Alegas', 2),
(11, 'Floson', 2),
(12, 'Ulmore', 7),
(13, 'Awrerton', 15);
-- Table `contact`
CREATE TABLE `contact` (
`cid` int(50) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`phone` varchar(20) NOT NULL,
`subject` varchar(100) NOT NULL,
`message` varchar(250) NOT NULL,
PRIMARY KEY (`cid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `contact` (`cid`, `name`, `email`, `phone`, `subject`, `message`)
VALUES
(7, 'codeastro', '
[email protected]', '8888885454', 'codeastro.com', 'asdasdasd');
-- Table `user`
CREATE TABLE `user` (
`uid` int(50) NOT NULL AUTO_INCREMENT,
`uname` varchar(50) NOT NULL,
`uphone` varchar(50) NOT NULL,
`uemail` varchar(50) NOT NULL,
`upass` varchar(50) NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `user` (`uid`, `uname`, `uphone`, `uemail`, `upass`) VALUES
(28, 'john_doe', '9876543210', '[email protected]',
'5f4dcc3b5aa765d61d8327deb882cf99'),
(33, 'jane_smith', '8765432109', '[email protected]',
'5f4dcc3b5aa765d61d8327deb882cf99');
-- Table `feedback`
CREATE TABLE `feedback` (
`fid` int(50) NOT NULL AUTO_INCREMENT,
`uid` int(50) NOT NULL,
`fdescription` varchar(300) NOT NULL,
`status` int(1) NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`fid`),
KEY `idx_uid` (`uid`),
CONSTRAINT `fk_feedback_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `feedback` (`fid`, `uid`, `fdescription`, `status`, `date`) VALUES
(7, 28, 'This is a demo feedback in order to use set it as Testimonial for the
site. Just a simply dummy text rather than using lorem ipsum text lines.', 1,
'2022-07-23 16:07:08'),
(8, 33, 'This is great. This is just great. Hmmm, just a dummy text for users
feedback.', 1, '2022-07-23 21:51:09');
-- Table `visits`
CREATE TABLE `visits` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`phone` VARCHAR(15),
`subject` VARCHAR(255),
`message` TEXT,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- Table `property`
CREATE TABLE `property` (
`pid` int(50) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`pcontent` longtext NOT NULL,
`type` varchar(100) NOT NULL,
`bhk` varchar(50) NOT NULL,
`stype` varchar(100) NOT NULL,
`bedroom` int(50) NOT NULL,
`bathroom` int(50) NOT NULL,
`balcony` int(50) NOT NULL,
`kitchen` int(50) NOT NULL,
`hall` int(50) NOT NULL,
`floor` varchar(50) NOT NULL,
`size` int(50) NOT NULL,
`price` int(50) NOT NULL,
`location` varchar(200) NOT NULL,
`city` varchar(100) NOT NULL,
`state` varchar(100) NOT NULL,
`feature` longtext NOT NULL,
`pimage` varchar(300) NOT NULL,
`pimage1` varchar(300) NOT NULL,
`pimage2` varchar(300) NOT NULL,
`pimage3` varchar(300) NOT NULL,
`pimage4` varchar(300) NOT NULL,
`uid` int(50) NOT NULL,
`status` varchar(50) NOT NULL,
`mapimage` varchar(300) NOT NULL,
`topmapimage` varchar(300) NOT NULL,
`groundmapimage` varchar(300) NOT NULL,
`totalfloor` varchar(50) NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`isFeatured` int(11) DEFAULT NULL,
`id` int(10) NOT NULL,
`fid` int(50) NOT NULL,
`cid` int(50) NOT NULL,
`sid` int(50) NOT NULL,
PRIMARY KEY (`pid`),
KEY `idx_uid` (`uid`),
KEY `idx_id` (`id`),
KEY `idx_fid` (`fid`),
KEY `idx_cid` (`cid`),
KEY `idx_sid` (`sid`),
CONSTRAINT `fk_property_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`),
CONSTRAINT `fk_property_id` FOREIGN KEY (`id`) REFERENCES `about` (`id`),
CONSTRAINT `fk_property_fid` FOREIGN KEY (`fid`) REFERENCES `feedback` (`fid`),
CONSTRAINT `fk_property_cid` FOREIGN KEY (`cid`) REFERENCES `city` (`cid`),
CONSTRAINT `fk_property_sid` FOREIGN KEY (`sid`) REFERENCES `state` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `property` (`pid`, `title`, `pcontent`, `type`, `bhk`, `stype`,
`bedroom`, `bathroom`, `balcony`, `kitchen`, `hall`, `floor`, `size`, `price`,
`location`, `city`, `state`, `feature`, `pimage`, `pimage1`, `pimage2`, `pimage3`,
`pimage4`, `uid`, `status`, `mapimage`, `topmapimage`, `groundmapimage`,
`totalfloor`, `date`, `isFeatured`, `id`, `fid`, `cid`, `sid`) VALUES
(28, 'Cosy Apartment', '<ul>\r\n\t<li>area: 50 sq m</li>\r\n\t<li>price: Rs
1,500,000</li>\r\n\t<li>2 bedrooms</li>\r\n\t<li>1 bathrooms</li>\r\n\t<li>1
balcony</li>\r\n\t<li>1 kitchen</li>\r\n\t<li>1 hall</li>\r\n\t<li>status:
available</li>\r\n\t<li>location: Kathmandu</li>\r\n\t<li>floor: 3</li>\r\n\
t<li>map image</li>\r\n\t<li>top map image</li>\r\n\t<li>ground map image</li>\r\n\
t<li>total floors: 4</li>\r\n\t<li>date</li>\r\n\t<li>featured</li>\r\n</ul>\r\
n<p>Feature: Centralized cooling system</p>', 'apartment', '2 BHK', 'Rent', 2, 1,
1, 1, 1, '3', 50, 1500000, 'Kathmandu', 'Kathmandu', 'Bagmati', '<ul>\r\n\
t<li>Centralized cooling system</li>\r\n\t<li>24/7 water supply</li>\r\n</ul>',
'apartment.jpg', 'apartment1.jpg', 'apartment2.jpg', 'apartment3.jpg',
'apartment4.jpg', 3, 'available', 'mapimage.jpg', 'topmapimage.jpg',
'groundmapimage.jpg', '4', '2022-07-23 16:07:08', 1, 10, 7, 9, 5);
-- Table `images`
CREATE TABLE `images` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`property_id` INT NOT NULL,
`image_path` VARCHAR(255) NOT NULL,
FOREIGN KEY (`property_id`) REFERENCES `property`(`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;