--
-- Host: localhost    Database: edriver_web
-- ------------------------------------------------------


--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `activity_log_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `module_name` text NOT NULL,
  `module_record_id` int(11) NOT NULL,
  `description` text NOT NULL,
  `log_action` enum('INSERT','UPDATE','DELETE','VIEW') NOT NULL,
  `created_datetime` datetime NOT NULL,
  `attribute_values` text NOT NULL,
  PRIMARY KEY (`activity_log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=759 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `auth_assignment`
--

CREATE TABLE `auth_assignment` (
  `item_name` varchar(64) NOT NULL,
  `user_id` varchar(64) NOT NULL,
  `created_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`user_id`,`item_name`) USING BTREE,
  KEY `user_id` (`user_id`),
  KEY `auth_assignment_ibfk_1` (`item_name`),
  CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `auth_item`
--

CREATE TABLE `auth_item` (
  `name` varchar(64) NOT NULL,
  `type` smallint(6) NOT NULL,
  `description` text DEFAULT NULL,
  `rule_name` varchar(64) DEFAULT NULL,
  `data` blob DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`name`),
  UNIQUE KEY `name` (`name`),
  KEY `type` (`type`),
  KEY `rule_name` (`rule_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `auth_item_child`
--

CREATE TABLE `auth_item_child` (
  `parent` varchar(64) NOT NULL,
  `child` varchar(64) NOT NULL,
  PRIMARY KEY (`parent`,`child`) USING BTREE,
  KEY `child` (`child`),
  CONSTRAINT `auth_item_child_fk1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `auth_item_child_fk2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `auth_rule`
--

CREATE TABLE `auth_rule` (
  `name` varchar(64) NOT NULL,
  `data` blob DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `booking_request_log`
--

CREATE TABLE `booking_request_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `request` longtext NOT NULL,
  `response` longtext NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `cancel_policy`
--

CREATE TABLE `cancel_policy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `duration_in_hrs` int(11) NOT NULL,
  `deduction_amt` float NOT NULL,
  `unit` enum('Percentage','Amount') NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `customer_notification`
--

CREATE TABLE `customer_notification` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customer_id` int(11) NOT NULL,
  `reference_id` int(11) DEFAULT NULL,
  `text` text DEFAULT NULL,
  `title` varchar(250) DEFAULT NULL,
  `is_actionable` enum('Y','N') NOT NULL,
  `type` tinyint(4) DEFAULT NULL COMMENT '1= Driver side for cancle approval, 2 = just informative',
  `status` tinyint(4) NOT NULL DEFAULT 0,
  `is_read` enum('Y','N') NOT NULL DEFAULT 'N',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_id` (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4379 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `customer_qr_code`
--

CREATE TABLE `customer_qr_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_qr_code` varchar(15) DEFAULT NULL,
  `user_qr_number` varchar(15) DEFAULT NULL,
  `is_printed` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `damage_qr_code`
--

CREATE TABLE `damage_qr_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(50) NOT NULL,
  `commuter_id` int(11) NOT NULL COMMENT 'customer_id',
  `date` datetime NOT NULL,
  `operator_id` int(11) NOT NULL COMMENT 'vehicle_id',
  `latitude` varchar(100) DEFAULT NULL,
  `longitude` varchar(100) DEFAULT NULL,
  `location` varchar(255) NOT NULL,
  `status` enum('unknown','damage','pending','') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `discount`
--

CREATE TABLE `discount` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `price` float NOT NULL,
  `deduction_amt` float NOT NULL,
  `unit` enum('Percentage','Amount') NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` enum('A','I','D') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `driver_bank_details`
--

CREATE TABLE `driver_bank_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) DEFAULT NULL,
  `owner_id` int(6) unsigned NOT NULL,
  `account_number` varchar(15) NOT NULL,
  `bank_code` varchar(20) NOT NULL,
  `bank_name` varchar(250) NOT NULL,
  `account_holder_name` varchar(250) NOT NULL,
  `phone_number` varchar(15) NOT NULL,
  `document` varchar(50) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `owner_id` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `driver_trips`
--

CREATE TABLE `driver_trips` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `route_id` int(11) NOT NULL,
  `duty_id` int(11) DEFAULT NULL,
  `driver_id` int(11) NOT NULL,
  `transport_vehicle_id` int(11) NOT NULL,
  `duty_route_id` int(11) DEFAULT NULL COMMENT 'Reference  to ed_duty_routes',
  `status` enum('Active','End','Cancelled','Next','Paused') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'Active',
  `start_by` enum('Driver','Admin') DEFAULT 'Driver',
  `end_by` enum('Driver','Admin','System') DEFAULT 'Driver',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `end_trip_at` datetime DEFAULT NULL,
  `trip_status` enum('On-Time','Delayed') DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `route_id` (`route_id`),
  KEY `driver_id` (`driver_id`),
  KEY `transport_vehicle_id` (`transport_vehicle_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1007 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `duty`
--

CREATE TABLE `duty` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vehicle_id` int(11) DEFAULT NULL COMMENT 'Reference to ed_transport_vehicles',
  `depot_id` int(11) NOT NULL COMMENT 'Reference to ed_depot',
  `name` varchar(255) NOT NULL,
  `status` enum('A','I','D') NOT NULL DEFAULT 'A',
  `approval_status` enum('Pending','Approve','Reject') DEFAULT 'Pending',
  `approved_by` int(11) DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `ed_admin`
--

CREATE TABLE `ed_admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `last_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `contact` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `is_deleted` enum('0','1') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_api`
--

CREATE TABLE `ed_api` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant` enum('Calmax') NOT NULL,
  `token` text DEFAULT NULL,
  `status` enum('A','I') DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `ed_audit_entry`
--

CREATE TABLE `ed_audit_entry` (
  `audit_entry_id` int(11) NOT NULL AUTO_INCREMENT,
  `audit_entry_timestamp` varchar(100) NOT NULL,
  `audit_entry_model_name` varchar(100) NOT NULL,
  `audit_entry_operation` varchar(100) NOT NULL,
  `audit_entry_field_id` int(11) NOT NULL COMMENT 'PK of Field ID',
  `audit_entry_field_name` varchar(100) NOT NULL,
  `audit_entry_old_value` text DEFAULT NULL,
  `audit_entry_new_value` text DEFAULT NULL,
  `audit_entry_user_id` varchar(100) NOT NULL,
  `audit_entry_ip` varchar(100) NOT NULL,
  PRIMARY KEY (`audit_entry_id`),
  KEY `audit_entry_operation` (`audit_entry_operation`),
  KEY `audit_entry_user_id` (`audit_entry_user_id`),
  KEY `audit_entry_ip` (`audit_entry_ip`),
  KEY `audit_entry_model_name` (`audit_entry_model_name`)
) ENGINE=InnoDB AUTO_INCREMENT=163707 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_authkey`
--

CREATE TABLE `ed_authkey` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `auth_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `device` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'NOT IN USE',
  `device_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `device_id` text NOT NULL,
  `created_date` datetime DEFAULT current_timestamp(),
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `ed_authkey_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1564 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_booking_user_taxi_data`
--

CREATE TABLE `ed_booking_user_taxi_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `booking_history_id` int(11) NOT NULL,
  `vehicle_type` enum('Bus','Taxi') DEFAULT NULL,
  `vehicle_number` varchar(50) DEFAULT NULL,
  `vehicle_name` varchar(250) DEFAULT NULL,
  `is_ac` enum('0','1') DEFAULT NULL,
  `no_of_seats` int(11) DEFAULT NULL,
  `customer_name` varchar(250) DEFAULT NULL,
  `customer_email` varchar(100) DEFAULT NULL,
  `customer_mobile` varchar(15) DEFAULT NULL,
  `balance` float DEFAULT NULL,
  `emergency_number` varchar(15) DEFAULT NULL,
  `driver_name` varchar(250) DEFAULT NULL,
  `driver_email` varchar(100) DEFAULT NULL,
  `driver_mobile` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tbl_booking_history_id` (`booking_history_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_company_master`
--

CREATE TABLE `ed_company_master` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `status` enum('A','I','D') NOT NULL DEFAULT 'A',
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `ed_content_management`
--

CREATE TABLE `ed_content_management` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_countries`
--

CREATE TABLE `ed_countries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sortname` varchar(3) NOT NULL,
  `name` varchar(150) NOT NULL,
  `phonecode` varchar(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Table structure for table `ed_customer_transaction`
--

CREATE TABLE `ed_customer_transaction` (
  `ct_id` int(11) NOT NULL AUTO_INCREMENT,
  `cust_id` int(11) NOT NULL COMMENT 'Customer id for whom balance updated',
  `customer_booking_id` int(11) DEFAULT NULL,
  `ct_type` enum('CREDIT','DEBIT') NOT NULL DEFAULT 'DEBIT' COMMENT ' Transaction type',
  `ct_amount` double(10,2) NOT NULL COMMENT ' Transaction amount ',
  `ct_description` text NOT NULL COMMENT ' Description',
  `ct_triggered_by` varchar(50) NOT NULL DEFAULT 'Portal' COMMENT ' Transaction done through from given',
  `ct_updated_by` int(11) DEFAULT NULL COMMENT ' Transaction done by ',
  `ct_updated_bal` double(10,2) NOT NULL DEFAULT 0.00 COMMENT ' Balance at transaction time ',
  `ct_updated_date` datetime DEFAULT NULL COMMENT ' Transaction done date time ',
  `sales_id` int(11) DEFAULT 0 COMMENT 'sale increment',
  `usage_id` int(11) DEFAULT 0 COMMENT 'usage increment',
  PRIMARY KEY (`ct_id`),
  KEY `cust_id` (`cust_id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `sales_id` BEFORE INSERT ON `ed_customer_transaction` FOR EACH ROW SET NEW .sales_id =( SELECT MAX(sales_id)+1 FROM tbl_customer_transaction WHERE NEW.ct_type = "CREDIT" LIMIT 1 ),NEW .usage_id =( SELECT MAX(usage_id)+1 FROM tbl_customer_transaction WHERE NEW.ct_type = "DEBIT" LIMIT 1 ) */;;
DELIMITER ;

--
-- Table structure for table `ed_depot`
--

CREATE TABLE `ed_depot` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `status` enum('A','I','D') NOT NULL DEFAULT 'A',
  `parcel_service` enum('Yes','No') DEFAULT 'No',
  `depo_manager_id` int(11) DEFAULT NULL,
  `work_shop_user_id` int(11) DEFAULT NULL,
  `country_id` int(11) NOT NULL,
  `city` varchar(55) NOT NULL,
  `created_by` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `ed_driver`
--

CREATE TABLE `ed_driver` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `taxi_owner_id` int(11) DEFAULT NULL,
  `first_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `last_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `contact_prefix` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `country_code` int(11) DEFAULT NULL,
  `contact_number` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `country_id` int(11) NOT NULL,
  `city` varchar(100) NOT NULL,
  `transport_vehicle_id` int(11) DEFAULT NULL,
  `car_registration_number` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `profile_picture` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `site_url` text DEFAULT NULL,
  `status` enum('A','I') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'A',
  `device_token` varchar(255) DEFAULT NULL,
  `device_type` enum('0','1') DEFAULT NULL COMMENT '0=ios ,1=android',
  `id_number` varchar(15) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `passport_number` varchar(100) DEFAULT NULL,
  `emergency_number` varchar(15) DEFAULT NULL,
  `balance` float DEFAULT NULL,
  `type` enum('DRIVER','CUSTOMER') NOT NULL,
  `is_verified` enum('Yes','No') NOT NULL DEFAULT 'No',
  `is_profile_updated` enum('Yes','No') NOT NULL DEFAULT 'No',
  `latitude` varchar(20) DEFAULT NULL,
  `longitude` varchar(20) DEFAULT NULL,
  `user_qr_code` varchar(15) DEFAULT NULL,
  `user_qr_number` varchar(15) DEFAULT NULL,
  `employee_no` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=398 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_driver_points`
--

CREATE TABLE `ed_driver_points` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `total_points` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  CONSTRAINT `ed_driver_points_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_driver_tips`
--

CREATE TABLE `ed_driver_tips` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_duty_routes`
--

CREATE TABLE `ed_duty_routes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `duty_id` int(11) NOT NULL,
  `route_id` int(11) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `is_deleted` enum('N','Y') NOT NULL DEFAULT 'N',
  `trip` int(11) NOT NULL DEFAULT 0 COMMENT 'no of trips',
  `day` enum('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday') DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4955 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_email_templates`
--

CREATE TABLE `ed_email_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_forgot_password`
--

CREATE TABLE `ed_forgot_password` (
  `fp_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `fp_user_id` varchar(255) NOT NULL,
  `fp_user_type` varchar(255) DEFAULT NULL,
  `fp_token` varchar(255) NOT NULL,
  `fp_reset_url` text DEFAULT NULL,
  `fp_status` enum('0','1') NOT NULL DEFAULT '0',
  `fp_update_at` datetime DEFAULT NULL,
  PRIMARY KEY (`fp_id`),
  KEY `fp_token` (`fp_token`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `ed_global_configuration`
--

CREATE TABLE `ed_global_configuration` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `key` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `value` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `description` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `display_order` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_group_details`
--

CREATE TABLE `ed_group_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `member_id` (`member_id`),
  CONSTRAINT `ed_group_details_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `ed_group_master` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_group_details_ibfk_2` FOREIGN KEY (`member_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_group_master`
--

CREATE TABLE `ed_group_master` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `admin_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `admin_id` (`admin_id`),
  CONSTRAINT `ed_group_master_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_notification_log`
--

CREATE TABLE `ed_notification_log` (
  `nl_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Autoincrement ID',
  `nl_message` text NOT NULL COMMENT 'Notification Text',
  `nl_status` enum('0','1') NOT NULL DEFAULT '0' COMMENT 'status for checking notification sent to all or not',
  `created_date` datetime DEFAULT NULL COMMENT 'Time of notification sent',
  PRIMARY KEY (`nl_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_outlets`
--

CREATE TABLE `ed_outlets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `address` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `latitude` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `longitude` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `website_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `status` enum('A','I') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'A',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_outlets_images`
--

CREATE TABLE `ed_outlets_images` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `outlet_id` int(11) NOT NULL,
  `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `outlets_id` (`outlet_id`),
  CONSTRAINT `ed_outlets_images_ibfk_1` FOREIGN KEY (`outlet_id`) REFERENCES `ed_outlets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_outlets_offer`
--

CREATE TABLE `ed_outlets_offer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `outlets_id` int(11) NOT NULL,
  `offer_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `offer_description` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `offer_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `offer_discount_type` enum('%','$') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `offer_discount` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `redeem_points` int(11) NOT NULL,
  `start_date` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `end_date` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `status` enum('A','I') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'A',
  `coupon_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `outlets_id` (`outlets_id`),
  CONSTRAINT `ed_outlets_offer_ibfk_1` FOREIGN KEY (`outlets_id`) REFERENCES `ed_outlets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_parcel`
--

CREATE TABLE `ed_parcel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) DEFAULT NULL,
  `min_size` int(11) DEFAULT NULL,
  `max_size` int(11) DEFAULT NULL,
  `price` float NOT NULL DEFAULT 0,
  `status` enum('Active','Inactive','Deleted') DEFAULT 'Active',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_parcel_taxiowner`
--

CREATE TABLE `ed_parcel_taxiowner` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parcel_id` int(11) NOT NULL,
  `merchant_id` int(11) DEFAULT NULL,
  `taxi_owner_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_passenger_detail`
--

CREATE TABLE `ed_passenger_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `booking_history_id` int(11) NOT NULL,
  `seat_id` varchar(3) NOT NULL,
  `name` varchar(250) NOT NULL,
  `mobile_number` varchar(15) NOT NULL,
  `total_parcel` int(11) DEFAULT 0,
  `emergency_number` varchar(15) DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `gender` enum('Male','Female') DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `booking_history_id` (`booking_history_id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_passenger_parcel`
--

CREATE TABLE `ed_passenger_parcel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parcel_id` int(11) NOT NULL,
  `passenger_id` int(11) NOT NULL,
  `taxi_owner_id` int(11) DEFAULT NULL,
  `booking_history_id` int(11) DEFAULT NULL,
  `Title` varchar(100) DEFAULT NULL,
  `min_size` int(11) DEFAULT NULL,
  `max_size` int(11) DEFAULT NULL,
  `weight` float DEFAULT NULL,
  `price` float NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_password_recovery`
--

CREATE TABLE `ed_password_recovery` (
  `pwd_id` int(11) NOT NULL AUTO_INCREMENT,
  `usr_id` int(11) NOT NULL,
  `pwd_valid_stamp` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `pwd_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `pwd_status` enum('Y','N') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
  `pwd_updated_date` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`pwd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_redeemed_history`
--

CREATE TABLE `ed_redeemed_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `outlet_id` int(11) NOT NULL,
  `outlet_offer_id` int(11) NOT NULL,
  `redeemed_points` int(11) NOT NULL,
  `coupon_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `outlet_id` (`outlet_id`),
  KEY `outlet_offer_id` (`outlet_offer_id`),
  CONSTRAINT `ed_redeemed_history_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_redeemed_history_ibfk_2` FOREIGN KEY (`outlet_id`) REFERENCES `ed_outlets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_redeemed_history_ibfk_3` FOREIGN KEY (`outlet_offer_id`) REFERENCES `ed_outlets_offer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_routes`
--

CREATE TABLE `ed_routes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `stand_point` varchar(250) NOT NULL,
  `stand_point_lat` varchar(50) DEFAULT NULL,
  `stand_point_long` varchar(50) DEFAULT NULL,
  `status` enum('A','I') DEFAULT 'A',
  `place_id` varchar(50) DEFAULT NULL,
  `created_by` int(6) unsigned NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_ticket_detail`
--

CREATE TABLE `ed_ticket_detail` (
  `td_id` int(11) NOT NULL AUTO_INCREMENT,
  `tm_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `cust_id` int(11) DEFAULT NULL,
  `mch_id` int(11) DEFAULT NULL COMMENT 'Merchant Id',
  `td_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `td_created_date` datetime DEFAULT NULL,
  PRIMARY KEY (`td_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `ed_ticket_master`
--

CREATE TABLE `ed_ticket_master` (
  `tm_id` int(11) NOT NULL AUTO_INCREMENT,
  `cust_id` int(11) DEFAULT NULL COMMENT 'Customer id by whom ticket raised',
  `mch_id` int(11) DEFAULT NULL COMMENT 'Merchant Id',
  `tm_priority` enum('High','Low','Medium') NOT NULL DEFAULT 'Low' COMMENT 'Ticket priority',
  `tm_subject` varchar(255) NOT NULL COMMENT 'Ticket Subject',
  `tm_status` enum('Completed','In-Process','Open','Pending') NOT NULL DEFAULT 'Pending' COMMENT 'Ticket Status',
  `tm_created_date` timestamp NULL DEFAULT current_timestamp() COMMENT 'Ticket created date',
  `tm_updated_date` datetime DEFAULT NULL COMMENT 'Ticket updated date',
  PRIMARY KEY (`tm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_transport_vehicles`
--

CREATE TABLE `ed_transport_vehicles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vehicle_number` varchar(50) NOT NULL,
  `name` varchar(250) DEFAULT NULL,
  `owner_id` int(6) unsigned NOT NULL,
  `qr_code` varchar(10) NOT NULL,
  `current_route_id` int(11) DEFAULT NULL,
  `duty_id` int(11) DEFAULT NULL,
  `current_trip_id` int(11) DEFAULT NULL,
  `type` varchar(20) NOT NULL,
  `sitting_type` enum('1x2','2x2','3x2','') DEFAULT NULL,
  `depot_id` int(11) NOT NULL,
  `is_ac` enum('1','0') NOT NULL COMMENT '1=Yes, 0=No',
  `maintenance_date` date DEFAULT NULL,
  `licence_expire_date` date DEFAULT NULL,
  `no_of_seats` int(11) NOT NULL,
  `engine_capacity` float DEFAULT NULL,
  `fuel_efficiency` float DEFAULT NULL,
  `status` enum('A','I','W') NOT NULL DEFAULT 'A',
  `current_location` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `owner_id` (`owner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=429 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_transport_vehicles_available_at`
--

CREATE TABLE `ed_transport_vehicles_available_at` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transport_vehicles_id` int(11) DEFAULT NULL,
  `route_id` int(11) NOT NULL,
  `duty_id` int(11) DEFAULT NULL,
  `driver_id` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `day` enum('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday') DEFAULT NULL,
  `is_deleted` varchar(255) DEFAULT 'N',
  PRIMARY KEY (`id`),
  KEY `transport_vehicles_id` (`transport_vehicles_id`),
  KEY `route_id` (`route_id`)
) ENGINE=InnoDB AUTO_INCREMENT=477 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_transport_vehicles_qr_code`
--

CREATE TABLE `ed_transport_vehicles_qr_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transport_vehicles_id` int(11) NOT NULL,
  `qr_code` varchar(10) NOT NULL,
  `seat_id` varchar(6) DEFAULT NULL,
  `status` enum('A','I') NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `transport_vehicles_id` (`transport_vehicles_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24373 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_trip_acceleration`
--

CREATE TABLE `ed_trip_acceleration` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `trip_id` int(11) NOT NULL,
  `latlong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `time` datetime NOT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `trip_id` (`trip_id`),
  CONSTRAINT `ed_trip_acceleration_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_trip_acceleration_ibfk_2` FOREIGN KEY (`trip_id`) REFERENCES `ed_trip_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1398 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_trip_breaking`
--

CREATE TABLE `ed_trip_breaking` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `trip_id` int(11) NOT NULL,
  `latlong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `time` datetime NOT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `trip_id` (`trip_id`),
  CONSTRAINT `ed_trip_breaking_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_trip_breaking_ibfk_2` FOREIGN KEY (`trip_id`) REFERENCES `ed_trip_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_trip_details`
--

CREATE TABLE `ed_trip_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `trip_id` int(11) DEFAULT NULL,
  `driver_id` int(11) NOT NULL,
  `trip_source` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `trip_destination` text CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `start_point` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `end_point` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `action` enum('START','STOP','INTERRUPT') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `distance_covered` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `average_speed` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `trip_points_earned` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `trip_points_percentage` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `polyline` text CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `efficiency` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `incident` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `trip_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `end_by` varchar(200) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  CONSTRAINT `ed_trip_details_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1253 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_trip_over_road_speed_limit`
--

CREATE TABLE `ed_trip_over_road_speed_limit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `trip_id` int(11) NOT NULL,
  `latlong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `time` datetime NOT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `speed` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `trip_id` (`trip_id`),
  CONSTRAINT `ed_trip_over_road_speed_limit_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_trip_over_road_speed_limit_ibfk_2` FOREIGN KEY (`trip_id`) REFERENCES `ed_trip_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=682 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_trip_over_speed_limit`
--

CREATE TABLE `ed_trip_over_speed_limit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `trip_id` int(11) NOT NULL,
  `latlong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `time` datetime NOT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `speed` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `trip_id` (`trip_id`),
  CONSTRAINT `ed_trip_over_speed_limit_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `ed_driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ed_trip_over_speed_limit_ibfk_2` FOREIGN KEY (`trip_id`) REFERENCES `ed_trip_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_user`
--



--
-- Table structure for table `ed_user_otp`
--

CREATE TABLE `ed_user_otp` (
  `otp_id` int(6) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Auto-incremented Id',
  `country_code` varchar(10) DEFAULT NULL,
  `otp_mobile` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Customer Mobile Number',
  `otp_pin` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'OTP Pin',
  `otp_status` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'N' COMMENT 'OTP Used or not?',
  `otp_for` enum('LOGIN','REGISTRATION','FORGOT_PASSWORD','CHANGE_MOBILE') NOT NULL DEFAULT 'LOGIN',
  `created_date` datetime DEFAULT NULL,
  `usr_id` int(6) unsigned DEFAULT NULL,
  `usr_type` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`otp_id`),
  KEY `usr_id` (`usr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5505 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Table structure for table `ed_users_penalty_bookings`
--

CREATE TABLE `ed_users_penalty_bookings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tbl_booking_history_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `amount` float NOT NULL,
  `is_refunded` tinyint(4) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tbl_booking_history_id` (`tbl_booking_history_id`),
  KEY `customer_id` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `ed_version`
--

CREATE TABLE `ed_version` (
  `id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `app_version` varchar(10) NOT NULL,
  `device_type` enum('IOS','ANDROID') NOT NULL,
  `is_terminated` tinyint(1) NOT NULL DEFAULT 0,
  `is_deprecated` tinyint(1) NOT NULL DEFAULT 0,
  `created_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `fare_amount`
--

CREATE TABLE `fare_amount` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `start_point` int(11) NOT NULL,
  `end_point` int(11) NOT NULL,
  `fare_amount` float NOT NULL DEFAULT 0,
  `distance` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1764271 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `mobile_user_otp`
--

CREATE TABLE `mobile_user_otp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `otp` int(11) NOT NULL,
  `is_verified` enum('Y','N') NOT NULL DEFAULT 'N',
  `driver_trip_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `driver_trip_id` (`driver_trip_id`),
  CONSTRAINT `mobile_user_otp_ibfk_1` FOREIGN KEY (`driver_trip_id`) REFERENCES `driver_trips` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=1514 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `page_access`
--

CREATE TABLE `page_access` (
  `pa_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `page_name` varchar(50) NOT NULL,
  `page_desc` text NOT NULL,
  `page_create` enum('Y','N') DEFAULT 'N',
  `page_update` enum('Y','N') DEFAULT 'N',
  `page_delete` enum('Y','N') DEFAULT 'N',
  `priority` int(11) NOT NULL,
  PRIMARY KEY (`pa_id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `pause_reason`
--

CREATE TABLE `pause_reason` (
  `pause_reason_id` int(11) NOT NULL AUTO_INCREMENT,
  `pause_reason` varchar(50) NOT NULL,
  `pause_reason_desc` varchar(50) NOT NULL,
  PRIMARY KEY (`pause_reason_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `payment_transaction`
--

CREATE TABLE `payment_transaction` (
  `payment_transaction_id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_trip_id` int(11) NOT NULL,
  `driver_id` int(11) NOT NULL,
  `vehicle_id` int(11) NOT NULL,
  `start_point_id` int(11) NOT NULL,
  `end_point_id` int(11) NOT NULL,
  `fare_amount` float NOT NULL,
  `created_datetime` datetime NOT NULL,
  `transaction_type` enum('CASH') NOT NULL,
  `transaction_number` varchar(25) NOT NULL,
  PRIMARY KEY (`payment_transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `pin_point_select_log`
--

CREATE TABLE `pin_point_select_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_id` int(11) NOT NULL,
  `trip_id` int(11) NOT NULL,
  `selected_point` int(11) NOT NULL,
  `created_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `route`
--

CREATE TABLE `route` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(10) NOT NULL,
  `name` varchar(250) NOT NULL,
  `user_id` int(11) NOT NULL COMMENT 'Reference to user table',
  `transport_vehicle_id` int(11) DEFAULT NULL COMMENT 'Reference to bus table',
  `total_distance` float DEFAULT NULL,
  `route_start` time DEFAULT NULL,
  `route_end` time DEFAULT NULL,
  `status` enum('Active','Inactive','Delete') NOT NULL DEFAULT 'Active',
  `route_type` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`user_id`),
  KEY `bus_id` (`transport_vehicle_id`)
) ENGINE=InnoDB AUTO_INCREMENT=949 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `route_map`
--

CREATE TABLE `route_map` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `route_id` int(11) NOT NULL COMMENT 'Reference to route table',
  `pinpoint_name` varchar(250) NOT NULL,
  `latitude` varchar(20) NOT NULL,
  `longitude` varchar(20) NOT NULL,
  `time` time DEFAULT '00:00:00',
  `fare_amount` float NOT NULL,
  `polyline` mediumtext DEFAULT NULL,
  `route_order` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `route_id` (`route_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3910 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Table structure for table `tbl_booking_history`
--

CREATE TABLE `tbl_booking_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `qr_code` varchar(10) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `transport_vehicles_id` int(11) NOT NULL,
  `start_point_id` int(11) NOT NULL,
  `route_id` int(11) NOT NULL,
  `duty_id` int(11) DEFAULT NULL,
  `driver_trip_id` int(11) DEFAULT NULL,
  `end_point_id` int(11) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `fare_amount` float NOT NULL,
  `actual_amount` float NOT NULL,
  `no_of_seat` int(11) NOT NULL,
  `payment_mode` enum('Cash','Wallet') NOT NULL,
  `status` enum('Pending','Completed','CancleByDriver','Cancelled','PendingApprovalForCash') NOT NULL,
  `boarding_status` tinyint(1) NOT NULL,
  `booking_date` date NOT NULL,
  `booking_type` enum('Midway','Pre','Instant','Local') NOT NULL,
  `start_by` enum('Driver','Admin') DEFAULT 'Driver',
  `end_by` enum('Driver','Admin','System') DEFAULT 'Driver',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `start_point_name` varchar(250) DEFAULT NULL,
  `end_point_name` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_id` (`customer_id`),
  KEY `transport_vehicles_id` (`transport_vehicles_id`),
  KEY `driver_trip_id` (`driver_trip_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `tbl_booking_user_taxi_data`
--

CREATE TABLE `tbl_booking_user_taxi_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `booking_history_id` int(11) NOT NULL,
  `vehicle_type` enum('Bus','Taxi') DEFAULT NULL,
  `vehicle_number` varchar(50) DEFAULT NULL,
  `vehicle_name` varchar(250) DEFAULT NULL,
  `is_ac` enum('0','1') DEFAULT NULL,
  `no_of_seats` int(11) DEFAULT NULL,
  `customer_name` varchar(250) DEFAULT NULL,
  `customer_email` varchar(100) DEFAULT NULL,
  `customer_mobile` varchar(15) DEFAULT NULL,
  `balance` float DEFAULT NULL,
  `emergency_number` varchar(15) DEFAULT NULL,
  `driver_name` varchar(250) DEFAULT NULL,
  `driver_email` varchar(100) DEFAULT NULL,
  `driver_mobile` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tbl_booking_history_id` (`booking_history_id`),
  CONSTRAINT `tbl_booking_user_taxi_data_ibfk_1` FOREIGN KEY (`booking_history_id`) REFERENCES `tbl_booking_history` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `tbl_customer_transaction`
--

CREATE TABLE `tbl_customer_transaction` (
  `ct_id` int(11) NOT NULL AUTO_INCREMENT,
  `cust_id` int(11) NOT NULL COMMENT 'Customer id for whom balance updated',
  `customer_booking_id` int(11) DEFAULT NULL,
  `ct_type` enum('CREDIT','DEBIT') NOT NULL DEFAULT 'DEBIT' COMMENT ' Transaction type',
  `ct_amount` double(10,2) NOT NULL COMMENT ' Transaction amount ',
  `ct_description` text NOT NULL COMMENT ' Description',
  `ct_triggered_by` varchar(50) NOT NULL DEFAULT 'Portal' COMMENT ' Transaction done through from given',
  `ct_updated_by` int(11) DEFAULT NULL COMMENT ' Transaction done by ',
  `ct_updated_bal` double(10,2) NOT NULL DEFAULT 0.00 COMMENT ' Balance at transaction time ',
  `ct_updated_date` datetime DEFAULT NULL COMMENT ' Transaction done date time ',
  `sales_id` int(11) DEFAULT 0 COMMENT 'sale increment',
  `usage_id` int(11) DEFAULT 0 COMMENT 'usage increment',
  PRIMARY KEY (`ct_id`),
  KEY `cust_id` (`cust_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `tbl_mobile_user`
--

CREATE TABLE `tbl_mobile_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `taxi_owner_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `calmex_id` int(11) DEFAULT NULL,
  `calmex_url` text NOT NULL,
  `calmex_header` text NOT NULL,
  `name` varchar(250) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `country_code` varchar(10) DEFAULT NULL,
  `mobile` varchar(15) DEFAULT NULL,
  `passport_number` varchar(100) DEFAULT NULL,
  `emergency_number` varchar(15) DEFAULT NULL,
  `device_token` text DEFAULT NULL,
  `api_token` text DEFAULT NULL,
  `device_type` enum('Android','iOS') NOT NULL,
  `balance` float DEFAULT NULL,
  `profile_image` varchar(50) DEFAULT NULL,
  `type` enum('DRIVER','CUSTOMER') NOT NULL,
  `is_verified` enum('Yes','No') NOT NULL DEFAULT 'No',
  `is_profile_updated` enum('Yes','No') NOT NULL DEFAULT 'No',
  `transport_vehicle_id` int(11) DEFAULT NULL,
  `latitude` varchar(20) DEFAULT NULL,
  `longitude` varchar(20) DEFAULT NULL,
  `status` enum('A','I') NOT NULL DEFAULT 'A',
  `user_qr_code` varchar(15) DEFAULT NULL,
  `user_qr_number` varchar(15) DEFAULT NULL,
  `id_number` varchar(15) DEFAULT NULL,
  `company_id` int(11) DEFAULT 1,
  `created_by` int(11) DEFAULT NULL COMMENT 'Merchant Id',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `transport_vehicle_id` (`transport_vehicle_id`),
  KEY `taxi_owner_id` (`taxi_owner_id`),
  KEY `callmax_id` (`calmex_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Table structure for table `tbl_ticket_detail`
--

CREATE TABLE `tbl_ticket_detail` (
  `td_id` int(11) NOT NULL AUTO_INCREMENT,
  `tm_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `cust_id` int(11) DEFAULT NULL,
  `mch_id` int(11) DEFAULT NULL COMMENT 'Merchant Id',
  `td_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `td_created_date` datetime DEFAULT NULL,
  PRIMARY KEY (`td_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `tbl_user_otp`
--

CREATE TABLE `tbl_user_otp` (
  `otp_id` int(6) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Auto-incremented Id',
  `country_code` varchar(10) DEFAULT NULL,
  `otp_mobile` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Customer Mobile Number',
  `otp_pin` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'OTP Pin',
  `otp_status` enum('Y','N') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'N' COMMENT 'OTP Used or not?',
  `otp_for` enum('LOGIN','REGISTRATION','FORGOT_PASSWORD','CHANGE_MOBILE') NOT NULL DEFAULT 'LOGIN',
  `created_date` datetime DEFAULT NULL,
  `usr_id` int(6) unsigned DEFAULT NULL,
  `usr_type` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`otp_id`),
  KEY `usr_id` (`usr_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Table structure for table `trip_details_logs`
--

CREATE TABLE `trip_details_logs` (
  `trip_details_logs_id` int(11) NOT NULL AUTO_INCREMENT,
  `ed_trip_id` int(11) NOT NULL,
  `driver_trip_id` int(11) NOT NULL,
  `driver_id` int(11) NOT NULL,
  `vehicle_id` int(11) NOT NULL,
  `trip_source` text NOT NULL,
  `trip_destination` text NOT NULL,
  `start_point` varchar(255) NOT NULL,
  `end_point` varchar(255) NOT NULL,
  `disctance_covered` varchar(255) NOT NULL,
  `average_speed` varchar(255) NOT NULL,
  `trip_points_earned` varchar(255) NOT NULL,
  `trip_points_percentage` varchar(10) NOT NULL,
  `polyline` text NOT NULL,
  `efficiency` varchar(100) NOT NULL,
  `incident` varchar(100) NOT NULL,
  `trip_type` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `current_lat` varchar(255) NOT NULL,
  `current_lng` varchar(255) NOT NULL,
  PRIMARY KEY (`trip_details_logs_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `trip_status_history`
--

CREATE TABLE `trip_status_history` (
  `trip_status_history_id` int(11) NOT NULL AUTO_INCREMENT,
  `old_driver_trip_id` int(11) NOT NULL,
  `new_driver_trip_id` int(11) NOT NULL,
  `old_status` enum('Active','End','Paused') NOT NULL,
  `updated_status` enum('Paused','Resumed') NOT NULL,
  `updated_at` datetime NOT NULL,
  `trip_updated_for` enum('driver_change','vehicle_change') NOT NULL,
  `old_object_id` int(11) NOT NULL,
  `new_object_id` int(11) NOT NULL,
  `pause_reason_id` int(11) NOT NULL,
  `pause_description` text NOT NULL,
  PRIMARY KEY (`trip_status_history_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `user_depot_relation`
--

CREATE TABLE `user_depot_relation` (
  `user_depot_relation_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `depot_id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `updated_datetime` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`user_depot_relation_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


