/*
SQLyog Ultimate
MySQL - 8.0.30 : Database - snow_byrd
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `booking_log_additional_services` */

DROP TABLE IF EXISTS `booking_log_additional_services`;

CREATE TABLE `booking_log_additional_services` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `service_id` int unsigned DEFAULT NULL,
  `booking_id` int unsigned DEFAULT NULL,
  `status` int DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `booking_log_additional_services_service_id_foreign` (`service_id`),
  KEY `booking_log_additional_services_booking_id_foreign` (`booking_id`),
  CONSTRAINT `booking_log_additional_services_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `booking_logs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `booking_log_additional_services_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

/*Data for the table `booking_log_additional_services` */

/*Table structure for table `booking_log_services` */

DROP TABLE IF EXISTS `booking_log_services`;

CREATE TABLE `booking_log_services` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `service_id` int unsigned DEFAULT NULL,
  `booking_log_id` int unsigned DEFAULT NULL,
  `status` int DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `booking_log_services_service_id_foreign` (`service_id`),
  KEY `booking_log_services_booking_log_id_foreign` (`booking_log_id`),
  CONSTRAINT `booking_log_services_booking_log_id_foreign` FOREIGN KEY (`booking_log_id`) REFERENCES `booking_logs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `booking_log_services_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

/*Data for the table `booking_log_services` */

/*Table structure for table `booking_logs` */

DROP TABLE IF EXISTS `booking_logs`;

CREATE TABLE `booking_logs` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(200) NOT NULL,
  `operator_id` int unsigned DEFAULT NULL,
  `price` decimal(11,2) DEFAULT '0.00',
  `charge_id` varchar(255) DEFAULT NULL,
  `work_type` varchar(33) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `latitude` varchar(33) DEFAULT NULL,
  `longitude` varchar(33) DEFAULT NULL,
  `shape_description` text,
  `service_schedule_time` datetime DEFAULT NULL,
  `link_expired_at` datetime DEFAULT NULL,
  `service_type` varchar(33) DEFAULT 'urgent',
  `shape_size` int DEFAULT NULL,
  `slider_meter` varchar(33) DEFAULT NULL,
  `additional_service` varchar(33) DEFAULT NULL,
  `cancellation_reason` text,
  `booking_status` varchar(55) DEFAULT 'in_progress',
  `is_paid` int DEFAULT '0',
  `is_owner_agree` int DEFAULT '0',
  `status` int DEFAULT '1',
  `created_by` int unsigned DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `booking_logs_slug_unique` (`slug`),
  KEY `booking_logs_operator_id_foreign` (`operator_id`),
  KEY `booking_logs_created_by_foreign` (`created_by`),
  CONSTRAINT `booking_logs_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `booking_logs_operator_id_foreign` FOREIGN KEY (`operator_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

/*Data for the table `booking_logs` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
