/*!999999 enable the sandbox mode */ 
CREATE TABLE `card_icons` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `card_icon_url` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `cities` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `city_name` text NOT NULL,
  `region_id` bigint(20) unsigned NOT NULL,
  `city_longitude` varchar(255) NOT NULL,
  `city_latitude` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `cities_region_id_foreign` (`region_id`),
  CONSTRAINT `cities_region_id_foreign` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `client_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `client_name` varchar(255) NOT NULL,
  `icon_image_url` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `contact_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` text NOT NULL,
  `phone` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `message` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `counters` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `count_name` varchar(255) NOT NULL,
  `num_count` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `districts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `dist_name` text NOT NULL,
  `city_id` bigint(20) unsigned NOT NULL,
  `dist_longitude` varchar(255) NOT NULL,
  `dist_latitude` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `districts_city_id_foreign` (`city_id`),
  CONSTRAINT `districts_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `explore_cards` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `place_name` varchar(255) NOT NULL,
  `card_image_url` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `hero_cards` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `card_title` varchar(255) NOT NULL,
  `card_desciption` varchar(255) NOT NULL,
  `icon_id` bigint(20) unsigned NOT NULL,
  `element_id_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hero_cards_icon_id_foreign` (`icon_id`),
  CONSTRAINT `hero_cards_icon_id_foreign` FOREIGN KEY (`icon_id`) REFERENCES `card_icons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `projects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `projectName` varchar(255) NOT NULL,
  `clientName` varchar(255) NOT NULL,
  `categories` varchar(255) NOT NULL,
  `projectHead` varchar(255) NOT NULL,
  `projectContent` text NOT NULL,
  `projectEvents` text DEFAULT NULL,
  `projectAddress` varchar(255) NOT NULL,
  `contactWay` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`contactWay`)),
  `openedHours` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`openedHours`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `projectPhoto` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`projectPhoto`)),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `proprties` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `unit_id` bigint(20) unsigned NOT NULL,
  `kitchen` int(10) unsigned DEFAULT NULL,
  `bedroom` int(10) unsigned DEFAULT NULL,
  `rooms` int(10) unsigned DEFAULT NULL,
  `living_room` int(10) unsigned DEFAULT NULL,
  `bathroom` int(10) unsigned DEFAULT NULL,
  `garage` int(10) unsigned DEFAULT NULL,
  `garden` int(10) unsigned DEFAULT NULL,
  `elevator` int(10) unsigned DEFAULT NULL,
  `floor` int(10) unsigned DEFAULT NULL,
  `pool` int(10) unsigned DEFAULT NULL,
  `surface_area` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `proprties_unit_id_unique` (`unit_id`),
  CONSTRAINT `proprties_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `regions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `region_name` text NOT NULL,
  `region_longitude` varchar(255) NOT NULL,
  `region_latitude` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `testimonials` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `clientName` varchar(255) NOT NULL,
  `clientPicture` varchar(255) NOT NULL,
  `clientTitle` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `unit_counters` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `count` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `unit_photos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `unit_id` bigint(20) unsigned NOT NULL,
  `unit_image_url` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `unit_photos_unit_id_foreign` (`unit_id`),
  CONSTRAINT `unit_photos_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `units` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `unit_name` text NOT NULL,
  `unit_address` text NOT NULL,
  `unit_description` text NOT NULL,
  `unit_longitude` varchar(255) NOT NULL,
  `unit_latitude` varchar(255) NOT NULL,
  `unit_price` bigint(20) unsigned NOT NULL,
  `dist_id` bigint(20) unsigned NOT NULL,
  `main_category` enum('Residential','Commercial','Administration','Medical') NOT NULL,
  `unit_category` enum('Appartment','Villa','Sahel') DEFAULT NULL,
  `res_unit_category` enum('Standalone','Twin House','Town House','Duplex','Penthouse','Appartment','Chalets','Loft','One Story') DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `units_dist_id_foreign` (`dist_id`),
  CONSTRAINT `units_dist_id_foreign` FOREIGN KEY (`dist_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


/*!999999 enable the sandbox mode */ 
INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1);
INSERT INTO `migrations` VALUES (2,'2014_10_12_100000_create_password_resets_table',1);
INSERT INTO `migrations` VALUES (3,'2019_08_19_000000_create_failed_jobs_table',1);
INSERT INTO `migrations` VALUES (4,'2019_12_14_000001_create_personal_access_tokens_table',1);
INSERT INTO `migrations` VALUES (5,'2022_02_14_174811_create_regions_table',1);
INSERT INTO `migrations` VALUES (6,'2022_05_09_000001_create_cities_table',1);
INSERT INTO `migrations` VALUES (7,'2022_05_09_000002_create_districts_table',1);
INSERT INTO `migrations` VALUES (8,'2022_05_09_122115_create_units_table',1);
INSERT INTO `migrations` VALUES (9,'2022_05_09_154408_create_unit_photos_table',1);
INSERT INTO `migrations` VALUES (10,'2022_05_09_154456_create_proprties_table',1);
INSERT INTO `migrations` VALUES (11,'2022_05_09_164433_create_contact_requests_table',1);
INSERT INTO `migrations` VALUES (12,'2022_06_02_221035_create_unit_counters_table',1);
INSERT INTO `migrations` VALUES (13,'2022_06_03_015948_create_card_icons_table',1);
INSERT INTO `migrations` VALUES (14,'2022_06_03_015949_create_hero_cards_table',1);
INSERT INTO `migrations` VALUES (15,'2022_06_03_020024_create_explore_cards_table',1);
INSERT INTO `migrations` VALUES (16,'2022_06_03_020124_create_client_items_table',1);
INSERT INTO `migrations` VALUES (17,'2022_06_03_020253_create_counters_table',1);
INSERT INTO `migrations` VALUES (18,'2024_12_01_193408_create_projects_table',1);
INSERT INTO `migrations` VALUES (19,'2024_12_02_141653_create_testimonials_table',1);
INSERT INTO `migrations` VALUES (20,'2024_12_02_155245_change_client_picture_column_type_on_testimonials_table',2);
INSERT INTO `migrations` VALUES (21,'2024_12_04_133808_add_project_photos_to_projects_table',3);
INSERT INTO `migrations` VALUES (22,'2024_12_04_134106_add_project_photo_to_projects_table',4);
