-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 24, 2026 at 10:30 PM
-- Server version: 10.11.18-MariaDB-cll-lve
-- PHP Version: 8.4.24

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


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `track_db`
--

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

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

CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cache_locks`
--

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `complaints`
--

CREATE TABLE `complaints` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `complaint_number` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `mobile_number` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `category` varchar(255) NOT NULL DEFAULT 'General',
  `location_address` varchar(255) NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `description` text NOT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `admin_remarks` text DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `resolved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) 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 `contact_inquiries`
--

CREATE TABLE `contact_inquiries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'new',
  `admin_notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_inquiries`
--

INSERT INTO `contact_inquiries` (`id`, `name`, `phone`, `email`, `subject`, `message`, `status`, `admin_notes`, `created_at`, `updated_at`) VALUES
(1, 'Test', '9988775544', 'test123@gmail.com', 'Gobler', 'Test', 'read', NULL, '2026-08-21 22:11:38', '2026-08-21 22:11:51');

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

--
-- Table structure for table `driver_applications`
--

CREATE TABLE `driver_applications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_code` varchar(255) NOT NULL,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `gender` varchar(255) NOT NULL DEFAULT 'male',
  `age` int(11) NOT NULL,
  `experience_years` int(11) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `license_number` varchar(255) NOT NULL,
  `license_image_path` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `admin_notes` text DEFAULT NULL,
  `reviewed_by` bigint(20) UNSIGNED DEFAULT NULL,
  `reviewed_at` timestamp NULL 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 `driver_duties`
--

CREATE TABLE `driver_duties` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `duty_code` varchar(255) NOT NULL,
  `route_id` bigint(20) UNSIGNED NOT NULL,
  `employee_id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `duty_date` date NOT NULL,
  `shift` varchar(255) NOT NULL DEFAULT 'morning',
  `shift_id` bigint(20) UNSIGNED DEFAULT NULL,
  `shift_start_time` varchar(50) DEFAULT NULL,
  `shift_end_time` varchar(50) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'upcoming',
  `vehicle_tour_id` bigint(20) UNSIGNED DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `actual_distance_km` decimal(8,3) DEFAULT NULL,
  `actual_duration_seconds` int(10) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `driver_duties`
--

INSERT INTO `driver_duties` (`id`, `duty_code`, `route_id`, `employee_id`, `vehicle_id`, `duty_date`, `shift`, `shift_id`, `shift_start_time`, `shift_end_time`, `status`, `vehicle_tour_id`, `start_time`, `end_time`, `actual_distance_km`, `actual_duration_seconds`, `notes`, `created_at`, `updated_at`) VALUES
(1, 'DUTY-20260821-HRL4', 1, 11, 10, '2026-08-21', 'morning', NULL, '2026-08-21T20:00', '2026-08-21T20:30', 'completed', 27, '2026-08-21 21:08:01', '2026-08-21 21:08:20', 0.000, 19, 'Test', '2026-08-22 03:03:23', '2026-08-22 04:08:20'),
(2, 'DUTY-20260821-YS2T', 1, 11, 10, '2026-08-21', 'morning', NULL, '2026-08-21T06:00', '2026-08-21T14:00', 'completed', 28, '2026-08-21 21:08:59', '2026-08-21 21:09:15', 0.000, 16, '', '2026-08-22 03:44:14', '2026-08-22 04:09:15'),
(3, 'DUTY-20260821-VRS0', 1, 11, 10, '2026-08-21', 'morning', NULL, '2026-08-21T21:50', '2026-08-21T22:00', 'completed', 29, '2026-08-21 21:17:04', '2026-08-21 21:18:03', 0.000, 59, '', '2026-08-22 04:16:44', '2026-08-22 04:18:03'),
(6, 'DUTY-20260821-RBTB', 1, 11, 10, '2026-08-21', 'morning', NULL, '2026-08-21T21:00', '2026-08-21T22:10', 'missed', NULL, NULL, NULL, NULL, NULL, '', '2026-08-22 04:43:42', '2026-08-22 05:40:47'),
(8, 'DUTY-20260821-KCWV', 1, 11, 10, '2026-08-21', 'morning', NULL, '2026-08-21T23:00', '2026-08-21T23:10', 'completed', 32, '2026-08-21 23:08:37', '2026-08-21 23:09:11', 0.000, 34, '', '2026-08-22 05:54:18', '2026-08-22 06:09:11'),
(9, 'DUTY-20260822-83TW', 1, 11, 10, '2026-08-22', 'morning', NULL, '2026-08-22T12:50', '2026-08-22T01:10', 'completed', 33, '2026-08-22 00:49:33', '2026-08-22 00:50:27', 0.000, 54, '', '2026-08-22 07:49:20', '2026-08-22 07:50:27'),
(10, 'DUTY-20260822-ZIQW', 1, 11, 10, '2026-08-22', 'morning', NULL, '2026-08-22T06:00', '2026-08-22T14:00', 'completed', 34, '2026-08-22 01:11:02', '2026-08-22 01:12:36', 0.000, 94, '', '2026-08-22 08:09:49', '2026-08-22 08:12:36'),
(11, 'DUTY-20260822-CVPO', 1, 11, 10, '2026-08-22', 'morning', NULL, '2026-08-22T01:44', '2026-08-22T02:00', 'completed', 35, '2026-08-22 01:23:57', '2026-08-22 01:24:16', 0.000, 19, '', '2026-08-22 08:23:06', '2026-08-22 08:24:16'),
(12, 'DUTY-20260822-ZSP3', 1, 11, 10, '2026-08-22', 'morning', NULL, '2026-08-22T02:10', '2026-08-22T02:40', 'completed', 36, '2026-08-22 02:03:34', '2026-08-22 02:04:39', 0.000, 65, '', '2026-08-22 08:25:18', '2026-08-22 09:04:39'),
(13, 'DUTY-20260824-MCBN', 1, 11, 10, '2026-08-24', 'evening-shift', 2, '2026-08-24T14:30', '2026-08-24T22:00', 'completed', 37, '2026-08-24 14:15:59', '2026-08-24 14:19:10', 0.000, 191, '', '2026-08-24 21:15:02', '2026-08-24 21:19:10'),
(14, 'DUTY-20260824-5DI8', 1, 11, 10, '2026-08-24', 'evening-shift', 2, '2026-08-24T14:30', '2026-08-24T22:00', 'completed', 38, '2026-08-24 14:32:37', '2026-08-24 14:33:46', 0.000, 69, '', '2026-08-24 21:31:11', '2026-08-24 21:33:46'),
(15, 'DUTY-20260824-IXJW', 1, 11, 10, '2026-08-24', 'morning-shift', 1, '2026-08-24T06:00', '2026-08-24T14:00', 'missed', NULL, NULL, NULL, NULL, NULL, '', '2026-08-25 00:29:23', '2026-08-25 00:29:23'),
(16, 'DUTY-20260824-3LNI', 1, 11, 10, '2026-08-24', 'evening-shift', 2, '2026-08-24T14:30', '2026-08-24T22:00', 'completed', 39, '2026-08-24 17:31:31', '2026-08-24 17:31:53', 0.000, 22, '', '2026-08-25 00:29:54', '2026-08-25 00:31:53'),
(17, 'DUTY-20260824-HEXT', 1, 11, 10, '2026-08-24', 'night-shift', 3, '2026-08-24T18:00', '2026-08-25T06:00', 'completed', 40, '2026-08-24 18:13:02', '2026-08-24 18:13:33', 0.000, 31, '', '2026-08-25 01:01:46', '2026-08-25 01:13:33');

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

--
-- Table structure for table `duty_driver_vehicle_assignments`
--

CREATE TABLE `duty_driver_vehicle_assignments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `driver_duty_id` bigint(20) UNSIGNED NOT NULL,
  `employee_id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_tour_id` bigint(20) UNSIGNED DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `distance_km` double NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL DEFAULT 'assigned',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `duty_driver_vehicle_assignments`
--

INSERT INTO `duty_driver_vehicle_assignments` (`id`, `driver_duty_id`, `employee_id`, `vehicle_id`, `vehicle_tour_id`, `start_time`, `end_time`, `distance_km`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(2, 13, 11, 10, NULL, '2026-08-24 14:30:00', '2026-08-24 22:00:00', 0, 'completed', NULL, '2026-08-24 21:30:55', '2026-08-24 21:30:55'),
(3, 14, 11, 10, 38, '2026-08-24 14:32:37', '2026-08-24 14:33:46', 0, 'completed', NULL, '2026-08-24 21:31:11', '2026-08-24 21:33:46'),
(4, 15, 11, 10, NULL, '2026-08-24 06:00:00', '2026-08-24 14:00:00', 0, 'upcoming', NULL, '2026-08-25 00:29:23', '2026-08-25 00:29:23'),
(5, 16, 11, 10, 39, '2026-08-24 17:31:31', '2026-08-24 17:31:53', 0, 'completed', NULL, '2026-08-25 00:29:54', '2026-08-25 00:31:53'),
(7, 17, 11, 10, 40, '2026-08-24 18:13:02', '2026-08-24 18:13:33', 0, 'completed', NULL, '2026-08-25 01:06:01', '2026-08-25 01:13:33');

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

--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `employee_code` varchar(255) DEFAULT NULL,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `profile_pic` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `pincode` varchar(255) DEFAULT NULL,
  `mobile_number` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `whatsapp_number` varchar(255) DEFAULT NULL,
  `emergency_contact` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `fcm_token` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `employees`
--

INSERT INTO `employees` (`id`, `user_id`, `employee_code`, `first_name`, `last_name`, `dob`, `gender`, `profile_pic`, `address`, `city`, `state`, `pincode`, `mobile_number`, `email`, `whatsapp_number`, `emergency_contact`, `status`, `fcm_token`, `created_at`, `updated_at`) VALUES
(11, 5, 'EMP-0010', 'JATIN', 'CHABBRA', '2001-08-08', 'Male', NULL, 'Test a', 'Amritsar', 'Punjab', '143001', '998877655', 'jatin@gmail.com', '9855995699', '', 'active', NULL, '2026-08-19 15:32:50', '2026-08-22 19:17:24'),
(12, 6, 'EMP-0012', 'Rahul', 'Sharma', '2000-01-01', 'Male', 'employees/YQIuso7VUtzUfDleKyDOkrTACd67un.webp', '', '', '', '', '7814358405', 'rahul@gmail.com', '', '', 'active', NULL, '2026-08-22 19:18:24', '2026-08-22 19:18:24');

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` varchar(255) NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` smallint(5) 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 `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `master_items`
--

CREATE TABLE `master_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL DEFAULT 'General',
  `description` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `master_items`
--

INSERT INTO `master_items` (`id`, `name`, `code`, `category`, `description`, `status`, `created_at`, `updated_at`) VALUES
(1, 'non expedita', 'MST-13929', 'Services', 'Et culpa doloribus ab id voluptatem aliquam adipisci.', 'active', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(2, 'voluptas voluptatem', 'MST-75006', 'Employees', 'Necessitatibus excepturi ex tempora quas qui.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(3, 'saepe non', 'MST-75207', 'General', 'Dolor nobis sed suscipit quod quia sunt.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(4, 'est eos', 'MST-88576', 'General', 'Adipisci laborum omnis vel voluptates tempora.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(5, 'non minima', 'MST-22972', 'Employees', 'Aperiam omnis dolorum dolor ea totam laborum.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(6, 'hic expedita', 'MST-18262', 'Events', 'Esse aut in fugit vero quae blanditiis ipsam.', 'active', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(7, 'velit ut', 'MST-85987', 'Employees', 'Corporis est vel itaque rerum molestias sit.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(8, 'numquam ut', 'MST-57571', 'Events', 'Laborum velit quibusdam magni eum non cumque.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(9, 'ut non', 'MST-44607', 'Events', 'Sed aut iste dolorum qui voluptatem quam commodi.', 'active', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(10, 'nostrum voluptas', 'MST-97503', 'Employees', 'Minima non quidem consequuntur quam sunt.', 'active', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(11, 'quaerat dolores', 'MST-29028', 'Services', 'Aut voluptate eum et.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(12, 'expedita sit', 'MST-68005', 'Events', 'Fugiat ut nisi accusamus et ratione omnis sed.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(13, 'cumque nulla', 'MST-89466', 'Employees', 'Aut ut praesentium quidem eligendi debitis inventore et.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(14, 'nesciunt velit', 'MST-86976', 'General', 'Maiores cum rem voluptatem et consequatur animi.', 'inactive', '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(15, 'ut porro', 'MST-53056', 'General', 'Quia nam iure quo omnis.', 'active', '2026-08-19 11:39:37', '2026-08-19 11:39:37');

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

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

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

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2024_01_01_000000_create_passkeys_table', 1),
(5, '2025_08_14_170933_add_two_factor_columns_to_users_table', 1),
(6, '2026_08_19_042453_add_is_admin_to_users_table', 1),
(7, '2026_08_19_042850_create_master_items_table', 1),
(8, '2026_08_19_044810_create_vehicle_categories_table', 2),
(9, '2026_08_19_044811_create_employees_table', 2),
(10, '2026_08_19_044812_create_vehicles_table', 2),
(11, '2026_08_19_053105_create_vehicle_tours_table', 3),
(12, '2026_08_19_053106_create_tour_waypoints_table', 3),
(13, '2026_08_19_053833_add_assigned_employee_id_to_vehicles_table', 4),
(14, '2026_08_19_054721_create_vehicle_images_and_employee_auth_fields', 5),
(15, '2026_08_20_152026_create_personal_access_tokens_table', 6),
(16, '2026_08_21_125333_create_contact_inquiries_table', 7),
(17, '2026_08_21_160500_create_service_areas_table', 8),
(18, '2026_08_21_162000_create_routes_table', 8),
(19, '2026_08_21_162100_create_driver_duties_table', 8),
(20, '2026_08_21_162200_add_duty_and_route_to_vehicle_tours', 8),
(21, '2026_08_21_164601_add_shift_times_to_driver_duties_table', 8),
(22, '2026_08_21_165500_update_shift_times_length_in_driver_duties_table', 8),
(23, '2026_08_21_174823_create_tour_photos_table', 8),
(24, '2026_08_21_175454_create_complaints_table', 8),
(25, '2026_08_21_213600_update_driver_duties_assigned_to_upcoming', 9),
(26, '2026_08_22_153630_create_route_lanes_table', 10),
(27, '2026_08_22_154048_create_shifts_and_add_shift_id_to_driver_duties_table', 10),
(28, '2026_08_22_155711_add_operating_days_to_routes_table', 10),
(29, '2026_08_22_170000_create_duty_driver_vehicle_assignments_table', 10),
(30, '2026_08_22_180000_add_permissions_to_users_table', 10),
(31, '2026_08_22_190000_add_color_code_to_vehicle_categories_table', 10),
(32, '2026_08_23_200000_create_vehicle_cameras_table', 10),
(33, '2026_08_23_210000_create_telematics_alerts_table', 10),
(34, '2026_08_23_220000_create_driver_applications_table', 10),
(35, '2026_08_24_090603_add_fcm_token_to_users_and_employees_table', 10);

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

--
-- Table structure for table `passkeys`
--

CREATE TABLE `passkeys` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `credential_id` varchar(255) NOT NULL,
  `credential` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`credential`)),
  `last_used_at` timestamp NULL 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 `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) UNSIGNED NOT NULL,
  `name` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `personal_access_tokens`
--

INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES
(2, 'App\\Models\\User', 5, 'Flutter iOS App', '7fed4db5b11052e3fcfaf8d9a72a380c47f00852aa4b91d7e8e52af80f47eb1f', '[\"*\"]', '2026-08-21 17:49:07', NULL, '2026-08-20 22:47:30', '2026-08-21 17:49:07'),
(5, 'App\\Models\\User', 5, 'Flutter Android App', '02facaf2b30ae59a9d64bf060a4359c2934671cf1f58c104ab7e5953aa022cce', '[\"*\"]', '2026-08-21 18:32:55', NULL, '2026-08-21 18:09:12', '2026-08-21 18:32:55'),
(6, 'App\\Models\\User', 5, 'Flutter Android App', 'eaa8538187bc700f07aaa2fcdce34b0d53b09d00644c610891dac66e8d6f4e78', '[\"*\"]', '2026-08-21 19:03:01', NULL, '2026-08-21 18:59:24', '2026-08-21 19:03:01'),
(7, 'App\\Models\\User', 5, 'Flutter Android App', 'f8dcb2fd1c631d5886988f4d0c961a20a16b2d74a9fd0b3ded53f3c20a9a4d7c', '[\"*\"]', '2026-08-21 19:35:11', NULL, '2026-08-21 19:01:53', '2026-08-21 19:35:11'),
(8, 'App\\Models\\User', 5, 'Flutter iOS App', '5280095356dc14402871adeb180b1be8817055bc46171ac339df3232113f62c4', '[\"*\"]', '2026-08-24 17:51:17', NULL, '2026-08-22 02:31:32', '2026-08-24 17:51:17'),
(9, 'App\\Models\\User', 5, 'Flutter Android App', '9e95b22b99fb0bba1b7df6e42d0fe12de25eec9c630871129ccc8f2fc4ac8745', '[\"*\"]', '2026-08-22 19:04:34', NULL, '2026-08-22 19:03:41', '2026-08-22 19:04:34'),
(11, 'App\\Models\\User', 5, 'Flutter Android App', 'fd9e41adbdc7150228e89867027339dd9c31d2d6de7f0577602172e18bc4d5d7', '[\"*\"]', '2026-08-25 01:13:38', NULL, '2026-08-24 21:09:38', '2026-08-25 01:13:38');

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

--
-- Table structure for table `routes`
--

CREATE TABLE `routes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `total_distance_km` decimal(8,3) NOT NULL DEFAULT 0.000,
  `operating_days` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`operating_days`)),
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `routes`
--

INSERT INTO `routes` (`id`, `name`, `code`, `description`, `total_distance_km`, `operating_days`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Route-1 Hall Bazar', 'RT-LRDI', 'Hall Bazar Route', 0.000, NULL, 'active', '2026-08-22 02:51:35', '2026-08-22 02:51:35'),
(2, 'ISBT-AMRITSAR', 'RT-3JZ0', 'BUS STAND AMRITSAR', 12.000, '[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\"]', 'active', '2026-08-22 19:19:25', '2026-08-24 21:13:51');

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

--
-- Table structure for table `route_lanes`
--

CREATE TABLE `route_lanes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `route_id` bigint(20) UNSIGNED NOT NULL,
  `lane_name` varchar(255) NOT NULL,
  `distance_km` decimal(8,3) NOT NULL DEFAULT 0.000,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `image_path` varchar(255) DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `route_lanes`
--

INSERT INTO `route_lanes` (`id`, `route_id`, `lane_name`, `distance_km`, `latitude`, `longitude`, `image_path`, `sort_order`, `notes`, `created_at`, `updated_at`) VALUES
(1, 2, 'Lane 1', 2.000, NULL, NULL, NULL, 1, '', '2026-08-24 21:13:51', '2026-08-24 21:13:51'),
(2, 2, 'Lane 2', 10.000, NULL, NULL, NULL, 2, '', '2026-08-24 21:13:51', '2026-08-24 21:13:51');

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

--
-- Table structure for table `service_areas`
--

CREATE TABLE `service_areas` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL DEFAULT 'Amritsar, Punjab',
  `coverage_km` varchar(255) DEFAULT NULL,
  `machinery_deployed` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `pdf_path` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_areas`
--

INSERT INTO `service_areas` (`id`, `name`, `slug`, `city`, `coverage_km`, `machinery_deployed`, `description`, `pdf_path`, `status`, `sort_order`, `created_at`, `updated_at`) VALUES
(1, 'Amritsar', 'amritsar', 'Amritsar, Punjab', NULL, NULL, NULL, 'service-areas/service_map_amritsar_1787320935.pdf', 'active', 0, '2026-08-22 02:32:15', '2026-08-22 02:32:15');

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

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

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

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('24qTka7uQniwpKnumzXt9LfTfaEMn4kvuUS1kmMJ', NULL, '103.183.33.53', 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36', 'eyJfdG9rZW4iOiI5MWVaUW4zTG9OcnlQdWZTZ2pRUU1QUDNpQm9rNWJBNTJENVM1NWJhIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHBzOlwvXC90cmFjay50ZXN0bXljb2Rlcy5jb20iLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', 1787596046),
('4cFyNVUM66BqT5WtezI4dxG8i0FzRyykDKHzpo9t', NULL, '152.58.106.99', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36', 'eyJfdG9rZW4iOiJrcEhiSFBUTUZQbW12ajJldmxjTk5GNllWWW1WOG9LcVpKa09zSUtNIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHBzOlwvXC90cmFjay50ZXN0bXljb2Rlcy5jb21cL2ZsZWV0Iiwicm91dGUiOiJmbGVldCJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19', 1787565092),
('eXTj7XQogCfbBy7SLNhDBJK2tZ3F2cA5ti88Jk2c', 1, '49.43.90.48', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36', 'eyJfdG9rZW4iOiJ4RzBUMVJ1MU9jRVRUSm9hUlNWMmFHQk1ONjRKdnBkdjRZNlZYM2NlIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cHM6XC9cL3RyYWNrLnRlc3RteWNvZGVzLmNvbVwvYWRtaW5cL2R1dGllcyIsInJvdXRlIjoiYWRtaW4uZHV0aWVzLmluZGV4In0sImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjoxfQ==', 1787574962);

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

--
-- Table structure for table `shifts`
--

CREATE TABLE `shifts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shifts`
--

INSERT INTO `shifts` (`id`, `name`, `code`, `start_time`, `end_time`, `description`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Morning Shift', 'SH-MORNING', '06:00:00', '14:00:00', '', 'active', '2026-08-24 21:11:50', '2026-08-24 21:11:50'),
(2, 'Evening Shift', 'SH-EVENING', '14:30:00', '22:00:00', '', 'active', '2026-08-24 21:12:45', '2026-08-24 21:14:40'),
(3, 'Night Shift', 'SH-NIGHT', '22:00:00', '06:00:00', '', 'active', '2026-08-24 21:13:12', '2026-08-24 21:13:12');

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

--
-- Table structure for table `telematics_alerts`
--

CREATE TABLE `telematics_alerts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `alert_code` varchar(255) NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `employee_id` bigint(20) UNSIGNED DEFAULT NULL,
  `driver_duty_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_tour_id` bigint(20) UNSIGNED DEFAULT NULL,
  `route_id` bigint(20) UNSIGNED DEFAULT NULL,
  `alert_type` varchar(255) NOT NULL,
  `severity` varchar(255) NOT NULL DEFAULT 'medium',
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `location_name` varchar(255) DEFAULT NULL,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `threshold_value` varchar(255) DEFAULT NULL,
  `actual_value` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'new',
  `resolved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `resolution_notes` text DEFAULT NULL,
  `triggered_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `telematics_alerts`
--

INSERT INTO `telematics_alerts` (`id`, `alert_code`, `vehicle_id`, `employee_id`, `driver_duty_id`, `vehicle_tour_id`, `route_id`, `alert_type`, `severity`, `title`, `description`, `location_name`, `latitude`, `longitude`, `threshold_value`, `actual_value`, `status`, `resolved_by`, `resolved_at`, `resolution_notes`, `triggered_at`, `created_at`, `updated_at`) VALUES
(1, 'ALT-20260824-0001', 10, 11, 13, 37, 1, 'incident', 'high', 'test', 'tes', NULL, 31.6420821, 74.8768757, NULL, NULL, 'new', NULL, NULL, NULL, '2026-08-24 21:18:34', '2026-08-24 21:18:34', '2026-08-24 21:18:34'),
(2, 'ALT-20260824-0002', 10, 11, 14, 38, 1, 'incident', 'high', 'twatbsbsbbs', 'gsgshgsgs', NULL, 31.6420671, 74.8768922, NULL, NULL, 'new', NULL, NULL, NULL, '2026-08-24 21:33:06', '2026-08-24 21:33:06', '2026-08-24 21:33:06'),
(3, 'ALT-20260824-0003', 10, 11, 17, 40, 1, 'incident', 'high', 'dgg', 'fff', NULL, 31.6420272, 74.8769019, NULL, NULL, 'new', NULL, NULL, NULL, '2026-08-25 01:13:20', '2026-08-25 01:13:20', '2026-08-25 01:13:20');

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

--
-- Table structure for table `tour_photos`
--

CREATE TABLE `tour_photos` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_tour_id` bigint(20) UNSIGNED DEFAULT NULL,
  `driver_duty_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `employee_id` bigint(20) UNSIGNED DEFAULT NULL,
  `photo_path` varchar(255) NOT NULL,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `caption` varchar(255) DEFAULT NULL,
  `stage` varchar(255) NOT NULL DEFAULT 'in_progress',
  `taken_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tour_photos`
--

INSERT INTO `tour_photos` (`id`, `vehicle_tour_id`, `driver_duty_id`, `user_id`, `employee_id`, `photo_path`, `latitude`, `longitude`, `caption`, `stage`, `taken_at`, `created_at`, `updated_at`) VALUES
(1, 32, 8, 1, 11, 'tours/32/photos/TcW4qlCMDa20KRNxBHOdtJdm4RNq4GTB1dolCXma.jpg', NULL, NULL, 'Admin Inspection / Completion Photo', 'completed', '2026-08-22 06:37:01', '2026-08-22 06:37:01', '2026-08-22 06:37:01'),
(2, 36, 12, 5, 11, 'tours/36/photos/d70PcXJKCsNEPuoXU7Kwfpo7I9wqOYz93bO5CZ9z.png', 37.7858340, -122.4064170, 'Road Sweeping Live Photo', 'in_progress', '2026-08-22 03:33:54', '2026-08-22 09:04:02', '2026-08-22 09:04:02'),
(3, 36, 12, 5, 11, 'tours/36/photos/Z4xMBQbvJn3McwO34Qbu4RtWeOYhvguMeN0lH1dN.png', 37.7858340, -122.4064170, 'Road Sweeping Live Photo', 'in_progress', '2026-08-22 03:33:54', '2026-08-22 09:04:02', '2026-08-22 09:04:02'),
(4, 36, 12, 5, 11, 'tours/36/photos/1BtjUcoFVsxqo3hrwXenynFSm0BbvaXDT2FCX1UC.png', 37.7858340, -122.4064170, 'Duty Completion Verification Photo', 'completed', '2026-08-22 09:04:39', '2026-08-22 09:04:39', '2026-08-22 09:04:39'),
(5, 37, 13, 5, 11, 'tours/37/incidents/g4zfkFt9CqGwaF43N4E4SltY9FcjLcHxBjFK5sdZ.jpg', 31.6420821, 74.8768757, 'Incident Proof: test', 'checkpoint', '2026-08-24 21:18:34', '2026-08-24 21:18:34', '2026-08-24 21:18:34'),
(6, 37, 13, 5, 11, 'tours/37/photos/ypzeiLSbf8WT7tOwT23uct5BanEafB2KcK3EnsaP.jpg', 31.6420976, 74.8768849, 'Road Sweeping Live Photo', 'in_progress', '2026-08-24 15:48:48', '2026-08-24 21:18:57', '2026-08-24 21:18:57'),
(7, 38, 14, 5, 11, 'tours/38/incidents/RRiLXGhb0IWIjNNWLtI1qqBDwWV8GtaooSrlSRrH.jpg', 31.6420671, 74.8768922, 'Incident Proof: twatbsbsbbs', 'checkpoint', '2026-08-24 21:33:06', '2026-08-24 21:33:06', '2026-08-24 21:33:06'),
(8, 38, 14, 5, 11, 'tours/38/photos/EhCg6Qi5zudgTHZLAAGTC9RUZRGjrR5BO5vuo3mV.jpg', 31.6420924, 74.8768757, 'gagsgsggs', 'in_progress', '2026-08-24 16:03:19', '2026-08-24 21:33:29', '2026-08-24 21:33:29'),
(9, 38, 14, 5, 11, 'tours/38/photos/yx5fcdjpHeyyCMA1BJ2sYNX9ViQrTzNrnEAC3N8k.jpg', 31.6421030, 74.8768749, 'Duty Completion Verification Photo', 'completed', '2026-08-24 21:33:46', '2026-08-24 21:33:46', '2026-08-24 21:33:46'),
(10, 39, 16, 5, 11, 'tours/39/photos/XB67YC25dIbqtkP1v7UKXWn6PjNVBGgBfIgKalES.jpg', NULL, NULL, 'Duty Start Live Verification Photo', 'start', '2026-08-25 00:31:31', '2026-08-25 00:31:31', '2026-08-25 00:31:31'),
(11, 39, 16, 5, 11, 'tours/39/photos/Pgh51pY6bBff2OApySbKTDVDclkrCRtdg1ym6bkl.jpg', 31.6420932, 74.8767035, 'Duty End Live Photo Verification', 'completed', '2026-08-25 00:31:53', '2026-08-25 00:31:53', '2026-08-25 00:31:53'),
(12, 40, 17, 5, 11, 'tours/40/photos/98qI2b1Ed1uvoUyy03Su02tfepiUDHLwTIqU5YqM.jpg', 31.6420245, 74.8769102, 'Duty Start Live Verification Photo', 'start', '2026-08-25 01:13:02', '2026-08-25 01:13:02', '2026-08-25 01:13:02'),
(13, 40, 17, 5, 11, 'tours/40/incidents/f6S4MzXpWOlvnSF3STiNd0yzPtj2gPoXwfkHySCm.jpg', 31.6420272, 74.8769019, 'Incident Proof: dgg', 'checkpoint', '2026-08-25 01:13:20', '2026-08-25 01:13:20', '2026-08-25 01:13:20'),
(14, 40, 17, 5, 11, 'tours/40/photos/pdDhbjkXB3lU1gBnKOAkiOGLqZODMXBHC5iAYm42.jpg', 31.6420237, 74.8769060, 'Duty Completion Live Photo', 'completed', '2026-08-25 01:13:33', '2026-08-25 01:13:33', '2026-08-25 01:13:33');

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

--
-- Table structure for table `tour_waypoints`
--

CREATE TABLE `tour_waypoints` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_tour_id` bigint(20) UNSIGNED NOT NULL,
  `latitude` decimal(10,7) NOT NULL,
  `longitude` decimal(10,7) NOT NULL,
  `speed` double DEFAULT NULL,
  `distance_from_previous_km` decimal(8,4) NOT NULL DEFAULT 0.0000,
  `recorded_at` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tour_waypoints`
--

INSERT INTO `tour_waypoints` (`id`, `vehicle_tour_id`, `latitude`, `longitude`, `speed`, `distance_from_previous_km`, `recorded_at`, `created_at`, `updated_at`) VALUES
(2906, 23, 31.6420572, 74.8768886, 0, 0.0000, '2026-08-21 11:09:27', '2026-08-21 18:09:27', '2026-08-21 18:09:27'),
(2907, 23, 31.6420996, 74.8768778, 0, 0.0000, '2026-08-21 11:09:43', '2026-08-21 18:09:44', '2026-08-21 18:09:44'),
(2908, 23, 31.6420920, 74.8768825, 0.067320883274078, 0.0000, '2026-08-21 11:09:51', '2026-08-21 18:09:53', '2026-08-21 18:09:53'),
(2909, 23, 31.6421042, 74.8768792, 0.15308427810669, 0.0000, '2026-08-21 11:10:02', '2026-08-21 18:10:04', '2026-08-21 18:10:04'),
(2910, 23, 31.6421135, 74.8768782, 0.095201380550861, 0.0000, '2026-08-21 11:10:11', '2026-08-21 18:10:12', '2026-08-21 18:10:12'),
(2911, 23, 31.6420955, 74.8768504, 0.35918301343918, 0.0000, '2026-08-21 11:10:22', '2026-08-21 18:10:24', '2026-08-21 18:10:24'),
(2912, 23, 31.6421000, 74.8768480, 0.049378786236048, 0.0000, '2026-08-21 11:10:30', '2026-08-21 18:10:32', '2026-08-21 18:10:32'),
(2913, 23, 31.6419824, 74.8768127, 1.4340966939926, 0.0000, '2026-08-21 11:10:42', '2026-08-21 18:10:44', '2026-08-21 18:10:44'),
(2914, 23, 31.6419679, 74.8768156, 0.38716080784798, 0.0000, '2026-08-21 11:10:50', '2026-08-21 18:10:52', '2026-08-21 18:10:52'),
(2915, 23, 31.6419004, 74.8765263, 2.1561958789825, 0.0000, '2026-08-21 11:11:03', '2026-08-21 18:11:04', '2026-08-21 18:11:04'),
(2916, 23, 31.6418830, 74.8764379, 0.9541842341423, 0.0000, '2026-08-21 11:11:11', '2026-08-21 18:11:12', '2026-08-21 18:11:12'),
(2917, 23, 31.6419051, 74.8764167, 0.42526826262474, 0.0000, '2026-08-21 11:11:22', '2026-08-21 18:11:24', '2026-08-21 18:11:24'),
(2918, 23, 31.6419089, 74.8764160, 0.066998049616814, 0.0000, '2026-08-21 11:11:31', '2026-08-21 18:11:33', '2026-08-21 18:11:33'),
(2919, 23, 31.6419328, 74.8762664, 0.9941286444664, 0.0000, '2026-08-21 11:11:42', '2026-08-21 18:11:44', '2026-08-21 18:11:44'),
(2920, 23, 31.6418770, 74.8764355, 0, 0.0000, '2026-08-21 11:12:21', '2026-08-21 18:12:23', '2026-08-21 18:12:23'),
(2921, 23, 31.6418689, 74.8764322, 0.057260613888502, 0.0000, '2026-08-21 11:12:32', '2026-08-21 18:12:33', '2026-08-21 18:12:33'),
(2922, 23, 31.6419534, 74.8769632, 0, 0.0000, '2026-08-21 11:13:26', '2026-08-21 18:13:28', '2026-08-21 18:13:28'),
(2923, 23, 31.6419562, 74.8769583, 0.047153007239103, 0.0000, '2026-08-21 11:13:36', '2026-08-21 18:13:38', '2026-08-21 18:13:38'),
(2924, 23, 31.6420761, 74.8768543, 1.5968263149261, 0.0000, '2026-08-21 11:13:48', '2026-08-21 18:13:49', '2026-08-21 18:13:49'),
(2925, 23, 31.6421039, 74.8768348, 0.65875750780106, 0.0000, '2026-08-21 11:13:56', '2026-08-21 18:13:58', '2026-08-21 18:13:58'),
(2926, 23, 31.6421105, 74.8768727, 0.22245742380619, 0.0000, '2026-08-21 11:14:11', '2026-08-21 18:14:13', '2026-08-21 18:14:13'),
(2927, 23, 31.6421162, 74.8768663, 0.10378797352314, 0.0000, '2026-08-21 11:14:21', '2026-08-21 18:14:23', '2026-08-21 18:14:23'),
(2928, 23, 31.6420766, 74.8769179, 0.32710865139961, 0.0000, '2026-08-21 11:14:31', '2026-08-21 18:14:33', '2026-08-21 18:14:33'),
(2929, 23, 31.6420764, 74.8769099, 0.071853309869766, 0.0000, '2026-08-21 11:14:41', '2026-08-21 18:14:43', '2026-08-21 18:14:43'),
(2930, 23, 31.6420667, 74.8769125, 0.10865766555071, 0.0000, '2026-08-21 11:14:51', '2026-08-21 18:14:53', '2026-08-21 18:14:53'),
(2931, 24, 31.6420525, 74.8769000, 0, 0.0000, '2026-08-21 11:27:43', '2026-08-21 18:27:43', '2026-08-21 18:27:43'),
(2932, 24, 31.6420325, 74.8769054, 0.16314381361008, 0.0000, '2026-08-21 11:27:57', '2026-08-21 18:27:58', '2026-08-21 18:27:58'),
(2933, 24, 31.6420338, 74.8769060, 0.030240226536989, 0.0000, '2026-08-21 11:28:07', '2026-08-21 18:28:08', '2026-08-21 18:28:08'),
(2934, 24, 31.6420548, 74.8768859, 0.16632385551929, 0.0000, '2026-08-21 11:28:16', '2026-08-21 18:28:17', '2026-08-21 18:28:17'),
(2935, 24, 31.6420572, 74.8766881, 1.7477861642838, 0.0201, '2026-08-21 11:28:27', '2026-08-21 18:28:28', '2026-08-21 18:28:28'),
(2936, 24, 31.6420136, 74.8766259, 0.92183911800385, 0.0263, '2026-08-21 11:28:37', '2026-08-21 18:28:38', '2026-08-21 18:28:38'),
(2937, 24, 31.6420081, 74.8766239, 0.18549501895905, 0.0266, '2026-08-21 11:28:45', '2026-08-21 18:28:46', '2026-08-21 18:28:46'),
(2938, 24, 31.6420676, 74.8765572, 0.70745664834976, 0.0325, '2026-08-21 11:28:57', '2026-08-21 18:28:59', '2026-08-21 18:28:59'),
(2939, 24, 31.6420744, 74.8765468, 0.18044389784336, 0.0335, '2026-08-21 11:29:05', '2026-08-21 18:29:06', '2026-08-21 18:29:06'),
(2940, 24, 31.6423094, 74.8764956, 2.2373163700104, 0.0478, '2026-08-21 11:29:17', '2026-08-21 18:29:18', '2026-08-21 18:29:18'),
(2941, 24, 31.6423158, 74.8764870, 0.22848635911942, 0.0488, '2026-08-21 11:29:24', '2026-08-21 18:29:26', '2026-08-21 18:29:26'),
(2942, 24, 31.6423611, 74.8761145, 1.7144997119904, 0.0819, '2026-08-21 11:29:37', '2026-08-21 18:29:38', '2026-08-21 18:29:38'),
(2943, 24, 31.6423862, 74.8760426, 1.5093351602554, 0.0892, '2026-08-21 11:29:44', '2026-08-21 18:29:46', '2026-08-21 18:29:46'),
(2944, 24, 31.6426025, 74.8759878, 1.3799999952316, 0.1058, '2026-08-21 11:30:14', '2026-08-21 18:30:15', '2026-08-21 18:30:15'),
(2945, 24, 31.6424752, 74.8758475, 0.71433335542679, 0.1102, '2026-08-21 11:29:57', '2026-08-21 18:30:16', '2026-08-21 18:30:16'),
(2946, 24, 31.6426224, 74.8760030, 1.1733996868134, 0.1060, '2026-08-21 11:30:22', '2026-08-21 18:30:24', '2026-08-21 18:30:24'),
(2947, 24, 31.6425413, 74.8762599, 0.98650443553925, 0.0814, '2026-08-21 11:30:35', '2026-08-21 18:30:36', '2026-08-21 18:30:36'),
(2948, 24, 31.6425234, 74.8762863, 0.86474364995956, 0.0782, '2026-08-21 11:30:42', '2026-08-21 18:30:44', '2026-08-21 18:30:44'),
(2949, 24, 31.6423015, 74.8764728, 2.1062252521515, 0.0490, '2026-08-21 11:30:54', '2026-08-21 18:30:56', '2026-08-21 18:30:56'),
(2950, 24, 31.6422797, 74.8764976, 0.43249559402466, 0.0457, '2026-08-21 11:31:02', '2026-08-21 18:31:04', '2026-08-21 18:31:04'),
(2951, 24, 31.6419374, 74.8765490, 0.52154421806335, 0.0356, '2026-08-21 11:31:14', '2026-08-21 18:31:15', '2026-08-21 18:31:15'),
(2952, 24, 31.6419078, 74.8765518, 0.49320152401924, 0.0367, '2026-08-21 11:31:22', '2026-08-21 18:31:24', '2026-08-21 18:31:24'),
(2953, 24, 31.6419074, 74.8765529, 0.075580395758152, 0.0366, '2026-08-21 11:31:34', '2026-08-21 18:31:36', '2026-08-21 18:31:36'),
(2954, 24, 31.6420485, 74.8767282, 1.6353137493134, 0.0163, '2026-08-21 11:31:42', '2026-08-21 18:31:44', '2026-08-21 18:31:44'),
(2955, 24, 31.6420929, 74.8768641, 1.4728276729584, 0.0056, '2026-08-21 11:31:54', '2026-08-21 18:31:56', '2026-08-21 18:31:56'),
(2956, 24, 31.6421066, 74.8768782, 0.34233602881432, 0.0064, '2026-08-21 11:32:02', '2026-08-21 18:32:04', '2026-08-21 18:32:04'),
(2957, 24, 31.6420292, 74.8769008, 0.68256783485413, 0.0000, '2026-08-21 11:32:14', '2026-08-21 18:32:16', '2026-08-21 18:32:16'),
(2958, 24, 31.6420221, 74.8769026, 0.13541363179684, 0.0034, '2026-08-21 11:32:24', '2026-08-21 18:32:26', '2026-08-21 18:32:26'),
(2959, 24, 31.6420764, 74.8768894, 0.48711863160133, 0.0000, '2026-08-21 11:32:35', '2026-08-21 18:32:36', '2026-08-21 18:32:36'),
(2960, 24, 31.6420766, 74.8768939, 0.6008825302124, 0.0000, '2026-08-21 11:32:43', '2026-08-21 18:32:45', '2026-08-21 18:32:45'),
(2961, 24, 31.6420930, 74.8768998, 0.58860838413239, 0.0045, '2026-08-21 11:32:53', '2026-08-21 18:32:55', '2026-08-21 18:32:55'),
(2962, 25, 31.6290112, 74.8845463, 0, 0.0000, '2026-08-21 12:04:24', '2026-08-21 19:04:24', '2026-08-21 19:04:24'),
(2963, 25, 31.6285826, 74.8842810, 0, 0.0539, '2026-08-21 12:04:35', '2026-08-21 19:04:37', '2026-08-21 19:04:37'),
(2964, 25, 31.6279933, 74.8836680, 6.7300000190735, 0.1404, '2026-08-21 12:04:45', '2026-08-21 19:04:48', '2026-08-21 19:04:48'),
(2965, 25, 31.6282937, 74.8823272, 0, 0.0000, '2026-08-21 12:04:55', '2026-08-21 19:04:57', '2026-08-21 19:04:57'),
(2966, 25, 31.6269735, 74.8836332, 9.3599996566772, 0.2425, '2026-08-21 12:05:05', '2026-08-21 19:05:08', '2026-08-21 19:05:08'),
(2967, 25, 31.6262250, 74.8841537, 8.8100004196167, 0.3120, '2026-08-21 12:05:16', '2026-08-21 19:05:18', '2026-08-21 19:05:18'),
(2968, 25, 31.6256295, 74.8846274, 7.7699999809265, 0.3761, '2026-08-21 12:05:25', '2026-08-21 19:05:28', '2026-08-21 19:05:28'),
(2969, 25, 31.6248617, 74.8850334, 4.3400001525879, 0.4637, '2026-08-21 12:05:38', '2026-08-21 19:05:40', '2026-08-21 19:05:40'),
(2970, 25, 31.6246148, 74.8851867, 3.2699999809265, 0.4926, '2026-08-21 12:05:45', '2026-08-21 19:05:48', '2026-08-21 19:05:48'),
(2971, 25, 31.6240580, 74.8852756, 9.2799997329712, 0.5551, '2026-08-21 12:05:55', '2026-08-21 19:05:58', '2026-08-21 19:05:58'),
(2972, 25, 31.6232230, 74.8855027, 9.3500003814697, 0.6500, '2026-08-21 12:06:05', '2026-08-21 19:06:08', '2026-08-21 19:06:08'),
(2973, 25, 31.6223186, 74.8857140, 10.869999885559, 0.7524, '2026-08-21 12:06:15', '2026-08-21 19:06:18', '2026-08-21 19:06:18'),
(2974, 25, 31.6213558, 74.8859000, 10.430000305176, 0.8608, '2026-08-21 12:06:25', '2026-08-21 19:06:28', '2026-08-21 19:06:28'),
(2975, 25, 31.6204857, 74.8857292, 9.3599996566772, 0.9546, '2026-08-21 12:06:35', '2026-08-21 19:06:38', '2026-08-21 19:06:38'),
(2976, 25, 31.6196599, 74.8852778, 9.3800001144409, 1.0421, '2026-08-21 12:06:46', '2026-08-21 19:06:48', '2026-08-21 19:06:48'),
(2977, 25, 31.6188796, 74.8848803, 8.0799999237061, 1.1270, '2026-08-21 12:06:56', '2026-08-21 19:06:58', '2026-08-21 19:06:58'),
(2978, 25, 31.6185039, 74.8845758, 2.7400000095367, 1.1684, '2026-08-21 12:07:05', '2026-08-21 19:07:08', '2026-08-21 19:07:08'),
(2979, 25, 31.6184354, 74.8845719, 0, 1.1760, '2026-08-21 12:07:16', '2026-08-21 19:07:18', '2026-08-21 19:07:18'),
(2980, 25, 31.6184195, 74.8846398, 0, 1.1778, '2026-08-21 12:07:26', '2026-08-21 19:07:28', '2026-08-21 19:07:28'),
(2981, 25, 31.6184260, 74.8846072, 0, 1.1770, '2026-08-21 12:07:37', '2026-08-21 19:07:39', '2026-08-21 19:07:39'),
(2982, 25, 31.6184251, 74.8845947, 0, 1.1771, '2026-08-21 12:07:45', '2026-08-21 19:07:48', '2026-08-21 19:07:48'),
(2983, 25, 31.6184079, 74.8845510, 3.2599999904633, 1.1790, '2026-08-21 12:07:57', '2026-08-21 19:07:59', '2026-08-21 19:07:59'),
(2984, 25, 31.6179318, 74.8841811, 7.1799998283386, 1.2325, '2026-08-21 12:08:06', '2026-08-21 19:08:08', '2026-08-21 19:08:08'),
(2985, 25, 31.6173979, 74.8837753, 9.1499996185303, 1.2934, '2026-08-21 12:08:15', '2026-08-21 19:08:18', '2026-08-21 19:08:18'),
(2986, 25, 31.6165103, 74.8831554, 9.6800003051758, 1.3963, '2026-08-21 12:08:28', '2026-08-21 19:08:30', '2026-08-21 19:08:30'),
(2987, 25, 31.6158588, 74.8828805, 5.8899998664856, 1.4710, '2026-08-21 12:08:36', '2026-08-21 19:08:38', '2026-08-21 19:08:38'),
(2988, 25, 31.6149560, 74.8824988, 0, 1.5748, '2026-08-21 12:08:47', '2026-08-21 19:08:50', '2026-08-21 19:08:50'),
(2989, 25, 31.6149364, 74.8825221, 0, 1.5767, '2026-08-21 12:08:55', '2026-08-21 19:08:57', '2026-08-21 19:08:57'),
(2990, 25, 31.6136747, 74.8819085, 0, 1.7235, '2026-08-21 12:09:07', '2026-08-21 19:09:10', '2026-08-21 19:09:10'),
(2991, 25, 31.6132994, 74.8816471, 0, 1.7685, '2026-08-21 12:09:18', '2026-08-21 19:09:20', '2026-08-21 19:09:20'),
(2992, 25, 31.6129542, 74.8813936, 5.0300002098083, 1.8102, '2026-08-21 12:09:40', '2026-08-21 19:09:42', '2026-08-21 19:09:42'),
(2993, 25, 31.6126939, 74.8807482, 7.2800002098083, 1.8497, '2026-08-21 12:09:50', '2026-08-21 19:09:52', '2026-08-21 19:09:52'),
(2994, 25, 31.6124569, 74.8802051, 5.8299999237061, 1.8861, '2026-08-21 12:09:58', '2026-08-21 19:10:00', '2026-08-21 19:10:00'),
(2995, 25, 31.6149751, 74.8824048, 0, 0.0000, '2026-08-21 12:10:09', '2026-08-21 19:10:12', '2026-08-21 19:10:12'),
(2996, 25, 31.6139642, 74.8612144, 0, 2.7713, '2026-08-21 12:13:49', '2026-08-21 19:13:52', '2026-08-21 19:13:52'),
(2997, 25, 31.6159040, 74.8620348, 0, 2.5821, '2026-08-21 12:14:19', '2026-08-21 19:14:22', '2026-08-21 19:14:22'),
(2998, 25, 31.6171511, 74.8624976, 3.4300000667572, 2.4693, '2026-08-21 12:14:41', '2026-08-21 19:14:43', '2026-08-21 19:14:43'),
(2999, 25, 31.6196446, 74.8647605, 4.9400000572205, 2.1434, '2026-08-21 12:15:44', '2026-08-21 19:15:46', '2026-08-21 19:15:46'),
(3000, 25, 31.6199930, 74.8650493, 3.5599999427795, 2.1008, '2026-08-21 12:15:54', '2026-08-21 19:15:56', '2026-08-21 19:15:56'),
(3001, 25, 31.6199930, 74.8650493, 0, 0.0000, '2026-08-21 12:16:01', '2026-08-21 19:16:04', '2026-08-21 19:16:04'),
(3002, 25, 31.6203404, 74.8653885, 4.9099998474121, 2.0542, '2026-08-21 12:16:13', '2026-08-21 19:16:15', '2026-08-21 19:16:15'),
(3003, 25, 31.6207165, 74.8657271, 4.1199998855591, 2.0064, '2026-08-21 12:16:24', '2026-08-21 19:16:26', '2026-08-21 19:16:26'),
(3004, 25, 31.6210346, 74.8659950, 3.9300000667572, 1.9677, '2026-08-21 12:16:34', '2026-08-21 19:16:36', '2026-08-21 19:16:36'),
(3005, 25, 31.6214226, 74.8663011, 6.5799999237061, 1.9226, '2026-08-21 12:16:44', '2026-08-21 19:16:46', '2026-08-21 19:16:46'),
(3006, 25, 31.6224356, 74.8672229, 6.6100001335144, 1.7958, '2026-08-21 12:17:04', '2026-08-21 19:17:06', '2026-08-21 19:17:06'),
(3007, 25, 31.6262001, 74.8698442, 6.9299998283386, 1.4267, '2026-08-21 12:18:26', '2026-08-21 19:18:28', '2026-08-21 19:18:28'),
(3008, 25, 31.6267834, 74.8700179, 7.5500001907349, 1.3977, '2026-08-21 12:18:36', '2026-08-21 19:18:38', '2026-08-21 19:18:38'),
(3009, 25, 31.6274223, 74.8702206, 7.460000038147, 1.3678, '2026-08-21 12:18:46', '2026-08-21 19:18:48', '2026-08-21 19:18:48'),
(3010, 25, 31.6278734, 74.8704636, 3.1400001049042, 1.3393, '2026-08-21 12:18:54', '2026-08-21 19:18:57', '2026-08-21 19:18:57'),
(3011, 25, 31.6310785, 74.8742197, 0, 0.0000, '2026-08-21 12:20:06', '2026-08-21 19:20:08', '2026-08-21 19:20:08'),
(3012, 25, 31.6314390, 74.8738895, 0, 1.0444, '2026-08-21 12:20:14', '2026-08-21 19:20:16', '2026-08-21 19:20:16'),
(3013, 25, 31.6309743, 74.8742037, 0, 1.0032, '2026-08-21 12:20:26', '2026-08-21 19:20:28', '2026-08-21 19:20:28'),
(3014, 25, 31.6309687, 74.8742111, 0, 1.0024, '2026-08-21 12:20:34', '2026-08-21 19:20:36', '2026-08-21 19:20:36'),
(3015, 25, 31.6309225, 74.8742089, 0, 1.0015, '2026-08-21 12:20:46', '2026-08-21 19:20:49', '2026-08-21 19:20:49'),
(3016, 25, 31.6308944, 74.8741934, 0, 1.0023, '2026-08-21 12:20:56', '2026-08-21 19:20:59', '2026-08-21 19:20:59'),
(3017, 25, 31.6305985, 74.8733622, 0, 1.0735, '2026-08-21 12:21:04', '2026-08-21 19:21:07', '2026-08-21 19:21:07'),
(3018, 25, 31.6307222, 74.8735951, 0, 1.0541, '2026-08-21 12:21:16', '2026-08-21 19:21:19', '2026-08-21 19:21:19'),
(3019, 25, 31.6307364, 74.8736219, 0, 1.0519, '2026-08-21 12:21:24', '2026-08-21 19:21:26', '2026-08-21 19:21:26'),
(3020, 25, 31.6306593, 74.8733804, 0, 1.0729, '2026-08-21 12:21:50', '2026-08-21 19:21:52', '2026-08-21 19:21:52'),
(3021, 25, 31.6306573, 74.8733785, 0, 1.0731, '2026-08-21 12:22:00', '2026-08-21 19:22:02', '2026-08-21 19:22:02'),
(3022, 25, 31.6306635, 74.8733668, 0, 1.0743, '2026-08-21 12:22:10', '2026-08-21 19:22:12', '2026-08-21 19:22:12'),
(3023, 25, 31.6306712, 74.8733612, 0, 1.0749, '2026-08-21 12:22:18', '2026-08-21 19:22:21', '2026-08-21 19:22:21'),
(3024, 25, 31.6306764, 74.8733595, 0, 1.0752, '2026-08-21 12:22:45', '2026-08-21 19:22:47', '2026-08-21 19:22:47'),
(3025, 25, 31.6306709, 74.8733590, 0, 1.0751, '2026-08-21 12:22:56', '2026-08-21 19:22:58', '2026-08-21 19:22:58'),
(3026, 25, 31.6306647, 74.8733555, 0, 1.0754, '2026-08-21 12:23:04', '2026-08-21 19:23:07', '2026-08-21 19:23:07'),
(3027, 25, 31.6306358, 74.8734212, 0, 1.0687, '2026-08-21 12:23:16', '2026-08-21 19:23:18', '2026-08-21 19:23:18'),
(3028, 25, 31.6306551, 74.8733511, 0, 1.0756, '2026-08-21 12:23:26', '2026-08-21 19:23:34', '2026-08-21 19:23:34'),
(3029, 25, 31.6306565, 74.8733511, 0, 1.0756, '2026-08-21 12:23:37', '2026-08-21 19:23:38', '2026-08-21 19:23:38'),
(3030, 25, 31.6306584, 74.8733497, 0, 1.0758, '2026-08-21 12:23:45', '2026-08-21 19:23:47', '2026-08-21 19:23:47'),
(3031, 25, 31.6306554, 74.8733523, 0, 1.0755, '2026-08-21 12:23:55', '2026-08-21 19:23:57', '2026-08-21 19:23:57'),
(3032, 25, 31.6306530, 74.8733533, 0, 1.0753, '2026-08-21 12:24:05', '2026-08-21 19:24:07', '2026-08-21 19:24:07'),
(3033, 25, 31.6306905, 74.8735703, 0, 1.0558, '2026-08-21 12:24:16', '2026-08-21 19:24:18', '2026-08-21 19:24:18'),
(3034, 25, 31.6306150, 74.8733860, 0, 1.0716, '2026-08-21 12:24:26', '2026-08-21 19:24:29', '2026-08-21 19:24:29'),
(3035, 25, 31.6310576, 74.8820791, 0, 0.3261, '2026-08-21 12:28:30', '2026-08-21 19:28:32', '2026-08-21 19:28:32'),
(3036, 25, 31.6301986, 74.8834221, 0, 0.1696, '2026-08-21 12:29:55', '2026-08-21 19:29:58', '2026-08-21 19:29:58'),
(3037, 25, 31.6301063, 74.8834743, 0, 0.1585, '2026-08-21 12:30:03', '2026-08-21 19:30:05', '2026-08-21 19:30:05'),
(3038, 25, 31.6301393, 74.8834439, 0, 0.1632, '2026-08-21 12:30:15', '2026-08-21 19:30:17', '2026-08-21 19:30:17'),
(3039, 25, 31.6301383, 74.8834448, 0, 0.1630, '2026-08-21 12:30:25', '2026-08-21 19:30:27', '2026-08-21 19:30:27'),
(3040, 25, 31.6301396, 74.8834440, 0, 0.1632, '2026-08-21 12:30:35', '2026-08-21 19:30:38', '2026-08-21 19:30:38'),
(3041, 25, 31.6302219, 74.8834013, 0, 0.1728, '2026-08-21 12:30:46', '2026-08-21 19:30:49', '2026-08-21 19:30:49'),
(3042, 25, 31.6302137, 74.8834084, 0, 0.1717, '2026-08-21 12:31:29', '2026-08-21 19:31:31', '2026-08-21 19:31:31'),
(3043, 25, 31.6301075, 74.8834676, 0, 0.1590, '2026-08-21 12:31:48', '2026-08-21 19:31:51', '2026-08-21 19:31:51'),
(3044, 25, 31.6299797, 74.8836971, 0, 0.1344, '2026-08-21 12:31:36', '2026-08-21 19:31:52', '2026-08-21 19:31:52'),
(3045, 25, 31.6299797, 74.8836971, 0, 0.0000, '2026-08-21 12:31:56', '2026-08-21 19:31:59', '2026-08-21 19:31:59'),
(3046, 25, 31.6302058, 74.8834275, 0, 0.1699, '2026-08-21 12:32:08', '2026-08-21 19:32:11', '2026-08-21 19:32:11'),
(3047, 25, 31.6301643, 74.8834288, 0, 0.1662, '2026-08-21 12:33:18', '2026-08-21 19:33:21', '2026-08-21 19:33:21'),
(3048, 25, 31.6299847, 74.8836979, 0, 0.0000, '2026-08-21 12:32:16', '2026-08-21 19:33:22', '2026-08-21 19:33:22'),
(3049, 25, 31.6302011, 74.8834205, 0, 0.0356, '2026-08-21 12:32:38', '2026-08-21 19:33:22', '2026-08-21 19:33:22'),
(3050, 25, 31.6299864, 74.8836909, 0, 0.0350, '2026-08-21 12:32:56', '2026-08-21 19:33:22', '2026-08-21 19:33:22'),
(3051, 25, 31.6301670, 74.8834282, 0, 0.1665, '2026-08-21 12:33:29', '2026-08-21 19:33:31', '2026-08-21 19:33:31'),
(3052, 25, 31.6301231, 74.8834607, 0, 0.1608, '2026-08-21 12:33:39', '2026-08-21 19:33:41', '2026-08-21 19:33:41'),
(3053, 25, 31.6301986, 74.8834221, 0, 0.1696, '2026-08-21 12:34:31', '2026-08-21 19:34:33', '2026-08-21 19:34:33'),
(3054, 25, 31.6302185, 74.8834001, 0, 0.1726, '2026-08-21 12:33:49', '2026-08-21 19:34:34', '2026-08-21 19:34:34'),
(3055, 25, 31.6301824, 74.8834238, 0, 0.1681, '2026-08-21 12:34:41', '2026-08-21 19:34:44', '2026-08-21 19:34:44'),
(3056, 25, 31.6301217, 74.8834644, 0, 0.1604, '2026-08-21 12:34:51', '2026-08-21 19:34:54', '2026-08-21 19:34:54'),
(3057, 26, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 19:34:41', '2026-08-22 02:34:41', '2026-08-22 02:34:41'),
(3058, 26, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 19:34:51', '2026-08-22 02:34:53', '2026-08-22 02:34:53'),
(3059, 26, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 19:35:01', '2026-08-22 02:35:03', '2026-08-22 02:35:03'),
(3060, 26, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 19:35:11', '2026-08-22 02:35:13', '2026-08-22 02:35:13'),
(3061, 27, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:08:01', '2026-08-22 04:08:01', '2026-08-22 04:08:01'),
(3062, 28, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:08:59', '2026-08-22 04:08:59', '2026-08-22 04:08:59'),
(3063, 28, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:09:11', '2026-08-22 04:09:12', '2026-08-22 04:09:12'),
(3064, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:04', '2026-08-22 04:17:04', '2026-08-22 04:17:04'),
(3065, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:15', '2026-08-22 04:17:16', '2026-08-22 04:17:16'),
(3066, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:25', '2026-08-22 04:17:26', '2026-08-22 04:17:26'),
(3067, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:35', '2026-08-22 04:17:36', '2026-08-22 04:17:36'),
(3068, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:45', '2026-08-22 04:17:46', '2026-08-22 04:17:46'),
(3069, 29, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:17:55', '2026-08-22 04:17:57', '2026-08-22 04:17:57'),
(3070, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:20:24', '2026-08-22 04:20:24', '2026-08-22 04:20:24'),
(3071, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:20:36', '2026-08-22 04:20:37', '2026-08-22 04:20:37'),
(3072, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:20:46', '2026-08-22 04:20:47', '2026-08-22 04:20:47'),
(3073, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:20:56', '2026-08-22 04:20:57', '2026-08-22 04:20:57'),
(3074, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:21:21', '2026-08-22 04:21:23', '2026-08-22 04:21:23'),
(3075, 30, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:21:31', '2026-08-22 04:21:33', '2026-08-22 04:21:33'),
(3076, 31, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:29:29', '2026-08-22 04:29:29', '2026-08-22 04:29:29'),
(3077, 31, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:29:41', '2026-08-22 04:29:42', '2026-08-22 04:29:42'),
(3078, 31, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 21:30:05', '2026-08-22 04:30:06', '2026-08-22 04:30:06'),
(3079, 32, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 23:08:37', '2026-08-22 06:08:37', '2026-08-22 06:08:37'),
(3080, 32, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-21 23:09:03', '2026-08-22 06:09:04', '2026-08-22 06:09:04'),
(3081, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:49:33', '2026-08-22 07:49:33', '2026-08-22 07:49:33'),
(3082, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:49:44', '2026-08-22 07:49:45', '2026-08-22 07:49:45'),
(3083, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:49:54', '2026-08-22 07:49:55', '2026-08-22 07:49:55'),
(3084, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:50:04', '2026-08-22 07:50:05', '2026-08-22 07:50:05'),
(3085, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:50:14', '2026-08-22 07:50:15', '2026-08-22 07:50:15'),
(3086, 33, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 00:50:24', '2026-08-22 07:50:25', '2026-08-22 07:50:25'),
(3087, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:02', '2026-08-22 08:11:02', '2026-08-22 08:11:02'),
(3088, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:14', '2026-08-22 08:11:15', '2026-08-22 08:11:15'),
(3089, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:24', '2026-08-22 08:11:25', '2026-08-22 08:11:25'),
(3090, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:34', '2026-08-22 08:11:36', '2026-08-22 08:11:36'),
(3091, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:44', '2026-08-22 08:11:46', '2026-08-22 08:11:46'),
(3092, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:11:54', '2026-08-22 08:11:55', '2026-08-22 08:11:55'),
(3093, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:12:04', '2026-08-22 08:12:05', '2026-08-22 08:12:05'),
(3094, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:12:14', '2026-08-22 08:12:15', '2026-08-22 08:12:15'),
(3095, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:12:24', '2026-08-22 08:12:25', '2026-08-22 08:12:25'),
(3096, 34, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:12:34', '2026-08-22 08:12:35', '2026-08-22 08:12:35'),
(3097, 35, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 01:23:57', '2026-08-22 08:23:57', '2026-08-22 08:23:57'),
(3098, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:03:34', '2026-08-22 09:03:34', '2026-08-22 09:03:34'),
(3099, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:03:46', '2026-08-22 09:03:47', '2026-08-22 09:03:47'),
(3100, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:03:56', '2026-08-22 09:03:57', '2026-08-22 09:03:57'),
(3101, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:04:06', '2026-08-22 09:04:07', '2026-08-22 09:04:07'),
(3102, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:04:16', '2026-08-22 09:04:17', '2026-08-22 09:04:17'),
(3103, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:04:26', '2026-08-22 09:04:28', '2026-08-22 09:04:28'),
(3104, 36, 37.7858340, -122.4064170, 0, 0.0000, '2026-08-22 02:04:36', '2026-08-22 09:04:37', '2026-08-22 09:04:37'),
(3105, 37, 31.6420388, 74.8768412, 0, 0.0000, '2026-08-24 14:15:59', '2026-08-24 21:15:59', '2026-08-24 21:15:59'),
(3106, 37, 31.6420809, 74.8768837, 0, 0.0000, '2026-08-24 14:16:16', '2026-08-24 21:16:18', '2026-08-24 21:16:18'),
(3107, 37, 31.6420960, 74.8768718, 0.15911374986172, 0.0000, '2026-08-24 14:16:26', '2026-08-24 21:16:28', '2026-08-24 21:16:28'),
(3108, 37, 31.6420868, 74.8768860, 0.35783365368843, 0.0000, '2026-08-24 14:16:36', '2026-08-24 21:16:39', '2026-08-24 21:16:39'),
(3109, 37, 31.6420999, 74.8768838, 0.36154735088348, 0.0000, '2026-08-24 14:16:46', '2026-08-24 21:16:48', '2026-08-24 21:16:48'),
(3110, 37, 31.6420991, 74.8768842, 0.21707834303379, 0.0000, '2026-08-24 14:16:56', '2026-08-24 21:16:58', '2026-08-24 21:16:58'),
(3111, 37, 31.6420986, 74.8768836, 0.15340894460678, 0.0000, '2026-08-24 14:17:06', '2026-08-24 21:17:08', '2026-08-24 21:17:08'),
(3112, 37, 31.6420880, 74.8768758, 0, 0.0000, '2026-08-24 14:17:43', '2026-08-24 21:17:45', '2026-08-24 21:17:45'),
(3113, 37, 31.6420881, 74.8768780, 0.016254372894764, 0.0000, '2026-08-24 14:17:52', '2026-08-24 21:17:54', '2026-08-24 21:17:54'),
(3114, 37, 31.6420841, 74.8768840, 0.075068742036819, 0.0000, '2026-08-24 14:18:04', '2026-08-24 21:18:07', '2026-08-24 21:18:07'),
(3115, 37, 31.6420853, 74.8768812, 0.04672347381711, 0.0000, '2026-08-24 14:18:27', '2026-08-24 21:18:30', '2026-08-24 21:18:30'),
(3116, 37, 31.6420976, 74.8768849, 0.14137353003025, 0.0000, '2026-08-24 14:18:37', '2026-08-24 21:18:40', '2026-08-24 21:18:40'),
(3117, 37, 31.6420967, 74.8768773, 0.097502313554287, 0.0000, '2026-08-24 14:18:44', '2026-08-24 21:18:47', '2026-08-24 21:18:47'),
(3118, 37, 31.6420928, 74.8768757, 0.035106346011162, 0.0000, '2026-08-24 14:18:57', '2026-08-24 21:19:00', '2026-08-24 21:19:00'),
(3119, 37, 31.6420962, 74.8768752, 0.036737095564604, 0.0000, '2026-08-24 14:19:07', '2026-08-24 21:19:10', '2026-08-24 21:19:10'),
(3120, 38, 31.6420691, 74.8768924, 0, 0.0000, '2026-08-24 14:32:37', '2026-08-24 21:32:37', '2026-08-24 21:32:37'),
(3121, 38, 31.6420671, 74.8768922, 0.015816457569599, 0.0000, '2026-08-24 14:32:49', '2026-08-24 21:32:51', '2026-08-24 21:32:51'),
(3122, 38, 31.6420889, 74.8768806, 0.17993029952049, 0.0000, '2026-08-24 14:33:02', '2026-08-24 21:33:05', '2026-08-24 21:33:05'),
(3123, 38, 31.6420924, 74.8768757, 0.061992987990379, 0.0000, '2026-08-24 14:33:12', '2026-08-24 21:33:14', '2026-08-24 21:33:14'),
(3124, 38, 31.6421030, 74.8768749, 0.11508861929178, 0.0000, '2026-08-24 14:33:22', '2026-08-24 21:33:25', '2026-08-24 21:33:25'),
(3125, 38, 31.6421030, 74.8768749, 0.001404074835591, 0.0000, '2026-08-24 14:33:32', '2026-08-24 21:33:34', '2026-08-24 21:33:34'),
(3126, 38, 31.6421030, 74.8768749, 0.000099091579613741, 0.0000, '2026-08-24 14:33:42', '2026-08-24 21:33:45', '2026-08-24 21:33:45'),
(3127, 39, 31.6420819, 74.8766918, 0, 0.0000, '2026-08-24 17:31:34', '2026-08-25 00:31:34', '2026-08-25 00:31:34'),
(3128, 39, 31.6420932, 74.8767035, 0, 0.0000, '2026-08-24 17:31:43', '2026-08-25 00:31:43', '2026-08-25 00:31:43'),
(3129, 40, 31.6420245, 74.8769102, 0, 0.0000, '2026-08-24 18:13:02', '2026-08-25 01:13:02', '2026-08-25 01:13:02'),
(3130, 40, 31.6420245, 74.8769057, 0.071205109357834, 0.0000, '2026-08-24 18:13:18', '2026-08-25 01:13:20', '2026-08-25 01:13:20'),
(3131, 40, 31.6420237, 74.8769060, 0.0097525510936975, 0.0000, '2026-08-24 18:13:26', '2026-08-25 01:13:29', '2026-08-25 01:13:29');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `is_admin` tinyint(1) NOT NULL DEFAULT 0,
  `permissions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`permissions`)),
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `two_factor_secret` text DEFAULT NULL,
  `two_factor_recovery_codes` text DEFAULT NULL,
  `two_factor_confirmed_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `fcm_token` varchar(500) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `is_admin`, `permissions`, `email_verified_at`, `password`, `two_factor_secret`, `two_factor_recovery_codes`, `two_factor_confirmed_at`, `remember_token`, `fcm_token`, `created_at`, `updated_at`) VALUES
(1, 'Admin User', 'admin@gmail.com', 1, NULL, '2026-08-19 11:39:36', '$2y$12$fRYDzJSp3Rwz3K1cc1.5He250TctehfSNY7mu2Tnqppq4zjIgg/y2', NULL, NULL, NULL, NULL, NULL, '2026-08-19 11:39:36', '2026-08-19 11:39:36'),
(2, 'Regular User', 'user@musebusiness.in', 0, NULL, '2026-08-19 11:39:37', '$2y$12$Ms/9A1TBMspSaHoGNUqXvORFZ1N/3OkaRqeN1HzH.23zXacuiw8B2', NULL, NULL, NULL, NULL, NULL, '2026-08-19 11:39:37', '2026-08-19 11:39:37'),
(3, 'Admin User', 'admin@musebusiness.in', 1, NULL, '2026-08-19 11:54:58', '$2y$12$Ht974m4nmPj/6iGCpi.OluhZX0eiJdjsOSCICMIlVid/Bkr7TfONS', NULL, NULL, NULL, NULL, NULL, '2026-08-19 11:54:58', '2026-08-19 11:54:58'),
(5, 'JATIN CHABBRA', 'jatin@gmail.com', 0, NULL, NULL, '$2y$12$KDn4d4O/wpz8O11qa70kq.yBKFswvavvarHn.6TfZDA4InewBmnU2', NULL, NULL, NULL, NULL, NULL, '2026-08-19 15:32:50', '2026-08-22 19:17:24'),
(6, 'Rahul Sharma', 'rahul@gmail.com', 0, NULL, NULL, '$2y$12$GVmefkg5dXaPZJzJ6sqnVuI/Rb2Ulp81uHrsH2rGH65yIX1wqGaae', NULL, NULL, NULL, NULL, NULL, '2026-08-22 19:18:24', '2026-08-22 19:18:24');

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

--
-- Table structure for table `vehicles`
--

CREATE TABLE `vehicles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_category_id` bigint(20) UNSIGNED NOT NULL,
  `assigned_employee_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_number` varchar(255) NOT NULL,
  `primary_function` varchar(255) DEFAULT NULL,
  `core_capacity_specs` text DEFAULT NULL,
  `power_source` varchar(255) DEFAULT NULL,
  `odometer_reading` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vehicles`
--

INSERT INTO `vehicles` (`id`, `vehicle_category_id`, `assigned_employee_id`, `vehicle_number`, `primary_function`, `core_capacity_specs`, `power_source`, `odometer_reading`, `status`, `created_at`, `updated_at`) VALUES
(10, 8, 11, 'PB02BL0581', 'Garbage Lifting Loader', '', 'Diesel', '12000', 'active', '2026-08-20 14:01:11', '2026-08-20 14:01:19'),
(11, 6, NULL, 'PB01-CP-1001', 'CLEANING', '', 'Diesel', '1300', 'active', '2026-08-22 19:16:18', '2026-08-22 19:16:18');

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

--
-- Table structure for table `vehicle_cameras`
--

CREATE TABLE `vehicle_cameras` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `camera_name` varchar(255) NOT NULL,
  `camera_model` varchar(255) NOT NULL DEFAULT 'SecureEye 4G RTMP',
  `serial_number` varchar(255) DEFAULT NULL,
  `channel_number` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `stream_key` varchar(255) NOT NULL,
  `rtmp_ingest_url` varchar(255) DEFAULT NULL,
  `web_player_url` varchar(255) DEFAULT NULL,
  `stream_protocol` varchar(255) NOT NULL DEFAULT 'webrtc',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `status` varchar(255) NOT NULL DEFAULT 'live',
  `notes` text 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 `vehicle_categories`
--

CREATE TABLE `vehicle_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `color_code` varchar(20) NOT NULL DEFAULT '#0D9488',
  `meta_title` varchar(255) DEFAULT NULL,
  `meta_keywords` text DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `meta_schema_tags` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vehicle_categories`
--

INSERT INTO `vehicle_categories` (`id`, `parent_id`, `name`, `slug`, `image`, `color_code`, `meta_title`, `meta_keywords`, `meta_description`, `meta_schema_tags`, `status`, `created_at`, `updated_at`) VALUES
(6, NULL, 'Mechanical sweeper machine', 'mechanical-sweeper-machine', 'categories/TJtiKL7pjtohVLHNuriLkXaY7YDPbO.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 13:56:55', '2026-08-20 13:56:55'),
(7, NULL, 'Litter picker gobbler', 'litter-picker-gobbler', 'categories/Qo2qJpOMx92G2XbGM0BSgJRIv7SqUi.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 13:58:07', '2026-08-20 13:58:07'),
(8, NULL, 'Garbage lifting Loader', 'garbage-lifting-loader', 'categories/hTVSWVbP9rg5GEbt5WXFFvDpZ2FUJi.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 13:59:05', '2026-08-20 13:59:05'),
(9, NULL, 'Jett water washer', 'jett-water-washer', 'categories/BwGlQY0A6fg7lTkmjcUoTCSlwGDHA4.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 13:59:59', '2026-08-20 13:59:59'),
(10, NULL, 'Litter picker', 'litter-picker', 'categories/2ubxYwZfUbUAmPUXBSFGLbFOmgRICC.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 20:46:48', '2026-08-20 20:46:48'),
(11, NULL, 'Electric mini mechanical sweeping machine', 'electric-mini-sweeping-machine', 'categories/E3OmAkjCAYjnDVchSRnOURI6HGFxVI.webp', '#0D9488', '', '', '', '', 'active', '2026-08-20 20:47:16', '2026-08-21 18:53:32'),
(12, NULL, 'Super sucker cum jetting machine', 'super-sucker-cum-jetting-machine', 'categories/nKjZf8zhoJ0HzQjP8MfV8LtAtjlzTy.webp', '#0D9488', '', '', '', '', 'active', '2026-08-21 23:00:40', '2026-08-21 23:00:40');

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

--
-- Table structure for table `vehicle_images`
--

CREATE TABLE `vehicle_images` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `image_path` varchar(255) NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vehicle_images`
--

INSERT INTO `vehicle_images` (`id`, `vehicle_id`, `image_path`, `is_primary`, `created_at`, `updated_at`) VALUES
(2, 10, 'vehicles/2vTZEiUnq0jslQ0jSHo7DVq7aOWmTA.webp', 1, '2026-08-20 14:01:11', '2026-08-20 14:01:11');

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

--
-- Table structure for table `vehicle_tours`
--

CREATE TABLE `vehicle_tours` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `employee_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `driver_duty_id` bigint(20) UNSIGNED DEFAULT NULL,
  `route_id` bigint(20) UNSIGNED DEFAULT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime DEFAULT NULL,
  `total_time_seconds` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `total_distance_km` decimal(8,3) NOT NULL DEFAULT 0.000,
  `calculation_mode` varchar(255) NOT NULL DEFAULT 'gps_coordinates',
  `start_latitude` decimal(10,7) DEFAULT NULL,
  `start_longitude` decimal(10,7) DEFAULT NULL,
  `end_latitude` decimal(10,7) DEFAULT NULL,
  `end_longitude` decimal(10,7) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'in_progress',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vehicle_tours`
--

INSERT INTO `vehicle_tours` (`id`, `user_id`, `employee_id`, `vehicle_id`, `driver_duty_id`, `route_id`, `start_time`, `end_time`, `total_time_seconds`, `total_distance_km`, `calculation_mode`, `start_latitude`, `start_longitude`, `end_latitude`, `end_longitude`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(23, 5, 11, 10, NULL, NULL, '2026-08-21 11:09:27', '2026-08-21 11:14:55', 328, 0.000, 'gps_coordinates', 31.6420572, 74.8768886, 31.6420667, 74.8769125, 'completed', NULL, '2026-08-21 18:09:27', '2026-08-21 18:14:55'),
(24, 5, 11, 10, NULL, NULL, '2026-08-21 11:27:43', '2026-08-21 11:32:55', 312, 1.130, 'gps_coordinates', 31.6420525, 74.8769000, 31.6420930, 74.8768998, 'completed', NULL, '2026-08-21 18:27:43', '2026-08-21 18:32:55'),
(25, 5, 11, 10, NULL, NULL, '2026-08-21 12:04:24', '2026-08-21 12:34:55', 1831, 8.487, 'gps_coordinates', 31.6290112, 74.8845463, 31.6301217, 74.8834644, 'completed', NULL, '2026-08-21 19:04:24', '2026-08-21 19:34:55'),
(26, 5, 11, 10, NULL, NULL, '2026-08-21 19:34:41', '2026-08-21 19:35:20', 39, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', NULL, '2026-08-22 02:34:41', '2026-08-22 02:35:20'),
(27, 5, 11, 10, 1, 1, '2026-08-21 21:08:01', '2026-08-21 21:08:20', 19, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', 'Test', '2026-08-22 04:08:01', '2026-08-22 04:08:20'),
(28, 5, 11, 10, 2, 1, '2026-08-21 21:08:59', '2026-08-21 21:09:15', 16, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 04:08:59', '2026-08-22 04:09:15'),
(29, 5, 11, 10, 3, 1, '2026-08-21 21:17:04', '2026-08-21 21:18:03', 59, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 04:17:04', '2026-08-22 04:18:03'),
(30, 5, 11, 10, NULL, 1, '2026-08-21 21:20:24', '2026-08-21 21:22:02', 98, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 04:20:24', '2026-08-22 04:22:02'),
(31, 5, 11, 10, NULL, 1, '2026-08-21 21:29:29', '2026-08-21 21:30:24', 55, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 04:29:29', '2026-08-22 04:30:24'),
(32, 5, 11, 10, 8, 1, '2026-08-21 23:08:37', '2026-08-21 23:09:11', 34, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 06:08:37', '2026-08-22 06:09:11'),
(33, 5, 11, 10, 9, 1, '2026-08-22 00:49:33', '2026-08-22 00:50:27', 54, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 07:49:33', '2026-08-22 07:50:27'),
(34, 5, 11, 10, 10, 1, '2026-08-22 01:11:02', '2026-08-22 01:12:36', 94, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 08:11:02', '2026-08-22 08:12:36'),
(35, 5, 11, 10, 11, 1, '2026-08-22 01:23:57', '2026-08-22 01:24:16', 19, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 08:23:57', '2026-08-22 08:24:16'),
(36, 5, 11, 10, 12, 1, '2026-08-22 02:03:34', '2026-08-22 02:04:39', 65, 0.000, 'gps_coordinates', 37.7858340, -122.4064170, 37.7858340, -122.4064170, 'completed', '', '2026-08-22 09:03:34', '2026-08-22 09:04:39'),
(37, 5, 11, 10, 13, 1, '2026-08-24 14:15:59', '2026-08-24 14:19:10', 191, 0.000, 'gps_coordinates', 31.6420388, 74.8768412, 31.6420962, 74.8768752, 'completed', '', '2026-08-24 21:15:59', '2026-08-24 21:19:10'),
(38, 5, 11, 10, 14, 1, '2026-08-24 14:32:37', '2026-08-24 14:33:46', 69, 0.000, 'gps_coordinates', 31.6420691, 74.8768924, 31.6421030, 74.8768749, 'completed', '', '2026-08-24 21:32:37', '2026-08-24 21:33:46'),
(39, 5, 11, 10, 16, 1, '2026-08-24 17:31:31', '2026-08-24 17:31:53', 22, 0.000, 'gps_coordinates', 31.6420819, 74.8766918, 31.6420932, 74.8767035, 'completed', '', '2026-08-25 00:31:31', '2026-08-25 00:31:53'),
(40, 5, 11, 10, 17, 1, '2026-08-24 18:13:02', '2026-08-24 18:13:33', 31, 0.000, 'gps_coordinates', 31.6420245, 74.8769102, 31.6420237, 74.8769060, 'completed', '', '2026-08-25 01:13:02', '2026-08-25 01:13:33');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_expiration_index` (`expiration`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_locks_expiration_index` (`expiration`);

--
-- Indexes for table `complaints`
--
ALTER TABLE `complaints`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `complaints_complaint_number_unique` (`complaint_number`),
  ADD KEY `complaints_resolved_by_foreign` (`resolved_by`),
  ADD KEY `complaints_mobile_number_index` (`mobile_number`),
  ADD KEY `complaints_status_index` (`status`);

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

--
-- Indexes for table `driver_applications`
--
ALTER TABLE `driver_applications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `driver_applications_application_code_unique` (`application_code`),
  ADD KEY `driver_applications_reviewed_by_foreign` (`reviewed_by`);

--
-- Indexes for table `driver_duties`
--
ALTER TABLE `driver_duties`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `driver_duties_duty_code_unique` (`duty_code`),
  ADD KEY `driver_duties_route_id_foreign` (`route_id`),
  ADD KEY `driver_duties_employee_id_duty_date_status_index` (`employee_id`,`duty_date`,`status`),
  ADD KEY `driver_duties_vehicle_id_duty_date_status_index` (`vehicle_id`,`duty_date`,`status`),
  ADD KEY `driver_duties_shift_id_foreign` (`shift_id`);

--
-- Indexes for table `duty_driver_vehicle_assignments`
--
ALTER TABLE `duty_driver_vehicle_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `duty_driver_vehicle_assignments_driver_duty_id_foreign` (`driver_duty_id`),
  ADD KEY `duty_driver_vehicle_assignments_employee_id_foreign` (`employee_id`),
  ADD KEY `duty_driver_vehicle_assignments_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `duty_driver_vehicle_assignments_vehicle_tour_id_foreign` (`vehicle_tour_id`);

--
-- Indexes for table `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `employees_employee_code_unique` (`employee_code`),
  ADD KEY `employees_user_id_foreign` (`user_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`),
  ADD KEY `failed_jobs_connection_queue_failed_at_index` (`connection`,`queue`,`failed_at`);

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

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

--
-- Indexes for table `master_items`
--
ALTER TABLE `master_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `master_items_code_unique` (`code`);

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

--
-- Indexes for table `passkeys`
--
ALTER TABLE `passkeys`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `passkeys_credential_id_unique` (`credential_id`),
  ADD KEY `passkeys_user_id_index` (`user_id`);

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`),
  ADD KEY `personal_access_tokens_expires_at_index` (`expires_at`);

--
-- Indexes for table `routes`
--
ALTER TABLE `routes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `routes_code_unique` (`code`);

--
-- Indexes for table `route_lanes`
--
ALTER TABLE `route_lanes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `route_lanes_route_id_foreign` (`route_id`);

--
-- Indexes for table `service_areas`
--
ALTER TABLE `service_areas`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `service_areas_slug_unique` (`slug`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `shifts`
--
ALTER TABLE `shifts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `shifts_code_unique` (`code`);

--
-- Indexes for table `telematics_alerts`
--
ALTER TABLE `telematics_alerts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `telematics_alerts_alert_code_unique` (`alert_code`),
  ADD KEY `telematics_alerts_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `telematics_alerts_employee_id_foreign` (`employee_id`),
  ADD KEY `telematics_alerts_driver_duty_id_foreign` (`driver_duty_id`),
  ADD KEY `telematics_alerts_vehicle_tour_id_foreign` (`vehicle_tour_id`),
  ADD KEY `telematics_alerts_route_id_foreign` (`route_id`),
  ADD KEY `telematics_alerts_resolved_by_foreign` (`resolved_by`);

--
-- Indexes for table `tour_photos`
--
ALTER TABLE `tour_photos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tour_photos_vehicle_tour_id_foreign` (`vehicle_tour_id`),
  ADD KEY `tour_photos_driver_duty_id_foreign` (`driver_duty_id`),
  ADD KEY `tour_photos_user_id_foreign` (`user_id`),
  ADD KEY `tour_photos_employee_id_foreign` (`employee_id`);

--
-- Indexes for table `tour_waypoints`
--
ALTER TABLE `tour_waypoints`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tour_waypoints_vehicle_tour_id_foreign` (`vehicle_tour_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- Indexes for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicles_vehicle_category_id_foreign` (`vehicle_category_id`),
  ADD KEY `vehicles_assigned_employee_id_foreign` (`assigned_employee_id`);

--
-- Indexes for table `vehicle_cameras`
--
ALTER TABLE `vehicle_cameras`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vehicle_cameras_stream_key_unique` (`stream_key`),
  ADD KEY `vehicle_cameras_vehicle_id_foreign` (`vehicle_id`);

--
-- Indexes for table `vehicle_categories`
--
ALTER TABLE `vehicle_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vehicle_categories_slug_unique` (`slug`),
  ADD KEY `vehicle_categories_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `vehicle_images`
--
ALTER TABLE `vehicle_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicle_images_vehicle_id_foreign` (`vehicle_id`);

--
-- Indexes for table `vehicle_tours`
--
ALTER TABLE `vehicle_tours`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicle_tours_user_id_foreign` (`user_id`),
  ADD KEY `vehicle_tours_employee_id_foreign` (`employee_id`),
  ADD KEY `vehicle_tours_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `vehicle_tours_driver_duty_id_foreign` (`driver_duty_id`),
  ADD KEY `vehicle_tours_route_id_foreign` (`route_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- AUTO_INCREMENT for table `contact_inquiries`
--
ALTER TABLE `contact_inquiries`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

--
-- AUTO_INCREMENT for table `driver_duties`
--
ALTER TABLE `driver_duties`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `duty_driver_vehicle_assignments`
--
ALTER TABLE `duty_driver_vehicle_assignments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `employees`
--
ALTER TABLE `employees`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

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

--
-- AUTO_INCREMENT for table `master_items`
--
ALTER TABLE `master_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

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

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

--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `routes`
--
ALTER TABLE `routes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `route_lanes`
--
ALTER TABLE `route_lanes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `service_areas`
--
ALTER TABLE `service_areas`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `shifts`
--
ALTER TABLE `shifts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `telematics_alerts`
--
ALTER TABLE `telematics_alerts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `tour_photos`
--
ALTER TABLE `tour_photos`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `tour_waypoints`
--
ALTER TABLE `tour_waypoints`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3132;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vehicles`
--
ALTER TABLE `vehicles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

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

--
-- AUTO_INCREMENT for table `vehicle_categories`
--
ALTER TABLE `vehicle_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `vehicle_images`
--
ALTER TABLE `vehicle_images`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vehicle_tours`
--
ALTER TABLE `vehicle_tours`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `complaints`
--
ALTER TABLE `complaints`
  ADD CONSTRAINT `complaints_resolved_by_foreign` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `driver_applications`
--
ALTER TABLE `driver_applications`
  ADD CONSTRAINT `driver_applications_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `driver_duties`
--
ALTER TABLE `driver_duties`
  ADD CONSTRAINT `driver_duties_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `driver_duties_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `driver_duties_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `driver_duties_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `duty_driver_vehicle_assignments`
--
ALTER TABLE `duty_driver_vehicle_assignments`
  ADD CONSTRAINT `duty_driver_vehicle_assignments_driver_duty_id_foreign` FOREIGN KEY (`driver_duty_id`) REFERENCES `driver_duties` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `duty_driver_vehicle_assignments_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `duty_driver_vehicle_assignments_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `duty_driver_vehicle_assignments_vehicle_tour_id_foreign` FOREIGN KEY (`vehicle_tour_id`) REFERENCES `vehicle_tours` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `employees`
--
ALTER TABLE `employees`
  ADD CONSTRAINT `employees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `passkeys`
--
ALTER TABLE `passkeys`
  ADD CONSTRAINT `passkeys_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `route_lanes`
--
ALTER TABLE `route_lanes`
  ADD CONSTRAINT `route_lanes_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `telematics_alerts`
--
ALTER TABLE `telematics_alerts`
  ADD CONSTRAINT `telematics_alerts_driver_duty_id_foreign` FOREIGN KEY (`driver_duty_id`) REFERENCES `driver_duties` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `telematics_alerts_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `telematics_alerts_resolved_by_foreign` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `telematics_alerts_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `telematics_alerts_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `telematics_alerts_vehicle_tour_id_foreign` FOREIGN KEY (`vehicle_tour_id`) REFERENCES `vehicle_tours` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `tour_photos`
--
ALTER TABLE `tour_photos`
  ADD CONSTRAINT `tour_photos_driver_duty_id_foreign` FOREIGN KEY (`driver_duty_id`) REFERENCES `driver_duties` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tour_photos_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `tour_photos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `tour_photos_vehicle_tour_id_foreign` FOREIGN KEY (`vehicle_tour_id`) REFERENCES `vehicle_tours` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tour_waypoints`
--
ALTER TABLE `tour_waypoints`
  ADD CONSTRAINT `tour_waypoints_vehicle_tour_id_foreign` FOREIGN KEY (`vehicle_tour_id`) REFERENCES `vehicle_tours` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD CONSTRAINT `vehicles_assigned_employee_id_foreign` FOREIGN KEY (`assigned_employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vehicles_vehicle_category_id_foreign` FOREIGN KEY (`vehicle_category_id`) REFERENCES `vehicle_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicle_cameras`
--
ALTER TABLE `vehicle_cameras`
  ADD CONSTRAINT `vehicle_cameras_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `vehicle_categories`
--
ALTER TABLE `vehicle_categories`
  ADD CONSTRAINT `vehicle_categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `vehicle_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `vehicle_images`
--
ALTER TABLE `vehicle_images`
  ADD CONSTRAINT `vehicle_images_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicle_tours`
--
ALTER TABLE `vehicle_tours`
  ADD CONSTRAINT `vehicle_tours_driver_duty_id_foreign` FOREIGN KEY (`driver_duty_id`) REFERENCES `driver_duties` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vehicle_tours_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vehicle_tours_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vehicle_tours_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vehicle_tours_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
