-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 05, 2018 at 06:53 AM
-- Server version: 5.7.13-log
-- PHP Version: 7.2.2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

--
-- Database: `hfs_master`
--

-- --------------------------------------------------------

--
-- Table structure for table `agent_details`
--

CREATE TABLE `agent_details` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL COMMENT 'id from user table',
  `officeName` varchar(128) DEFAULT NULL,
  `officeAddress` varchar(256) DEFAULT NULL,
  `officeCity` varchar(64) DEFAULT NULL,
  `officeState` varchar(64) DEFAULT NULL,
  `officeZip` int(11) DEFAULT NULL,
  `adminNote` varchar(512) DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `agent_landing_pages`
--

CREATE TABLE `agent_landing_pages` (
  `id` int(11) NOT NULL,
  `agentId` int(11) NOT NULL,
  `rating` int(11) DEFAULT NULL,
  `totalSales` int(11) NOT NULL DEFAULT '0',
  `recentSales` int(11) NOT NULL DEFAULT '0',
  `recentSalesDuration` varchar(30) DEFAULT NULL,
  `landingPageContent` text,
  `reviewsContent` text,
  `youtubeUrl` varchar(128) DEFAULT NULL,
  `videoDescription` varchar(500) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `blog_pages`
--

CREATE TABLE `blog_pages` (
  `id` int(11) NOT NULL,
  `agentId` int(11) NOT NULL,
  `title` varchar(250) DEFAULT NULL,
  `content` text,
  `blogImage` varchar(250) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `cache`
--

CREATE TABLE `cache` (
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `city_state_listings_counts`
--

CREATE TABLE `city_state_listings_counts` (
  `cityState` varchar(128) NOT NULL,
  `total` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `contact_requests`
--

CREATE TABLE `contact_requests` (
  `id` int(11) NOT NULL,
  `email` varchar(300) NOT NULL,
  `phoneNo` int(11) NOT NULL,
  `message` varchar(500) NOT NULL,
  `agentId` int(11) NOT NULL,
  `listingId` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `favourite_listings`
--

CREATE TABLE `favourite_listings` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `listingId` int(11) DEFAULT NULL,
  `listingKey` varchar(64) DEFAULT NULL,
  `markedOn` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `featured_listings`
--

CREATE TABLE `featured_listings` (
  `id` int(11) NOT NULL,
  `mlsNumber` varchar(48) DEFAULT NULL,
  `listingKey` varchar(64) NOT NULL,
  `listingTitle` varchar(128) NOT NULL,
  `propertyType` smallint(6) DEFAULT NULL,
  `propertySubType` smallint(6) DEFAULT NULL,
  `listingCategory` varchar(12) DEFAULT NULL,
  `streetAddress` varchar(128) DEFAULT NULL,
  `unitNumber` smallint(6) DEFAULT NULL,
  `city` varchar(128) DEFAULT NULL,
  `state` varchar(128) DEFAULT NULL,
  `zipCode` int(11) DEFAULT NULL,
  `listPrice` bigint(20) DEFAULT NULL,
  `currencyPeriod` varchar(15) DEFAULT NULL,
  `listPriceLow` bigint(20) DEFAULT NULL,
  `altListPrice` bigint(20) DEFAULT NULL,
  `altListPriceLow` bigint(20) DEFAULT NULL,
  `currencyCode` varchar(6) DEFAULT NULL,
  `bedrooms` int(11) DEFAULT NULL,
  `bathrooms` int(11) DEFAULT NULL,
  `livingArea` decimal(10,2) DEFAULT NULL,
  `lotSize` decimal(10,2) DEFAULT NULL,
  `lotSizeMeasure` varchar(10) DEFAULT NULL,
  `yearBuilt` year(4) DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `primaryImage` varchar(500) DEFAULT NULL,
  `mlsName` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `home_page_counts`
--

CREATE TABLE `home_page_counts` (
  `listings` int(11) NOT NULL DEFAULT '0',
  `cities` int(11) NOT NULL DEFAULT '0',
  `professionals` int(11) NOT NULL DEFAULT '0',
  `photos` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `listings`
--

CREATE TABLE `listings` (
  `id` int(11) NOT NULL,
  `mlsNumber` varchar(48) DEFAULT NULL,
  `listingKey` varchar(64) NOT NULL,
  `listingTitle` varchar(128) NOT NULL,
  `propertyType` smallint(6) DEFAULT NULL,
  `propertySubType` smallint(6) DEFAULT NULL,
  `listingCategory` varchar(12) DEFAULT NULL,
  `streetAddress` varchar(128) DEFAULT NULL,
  `unitNumber` smallint(6) DEFAULT NULL,
  `city` varchar(128) DEFAULT NULL,
  `state` varchar(128) DEFAULT NULL,
  `zipCode` int(11) DEFAULT NULL,
  `listPrice` bigint(20) DEFAULT NULL,
  `currencyPeriod` varchar(15) DEFAULT NULL,
  `listPriceLow` bigint(20) DEFAULT NULL,
  `altListPrice` bigint(20) DEFAULT NULL,
  `altListPriceLow` bigint(20) DEFAULT NULL,
  `currencyCode` varchar(6) DEFAULT NULL,
  `bedrooms` int(11) DEFAULT NULL,
  `bathrooms` int(11) DEFAULT NULL,
  `livingArea` decimal(10,2) DEFAULT NULL,
  `lotSize` decimal(10,2) DEFAULT NULL,
  `lotSizeMeasure` varchar(10) DEFAULT NULL,
  `yearBuilt` year(4) DEFAULT NULL,
  `listingDescription` text,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `agentName` varchar(128) DEFAULT NULL,
  `agentKey` varchar(128) DEFAULT NULL COMMENT 'ParticipantKey',
  `agentEmail` varchar(256) DEFAULT NULL,
  `agentWeb` varchar(500) DEFAULT NULL,
  `agentPhone` varchar(15) DEFAULT NULL,
  `mlsName` varchar(256) DEFAULT NULL,
  `leadRoutingEmail` varchar(256) DEFAULT NULL,
  `mlsPhone` varchar(15) DEFAULT NULL,
  `modificationTimestamp` bigint(20) DEFAULT NULL,
  `addressDisplayFlag` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `listing_details`
--

CREATE TABLE `listing_details` (
  `id` int(11) NOT NULL,
  `listingId` int(11) NOT NULL,
  `listingURL` varchar(250) DEFAULT NULL,
  `taxAmount` decimal(10,0) DEFAULT NULL,
  `taxDescription` varchar(256) DEFAULT NULL,
  `detailedCharacteristics` text COMMENT 'DetailedCharacteristics is in json format',
  `virtualTourUrl` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `listing_images`
--

CREATE TABLE `listing_images` (
  `id` int(11) NOT NULL,
  `listingKey` varchar(64) DEFAULT NULL,
  `listingId` int(11) NOT NULL,
  `displayOrder` smallint(6) DEFAULT NULL,
  `LHUrl` varchar(256) NOT NULL,
  `CDNUrl` varchar(256) DEFAULT NULL,
  `modificationTimestamp` bigint(20) NOT NULL,
  `mediaCaption` varchar(500) DEFAULT NULL,
  `mediaDescription` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `listing_videos`
--

CREATE TABLE `listing_videos` (
  `id` int(11) NOT NULL,
  `listingKey` varchar(64) NOT NULL,
  `listingId` int(11) NOT NULL,
  `displayOrder` smallint(6) DEFAULT NULL,
  `LHUrl` varchar(256) NOT NULL,
  `CDNUrl` varchar(256) NOT NULL,
  `modificationTimestamp` bigint(20) NOT NULL,
  `mediaCaption` varchar(500) NOT NULL,
  `mediaDescription` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `social_accounts`
--

CREATE TABLE `social_accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `provider` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `provider_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `firstName` varchar(64) DEFAULT NULL,
  `lastName` varchar(64) DEFAULT NULL,
  `agentId` varchar(128) DEFAULT NULL COMMENT 'Unique id',
  `agentUsername` varchar(24) DEFAULT NULL COMMENT 'unique name to pass through url',
  `socialMediaUserId` varchar(128) DEFAULT NULL COMMENT 'unique id from social media',
  `email` varchar(256) NOT NULL,
  `password` varchar(256) NOT NULL,
  `phoneNo` int(11) NOT NULL,
  `userImage` varchar(256) DEFAULT NULL,
  `userSource` varchar(12) DEFAULT NULL COMMENT 'FB, TW .. etc',
  `remember_token` varchar(256) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '-1 - Inactive, 0 - Not verified, 1 - Verfied & Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `user_roles`
--

CREATE TABLE `user_roles` (
  `id` int(11) NOT NULL,
  `roleName` varchar(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `user_to_roles`
--

CREATE TABLE `user_to_roles` (
  `userId` int(11) NOT NULL,
  `roleId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `user_verifications`
--

CREATE TABLE `user_verifications` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `zipcodes`
--

CREATE TABLE `zipcodes` (
  `id` int(11) NOT NULL COMMENT 'Unique ID',
  `zip_code` char(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `available` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'true=available, false=not available',
  `status` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `time_reserved` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `active_metro` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'is this area currently serviced by HFS',
  `price` decimal(5,2) NOT NULL DEFAULT '0.00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `zipcodes`
--

INSERT INTO `zipcodes` (`id`, `zip_code`, `available`, `status`, `time_reserved`, `active_metro`, `price`) VALUES
(1, '00544', 1, 'SOLD', '2018-02-07 09:27:56', 1, '0.00'),
(2, '94121', 1, 'PENDING', '2018-02-07 09:38:51', 1, '9.00'),
(3, '94132', 1, NULL, '2018-02-07 09:38:51', 1, '13.00'),
(4, '94116', 1, NULL, '2018-02-07 09:38:51', 1, '10.00'),
(5, '94122', 1, NULL, '2018-02-07 09:38:51', 1, '13.00'),
(6, '94129', 1, NULL, '2018-02-07 09:38:51', 1, '3.00'),
(7, '94118', 1, NULL, '2018-02-07 09:38:51', 1, '8.00'),
(8, '94127', 1, NULL, '2018-02-07 09:38:51', 1, '0.00'),
(9, '94112', 1, NULL, '2018-02-07 09:38:51', 1, '8.00'),
(10, '94131', 1, 'SOLD', '2018-02-07 09:38:51', 1, '12.00'),
(11, '94117', 1, NULL, '2018-02-07 09:38:51', 1, '4.00'),
(12, '94114', 1, NULL, '2018-02-07 09:38:51', 1, '2.00'),
(13, '94115', 1, NULL, '2018-02-07 09:38:51', 1, '13.00'),
(14, '94123', 1, NULL, '2018-02-07 09:38:51', 1, '0.00'),
(15, '94109', 1, 'SOLD', '2018-02-07 09:38:51', 1, '5.00'),
(16, '94119', 1, 'PENDING', '2018-02-07 09:38:51', 1, '12.00'),
(17, '94120', 1, 'PENDING', '2018-02-07 09:38:51', 1, '14.00'),
(18, '94125', 1, 'PENDING', '2018-02-07 09:38:51', 1, '7.00'),
(19, '94126', 1, 'SOLD', '2018-02-07 09:38:51', 1, '6.00'),
(20, '94137', 1, 'SOLD', '2018-02-07 09:38:51', 1, '12.00'),
(21, '94139', 1, 'SOLD', '2018-02-07 09:38:51', 1, '10.00'),
(22, '94140', 1, 'SOLD', '2018-02-07 09:38:51', 1, '1.00'),
(23, '94141', 1, NULL, '2018-02-07 09:38:51', 1, '4.00'),
(24, '94142', 1, NULL, '2018-02-07 09:38:51', 1, '4.00'),
(25, '94143', 1, NULL, '2018-02-07 09:38:51', 1, '8.00'),
(26, '94144', 1, NULL, '2018-02-07 09:38:51', 1, '14.00'),
(27, '94145', 1, NULL, '2018-02-07 09:38:51', 1, '0.00'),
(28, '94146', 1, NULL, '2018-02-07 09:38:51', 1, '3.00'),
(29, '94147', 1, NULL, '2018-02-07 09:38:51', 1, '1.00'),
(30, '94151', 1, NULL, '2018-02-07 09:38:51', 1, '11.00'),
(31, '94159', 1, NULL, '2018-02-07 09:38:51', 1, '9.00'),
(32, '94160', 1, NULL, '2018-02-07 09:38:51', 1, '13.00'),
(33, '94161', 1, NULL, '2018-02-07 09:38:51', 1, '8.00'),
(34, '94163', 1, NULL, '2018-02-07 09:38:51', 1, '2.00'),
(35, '94164', 1, NULL, '2018-02-07 09:38:51', 1, '14.00'),
(36, '94172', 1, NULL, '2018-02-07 09:38:51', 1, '6.00'),
(37, '94177', 1, NULL, '2018-02-07 09:38:51', 1, '5.00'),
(38, '94188', 1, NULL, '2018-02-07 09:38:51', 1, '6.00'),
(39, '94102', 1, NULL, '2018-02-07 09:38:51', 1, '3.00'),
(40, '94110', 1, NULL, '2018-02-07 09:38:51', 1, '10.00'),
(41, '94103', 1, NULL, '2018-02-07 09:38:51', 1, '12.00'),
(42, '94134', 1, NULL, '2018-02-07 09:38:51', 1, '14.00'),
(43, '94108', 1, NULL, '2018-02-07 09:38:51', 1, '6.00'),
(44, '94104', 1, NULL, '2018-02-07 09:38:51', 1, '4.00'),
(45, '94111', 1, NULL, '2018-02-07 09:38:51', 1, '2.00'),
(46, '94105', 1, NULL, '2018-02-07 09:38:51', 1, '12.00'),
(47, '94107', 1, NULL, '2018-02-07 09:38:51', 1, '12.00'),
(48, '94158', 1, NULL, '2018-02-07 09:38:51', 1, '8.00'),
(49, '94124', 1, NULL, '2018-02-07 09:38:51', 1, '5.00');

-- --------------------------------------------------------

--
-- Table structure for table `zipcode_landing_pages`
--

CREATE TABLE `zipcode_landing_pages` (
  `id` int(11) NOT NULL,
  `agentId` int(11) NOT NULL,
  `zipcode` int(11) NOT NULL,
  `city` varchar(128) NOT NULL,
  `state` varchar(128) NOT NULL,
  `title` varchar(500) NOT NULL,
  `content` text NOT NULL,
  `metaPageTitle` varchar(128) DEFAULT NULL,
  `metaPageDesc` varchar(500) DEFAULT NULL,
  `metaKeyword` varchar(250) DEFAULT NULL,
  `isTopLevel` tinyint(4) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `agent_details`
--
ALTER TABLE `agent_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_Details_to_user` (`userId`);

--
-- Indexes for table `agent_landing_pages`
--
ALTER TABLE `agent_landing_pages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_agent_to_landingpage` (`agentId`);

--
-- Indexes for table `blog_pages`
--
ALTER TABLE `blog_pages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_agent_to_blog_pages` (`agentId`);

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD UNIQUE KEY `cache_key_unique` (`key`);

--
-- Indexes for table `city_state_listings_counts`
--
ALTER TABLE `city_state_listings_counts` ADD FULLTEXT KEY `cityState` (`cityState`);

--
-- Indexes for table `contact_requests`
--
ALTER TABLE `contact_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_agent_to_contact_req` (`agentId`),
  ADD KEY `FK_listing_to_contact_req` (`listingId`);

--
-- Indexes for table `favourite_listings`
--
ALTER TABLE `favourite_listings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_listing_to_FAV` (`listingId`),
  ADD KEY `FK_users_to_FAV` (`userId`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

--
-- Indexes for table `listings`
--
ALTER TABLE `listings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `listing_details`
--
ALTER TABLE `listing_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_listing_id_to_details` (`listingId`);

--
-- Indexes for table `listing_images`
--
ALTER TABLE `listing_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_listing_img_to_listing` (`listingId`);

--
-- Indexes for table `listing_videos`
--
ALTER TABLE `listing_videos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_listing_vid_to_listing` (`listingId`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD UNIQUE KEY `sessions_id_unique` (`id`);

--
-- Indexes for table `social_accounts`
--
ALTER TABLE `social_accounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `social_accounts_user_id_foreign` (`user_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `user_roles`
--
ALTER TABLE `user_roles`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `user_to_roles`
--
ALTER TABLE `user_to_roles`
  ADD PRIMARY KEY (`userId`,`roleId`),
  ADD KEY `FK_roles_to_user` (`roleId`);

--
-- Indexes for table `user_verifications`
--
ALTER TABLE `user_verifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_verifications_user_id_foreign` (`user_id`);

--
-- Indexes for table `zipcodes`
--
ALTER TABLE `zipcodes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zipcode_landing_pages`
--
ALTER TABLE `zipcode_landing_pages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_agent_to_zip_landingpage` (`agentId`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `agent_details`
--
ALTER TABLE `agent_details`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `agent_landing_pages`
--
ALTER TABLE `agent_landing_pages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `blog_pages`
--
ALTER TABLE `blog_pages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `contact_requests`
--
ALTER TABLE `contact_requests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `favourite_listings`
--
ALTER TABLE `favourite_listings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `listings`
--
ALTER TABLE `listings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9011;

--
-- AUTO_INCREMENT for table `listing_details`
--
ALTER TABLE `listing_details`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9011;

--
-- AUTO_INCREMENT for table `listing_images`
--
ALTER TABLE `listing_images`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=151545;

--
-- AUTO_INCREMENT for table `listing_videos`
--
ALTER TABLE `listing_videos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `social_accounts`
--
ALTER TABLE `social_accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `user_roles`
--
ALTER TABLE `user_roles`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `user_verifications`
--
ALTER TABLE `user_verifications`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `zipcodes`
--
ALTER TABLE `zipcodes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=50;

--
-- AUTO_INCREMENT for table `zipcode_landing_pages`
--
ALTER TABLE `zipcode_landing_pages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `agent_details`
--
ALTER TABLE `agent_details`
  ADD CONSTRAINT `FK_Details_to_user` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `agent_landing_pages`
--
ALTER TABLE `agent_landing_pages`
  ADD CONSTRAINT `FK_agent_to_landingpage` FOREIGN KEY (`agentId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `blog_pages`
--
ALTER TABLE `blog_pages`
  ADD CONSTRAINT `FK_agent_to_blog_pages` FOREIGN KEY (`agentId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contact_requests`
--
ALTER TABLE `contact_requests`
  ADD CONSTRAINT `FK_agent_to_contact_req` FOREIGN KEY (`agentId`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `FK_listing_to_contact_req` FOREIGN KEY (`listingId`) REFERENCES `listings` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `favourite_listings`
--
ALTER TABLE `favourite_listings`
  ADD CONSTRAINT `FK_listing_to_FAV` FOREIGN KEY (`listingId`) REFERENCES `listings` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `FK_users_to_FAV` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `listing_details`
--
ALTER TABLE `listing_details`
  ADD CONSTRAINT `FK_listing_id_to_details` FOREIGN KEY (`listingId`) REFERENCES `listings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `listing_images`
--
ALTER TABLE `listing_images`
  ADD CONSTRAINT `FK_listing_img_to_listing` FOREIGN KEY (`listingId`) REFERENCES `listings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `listing_videos`
--
ALTER TABLE `listing_videos`
  ADD CONSTRAINT `FK_listing_vid_to_listing` FOREIGN KEY (`listingId`) REFERENCES `listings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `user_to_roles`
--
ALTER TABLE `user_to_roles`
  ADD CONSTRAINT `FK_roles_to_user` FOREIGN KEY (`roleId`) REFERENCES `user_roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `FK_user_to_roles` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `zipcode_landing_pages`
--
ALTER TABLE `zipcode_landing_pages`
  ADD CONSTRAINT `FK_agent_to_zip_landingpage` FOREIGN KEY (`agentId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
