-- Table structure for table `transport_companies`
--

CREATE TABLE `transport_companies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(50) NOT NULL,
  `registration_number` varchar(100) NOT NULL,
  `license_number` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `director_name` varchar(255) DEFAULT NULL,
  `number_of_vehicles` int(11) NOT NULL DEFAULT 0,
  `established_date` date DEFAULT NULL,
  `insurance_provider` varchar(255) DEFAULT NULL,
  `insurance_policy_number` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `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 `transport_companies`
--

INSERT INTO `transport_companies` (`id`, `company_id`, `name`, `code`, `registration_number`, `license_number`, `phone`, `email`, `address`, `city`, `country`, `director_name`, `number_of_vehicles`, `established_date`, `insurance_provider`, `insurance_policy_number`, `description`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 1, 'شركة النقل السريع', 'TC-001', 'REG-001', 'LIC-001', '920000001', 'info@transport.com', 'الرياض - المملكة العربية السعودية', 'الرياض', 'المملكة العربية السعودية', 'محمد أحمد', 0, '2021-02-21', NULL, NULL, NULL, 1, '2026-02-21 08:27:34', '2026-02-21 08:27:34');

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

--
-- Table structure for table `transport_documents`
--

CREATE TABLE `transport_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `documentable_type` varchar(255) NOT NULL,
  `documentable_id` bigint(20) UNSIGNED NOT NULL,
  `document_type` varchar(100) NOT NULL,
  `document_name` varchar(255) NOT NULL,
  `document_code` varchar(100) NOT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `document_date` date DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `status` enum('active','expired','archived') NOT NULL DEFAULT 'active',
  `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 `treasuries`
--

CREATE TABLE `treasuries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `chart_of_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `location` varchar(255) DEFAULT NULL,
  `responsible_user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `initial_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `current_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `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 `treasuries`
--

INSERT INTO `treasuries` (`id`, `company_id`, `branch_id`, `chart_of_account_id`, `name`, `code`, `location`, `responsible_user_id`, `initial_balance`, `current_balance`, `description`, `is_active`, `created_at`, `updated_at`) VALUES
(7, 1, 1, 23, 'خزينةرئيسية', '1', NULL, 1, 0.00, 80900.00, NULL, 1, '2025-11-19 10:14:51', '2025-11-27 07:27:24'),
(8, 10, 4, 156, 'الخزينة الرئيسية', '1-1', NULL, 6, 0.00, 0.00, NULL, 1, '2025-12-01 08:58:49', '2025-12-01 08:58:49'),
(10, 11, 5, 327, 'خزينة رقم 1', '1', NULL, 9, 0.00, 500.00, NULL, 1, '2025-12-20 16:52:04', '2026-03-03 02:34:46'),
(11, 17, 6, 539, 'الخزينة الرئيسية', '1', NULL, 16, 0.00, 49862.00, NULL, 1, '2026-02-07 19:14:50', '2026-02-07 20:10:00'),
(12, 11, 5, 635, 'خزينة رقم 2', '2', NULL, 9, 0.00, 500.00, NULL, 1, '2026-03-03 02:14:20', '2026-03-03 02:34:46');

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

--
-- Table structure for table `treasury_deposits`
--

CREATE TABLE `treasury_deposits` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `treasury_id` bigint(20) UNSIGNED NOT NULL,
  `account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `debit_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `credit_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `journal_entry_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `reference_number` varchar(255) NOT NULL,
  `deposit_date` date NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `deposit_type` varchar(255) NOT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `description` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `approved_at` datetime 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 `treasury_deposits`
--

INSERT INTO `treasury_deposits` (`id`, `company_id`, `branch_id`, `treasury_id`, `account_id`, `debit_account_id`, `credit_account_id`, `journal_entry_id`, `created_by`, `approved_by`, `reference_number`, `deposit_date`, `amount`, `deposit_type`, `source_type`, `source_id`, `status`, `description`, `notes`, `approved_at`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 7, 27, 23, 27, 3, 1, 1, 'DEP-20251121-560', '2025-11-21', 100000.00, 'cash', NULL, NULL, 'approved', NULL, NULL, '2025-11-21 21:14:27', '2025-11-21 18:12:14', '2025-11-21 18:14:31'),
(2, 17, 6, 11, 540, 539, 540, 87, 16, 16, 'DEP-20260207-638', '2026-01-07', 37634.00, 'cash', NULL, NULL, 'approved', 'حوالة ويسترن مقابل اشتراك منصة البرامج المحاسبية لمدة عام من7-1-2026 الي 7-1-2027 المبلغ عبارة عن 3 الاف ريال بعد خصم مصاريف التحويل', NULL, '2026-02-07 22:26:07', '2026-02-07 19:25:37', '2026-02-07 19:26:08'),
(3, 17, 6, 11, 540, 539, 540, 88, 16, 16, 'DEP-20260207-352', '2026-02-03', 12228.00, 'cash', NULL, NULL, 'approved', 'عمل تعديلات برمجة علي برنامج قمم لكي يكون متوافق مع اشتراطات هيئة الزكاة والدخل السعودية بالبنود التالية \r\n* تعديل شاشة بيانات الشركة الاساسية لكي يتم اضافة البيانات اللازمة للربط المباشر مع الزكاة والدخل \r\n* اضافة زر للربط مع الزكاة والدخل واعطاء رسالة للمستخدم تفيد انه تم الربط بنجاح او فشل الربط \r\n* يظهر للمستخد في موقع الزكاة والدخل الخاص به ان برنامج قمم حاليا تم ربطه بالزكاة والدخل وبذلك يتجنب غرامة عدم الربط \r\n* يتم تعديل تقارير الفواتير كلها بحيث يظهر زر ارسال الفاتورة الي الزكاة والدخل لكي يمكن للمستخدم ارسال الفواتير الي الزكاة والدخل \r\n* يتم اضافة عمود يوضح الاستجابة التي جائت من موقع الزكاة والدخل تفيد تم ارسال الفاتورة او فشل الارسال او تم الارسال مع وجود ملحوظات \r\n* اغلاق الفواتير التي تم ارسالها الي موقع الزكاة والدخل بحيث لا يمكن حذفها اوتعديلها ويتم بشكل تلقائي بدون تدخل المستخدم\r\nالتكلفةالاجمالية 2000 ريال الدفعة الاولي 1000 ريال بعدها بشهرين 500 ريال وبعدها بشهر 500 ريال', NULL, '2026-02-07 23:09:59', '2026-02-07 20:08:29', '2026-02-07 20:10:01'),
(4, 11, 5, 10, 208, 327, 208, 113, 9, 9, '12', '2026-03-03', 1000.00, 'customer_payment', 'App\\Models\\CustomerPayment', 1, 'approved', 'دفع فاتورة رقم: INV-11-0002', NULL, '2026-03-03 01:57:13', '2026-03-02 22:57:12', '2026-03-02 22:57:13');

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

--
-- Table structure for table `treasury_deposit_cost_centers`
--

CREATE TABLE `treasury_deposit_cost_centers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `treasury_deposit_id` bigint(20) UNSIGNED NOT NULL,
  `cost_center_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(15,2) DEFAULT NULL,
  `percentage` decimal(5,2) 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 `treasury_payments`
--

CREATE TABLE `treasury_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `treasury_id` bigint(20) UNSIGNED NOT NULL,
  `account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `debit_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `credit_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `journal_entry_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `reference_number` varchar(255) NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_type` varchar(255) NOT NULL,
  `expense_category` varchar(255) DEFAULT NULL COMMENT 'operating_expense, advance, salary, etc',
  `expense_type` varchar(255) DEFAULT NULL COMMENT 'salary, contractor, equipment, direct_operating',
  `cost_center_id` bigint(20) UNSIGNED DEFAULT NULL,
  `cash_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `beneficiary_type` varchar(255) DEFAULT NULL,
  `beneficiary_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `description` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `approved_at` datetime 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 `treasury_payments`
--

INSERT INTO `treasury_payments` (`id`, `company_id`, `branch_id`, `treasury_id`, `account_id`, `debit_account_id`, `credit_account_id`, `journal_entry_id`, `created_by`, `approved_by`, `reference_number`, `payment_date`, `amount`, `payment_type`, `expense_category`, `expense_type`, `cost_center_id`, `cash_account_id`, `beneficiary_type`, `beneficiary_id`, `status`, `description`, `notes`, `approved_at`, `created_at`, `updated_at`) VALUES
(2, 1, 1, 7, 44, 44, 23, 4, 1, 1, 'PAY-20251122-392', '2025-11-22', 100.00, 'cash', 'operating_expense', 'salary', NULL, NULL, NULL, NULL, 'approved', NULL, NULL, '2025-11-22 13:25:06', '2025-11-22 09:36:34', '2025-11-22 10:25:08'),
(3, 1, 1, 7, 44, 44, 23, 9, 1, 1, 'PAY-20251124-853', '2025-02-01', 7000.00, 'cash', NULL, NULL, NULL, NULL, NULL, NULL, 'approved', NULL, NULL, '2025-11-24 18:42:21', '2025-11-24 15:42:10', '2025-11-24 15:42:22'),
(4, 1, 1, 7, 44, 44, 23, 10, 1, 1, 'PAY-20251124-525', '2025-02-01', 8000.00, 'cash', NULL, NULL, NULL, NULL, NULL, NULL, 'approved', NULL, NULL, '2025-11-24 20:31:17', '2025-11-24 17:31:06', '2025-11-24 17:31:19'),
(5, 1, 1, 7, 44, 44, 23, 12, 1, 1, 'PAY-20251127-452', '2025-01-15', 3000.00, 'cash', NULL, NULL, NULL, NULL, NULL, NULL, 'approved', 'ا', 'ا', '2025-11-27 10:27:23', '2025-11-27 07:26:26', '2025-11-27 07:27:25');

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

--
-- Table structure for table `treasury_payment_cost_centers`
--

CREATE TABLE `treasury_payment_cost_centers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `treasury_payment_id` bigint(20) UNSIGNED NOT NULL,
  `cost_center_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(15,2) DEFAULT NULL,
  `percentage` decimal(5,2) 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 `treasury_payment_cost_centers`
--

INSERT INTO `treasury_payment_cost_centers` (`id`, `treasury_payment_id`, `cost_center_id`, `amount`, `percentage`, `created_at`, `updated_at`) VALUES
(3, 2, 2, NULL, 100.00, '2025-11-22 09:36:34', '2025-11-22 09:36:34'),
(4, 3, 3, 7000.00, NULL, '2025-11-24 15:42:10', '2025-11-24 15:42:10'),
(5, 4, 3, 8000.00, NULL, '2025-11-24 17:31:06', '2025-11-24 17:31:06'),
(6, 5, 8, 3000.00, NULL, '2025-11-27 07:26:26', '2025-11-27 07:26:26');

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

--
-- Table structure for table `treasury_transactions`
--

CREATE TABLE `treasury_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `treasury_id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `transaction_type` varchar(255) NOT NULL,
  `transaction_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `balance_before` decimal(15,2) NOT NULL,
  `balance_after` decimal(15,2) NOT NULL,
  `description` 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 `treasury_transactions`
--

INSERT INTO `treasury_transactions` (`id`, `company_id`, `branch_id`, `treasury_id`, `created_by`, `transaction_type`, `transaction_id`, `amount`, `balance_before`, `balance_after`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 7, 1, 'deposit', 1, 100000.00, 0.00, 100000.00, NULL, '2025-11-21 18:14:30', '2025-11-21 18:14:30'),
(2, 1, 1, 7, 1, 'payment', 1, 100.00, 100000.00, 99900.00, NULL, '2025-11-21 18:15:02', '2025-11-21 18:15:02'),
(3, 1, 1, 7, 1, 'payment', 1, 100.00, 99900.00, 99800.00, NULL, '2025-11-21 18:19:39', '2025-11-21 18:19:39'),
(4, 1, 1, 7, 1, 'payment', 1, 100.00, 99800.00, 99700.00, NULL, '2025-11-21 18:32:11', '2025-11-21 18:32:11'),
(5, 1, 1, 7, 1, 'payment', 1, 100.00, 99700.00, 99600.00, NULL, '2025-11-21 18:37:21', '2025-11-21 18:37:21'),
(6, 1, 1, 7, 1, 'payment', 2, 100.00, 99600.00, 99500.00, NULL, '2025-11-22 09:36:46', '2025-11-22 09:36:46'),
(7, 1, 1, 7, 1, 'payment', 2, 100.00, 99500.00, 99400.00, NULL, '2025-11-22 09:38:08', '2025-11-22 09:38:08'),
(8, 1, 1, 7, 1, 'payment', 2, 100.00, 99400.00, 99300.00, NULL, '2025-11-22 09:57:39', '2025-11-22 09:57:39'),
(9, 1, 1, 7, 1, 'payment', 2, 100.00, 99300.00, 99200.00, NULL, '2025-11-22 09:58:05', '2025-11-22 09:58:05'),
(10, 1, 1, 7, 1, 'payment', 2, 100.00, 99200.00, 99100.00, NULL, '2025-11-22 09:58:44', '2025-11-22 09:58:44'),
(11, 1, 1, 7, 1, 'payment', 2, 100.00, 99100.00, 99000.00, NULL, '2025-11-22 10:19:00', '2025-11-22 10:19:00'),
(12, 1, 1, 7, 1, 'payment', 2, 100.00, 99000.00, 98900.00, NULL, '2025-11-22 10:25:07', '2025-11-22 10:25:07'),
(13, 1, 1, 7, 1, 'payment', 3, 7000.00, 98900.00, 91900.00, NULL, '2025-11-24 15:42:21', '2025-11-24 15:42:21'),
(14, 1, 1, 7, 1, 'payment', 4, 8000.00, 91900.00, 83900.00, NULL, '2025-11-24 17:31:17', '2025-11-24 17:31:17'),
(15, 1, 1, 7, 1, 'payment', 5, 3000.00, 83900.00, 80900.00, 'ا', '2025-11-27 07:27:24', '2025-11-27 07:27:24'),
(16, 17, 6, 11, 16, 'deposit', 2, 37634.00, 0.00, 37634.00, 'حوالة ويسترن مقابل اشتراك منصة البرامج المحاسبية لمدة عام من7-1-2026 الي 7-1-2027 المبلغ عبارة عن 3 الاف ريال بعد خصم مصاريف التحويل', '2026-02-07 19:26:07', '2026-02-07 19:26:07'),
(17, 17, 6, 11, 16, 'deposit', 3, 12228.00, 0.00, 12228.00, 'عمل تعديلات برمجة علي برنامج قمم لكي يكون متوافق مع اشتراطات هيئة الزكاة والدخل السعودية بالبنود التالية \r\n* تعديل شاشة بيانات الشركة الاساسية لكي يتم اضافة البيانات اللازمة للربط المباشر مع الزكاة والدخل \r\n* اضافة زر للربط مع الزكاة والدخل واعطاء رسالة للمستخدم تفيد انه تم الربط بنجاح او فشل الربط \r\n* يظهر للمستخد في موقع الزكاة والدخل الخاص به ان برنامج قمم حاليا تم ربطه بالزكاة والدخل وبذلك يتجنب غرامة عدم الربط \r\n* يتم تعديل تقارير الفواتير كلها بحيث يظهر زر ارسال الفاتورة الي الزكاة والدخل لكي يمكن للمستخدم ارسال الفواتير الي الزكاة والدخل \r\n* يتم اضافة عمود يوضح الاستجابة التي جائت من موقع الزكاة والدخل تفيد تم ارسال الفاتورة او فشل الارسال او تم الارسال مع وجود ملحوظات \r\n* اغلاق الفواتير التي تم ارسالها الي موقع الزكاة والدخل بحيث لا يمكن حذفها اوتعديلها ويتم بشكل تلقائي بدون تدخل المستخدم\r\nالتكلفةالاجمالية 2000 ريال الدفعة الاولي 1000 ريال بعدها بشهرين 500 ريال وبعدها بشهر 500 ريال', '2026-02-07 20:10:00', '2026-02-07 20:10:00'),
(18, 11, 5, 10, 9, 'deposit', 4, 1000.00, 0.00, 1000.00, 'دفع فاتورة رقم: INV-11-0002', '2026-03-02 22:57:13', '2026-03-02 22:57:13'),
(19, 11, 5, 10, 9, 'transfer_out', 1, 500.00, 0.00, -500.00, 'تحويل إلى خزينة: خزينة رقم 2', '2026-03-03 02:34:46', '2026-03-03 02:34:46'),
(20, 11, 5, 12, 9, 'transfer_in', 1, 500.00, 0.00, 500.00, 'تحويل من خزينة: خزينة رقم 1', '2026-03-03 02:34:47', '2026-03-03 02:34:47');

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

--
-- Table structure for table `treasury_transfers`
--

CREATE TABLE `treasury_transfers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `from_treasury_id` bigint(20) UNSIGNED NOT NULL,
  `to_treasury_id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `reference_number` varchar(255) NOT NULL,
  `transfer_date` date NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `description` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `approved_at` datetime 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 `treasury_transfers`
--

INSERT INTO `treasury_transfers` (`id`, `company_id`, `branch_id`, `from_treasury_id`, `to_treasury_id`, `created_by`, `approved_by`, `reference_number`, `transfer_date`, `amount`, `status`, `description`, `notes`, `approved_at`, `created_at`, `updated_at`) VALUES
(1, 11, 5, 10, 12, 9, 9, 'TRF-20260303-945', '2026-03-03', 500.00, 'approved', NULL, NULL, '2026-03-03 05:34:45', '2026-03-03 02:28:20', '2026-03-03 02:34:45');

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

--
-- Table structure for table `trips`
--

CREATE TABLE `trips` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `transport_company_id` bigint(20) UNSIGNED NOT NULL,
  `route_id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `driver_id` bigint(20) UNSIGNED NOT NULL,
  `trip_code` varchar(100) NOT NULL,
  `departure_date` date NOT NULL,
  `departure_time` datetime NOT NULL,
  `expected_arrival_date` date NOT NULL,
  `expected_arrival_time` datetime NOT NULL,
  `actual_departure_time` datetime DEFAULT NULL,
  `actual_arrival_time` datetime DEFAULT NULL,
  `total_passengers` int(11) NOT NULL DEFAULT 0,
  `available_seats` int(11) NOT NULL DEFAULT 0,
  `base_fare` decimal(10,2) NOT NULL,
  `fuel_cost_estimated` decimal(10,2) DEFAULT NULL,
  `status` enum('scheduled','in_progress','completed','cancelled') NOT NULL DEFAULT 'scheduled',
  `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 `trips`
--

INSERT INTO `trips` (`id`, `transport_company_id`, `route_id`, `vehicle_id`, `driver_id`, `trip_code`, `departure_date`, `departure_time`, `expected_arrival_date`, `expected_arrival_time`, `actual_departure_time`, `actual_arrival_time`, `total_passengers`, `available_seats`, `base_fare`, `fuel_cost_estimated`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 3, 'TP-6200', '2026-02-25', '2026-02-23 12:27:50', '2026-03-01', '2026-03-04 03:27:50', NULL, NULL, 0, 40, 297.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:50', '2026-02-21 08:27:50'),
(2, 1, 1, 2, 10, 'TP-9175', '2026-02-27', '2026-03-02 16:27:50', '2026-03-01', '2026-03-03 05:27:50', NULL, NULL, 0, 40, 124.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:50', '2026-02-21 08:27:50'),
(3, 1, 1, 2, 9, 'TP-9666', '2026-02-27', '2026-02-26 10:27:51', '2026-02-24', '2026-02-23 06:27:51', NULL, NULL, 0, 40, 213.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:51', '2026-02-21 08:27:51'),
(4, 1, 2, 4, 7, 'TP-3450', '2026-03-02', '2026-02-28 17:27:51', '2026-02-22', '2026-02-26 17:27:51', NULL, NULL, 0, 40, 248.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:51', '2026-02-21 08:27:51'),
(5, 1, 2, 2, 2, 'TP-5476', '2026-03-01', '2026-02-23 17:27:51', '2026-02-27', '2026-02-26 22:27:51', NULL, NULL, 0, 40, 137.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:51', '2026-02-21 08:27:51'),
(6, 1, 2, 4, 1, 'TP-8732', '2026-02-27', '2026-03-01 19:27:52', '2026-03-01', '2026-03-02 23:27:52', NULL, NULL, 0, 40, 273.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:52', '2026-02-21 08:27:52'),
(7, 1, 3, 1, 2, 'TP-3473', '2026-03-01', '2026-02-24 10:27:52', '2026-03-02', '2026-02-22 14:27:52', NULL, NULL, 0, 40, 201.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:52', '2026-02-21 08:27:52'),
(8, 1, 3, 5, 1, 'TP-4003', '2026-03-03', '2026-02-23 12:27:52', '2026-03-02', '2026-02-28 14:27:52', NULL, NULL, 0, 40, 270.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:52', '2026-02-21 08:27:52'),
(9, 1, 3, 5, 9, 'TP-1423', '2026-03-02', '2026-03-02 19:27:52', '2026-03-01', '2026-02-26 14:27:52', NULL, NULL, 0, 40, 276.00, NULL, 'scheduled', NULL, '2026-02-21 08:27:52', '2026-02-21 08:27:52');

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

--
-- Table structure for table `trip_stops`
--

CREATE TABLE `trip_stops` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `trip_id` bigint(20) UNSIGNED NOT NULL,
  `route_stop_id` bigint(20) UNSIGNED NOT NULL,
  `stop_order` int(11) NOT NULL,
  `scheduled_time` datetime NOT NULL,
  `actual_time` datetime DEFAULT NULL,
  `passengers_boarded` int(11) NOT NULL DEFAULT 0,
  `passengers_alighted` 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;

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `company_id`, `name`, `code`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'كيس', '1', NULL, 1, '2025-11-14 11:20:08', '2025-11-16 14:54:50', NULL),
(2, 1, 'حبة', '1', NULL, 1, '2025-11-14 11:20:36', '2025-11-14 11:30:00', '2025-11-14 11:30:00'),
(3, 1, 'حبة', '1', NULL, 1, '2025-11-14 11:25:36', '2025-11-14 11:30:05', '2025-11-14 11:30:05'),
(4, 1, 'حبة', '1', NULL, 1, '2025-11-14 11:25:56', '2025-11-14 11:29:55', '2025-11-14 11:29:55'),
(5, 1, 'حبة', '1', NULL, 1, '2025-11-14 11:29:37', '2025-11-14 11:29:49', '2025-11-14 11:29:49'),
(6, 1, 'طن', NULL, NULL, 1, '2025-11-16 14:55:01', '2025-11-16 14:55:01', NULL),
(7, 1, 'م مكعب', NULL, NULL, 1, '2025-11-16 14:55:17', '2025-11-16 14:55:17', NULL),
(8, 10, 'حبة', '1', NULL, 1, '2025-12-01 09:20:17', '2025-12-01 16:13:55', NULL),
(9, 10, 'كيس', '2', NULL, 1, '2025-12-01 14:18:50', '2025-12-01 14:18:50', NULL),
(10, 10, 'م مكعب', '3', NULL, 1, '2025-12-01 14:19:07', '2025-12-01 14:19:07', NULL),
(11, 10, 'طن', '4', NULL, 1, '2025-12-01 14:19:26', '2025-12-01 14:19:26', NULL),
(12, 10, 'كيلو', NULL, NULL, 1, '2025-12-01 14:19:47', '2025-12-01 14:19:47', NULL),
(13, 11, 'كيس', NULL, NULL, 1, '2025-12-02 15:02:39', '2025-12-02 15:02:39', NULL),
(14, 11, 'طن', NULL, NULL, 1, '2025-12-02 15:02:56', '2025-12-02 15:02:56', NULL),
(15, 11, 'م مكعب', NULL, NULL, 1, '2025-12-02 15:03:13', '2025-12-02 15:03:13', NULL),
(16, 11, 'EA', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:31:54', '2025-12-29 07:31:54', NULL),
(17, 11, 'DRUM', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:31:55', '2025-12-29 07:31:55', NULL),
(18, 11, 'M', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:31:56', '2025-12-29 07:31:56', NULL),
(19, 11, 'R', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:31:57', '2025-12-29 07:31:57', NULL),
(20, 11, 'KM', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:32:02', '2025-12-29 07:32:02', NULL),
(21, 11, 'KIT', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:32:02', '2025-12-29 07:32:02', NULL),
(22, 11, 'U', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:34:41', '2025-12-29 07:34:41', NULL),
(23, 11, 'PAA', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:11', '2025-12-29 07:35:11', NULL),
(24, 11, 'ROL', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:26', '2025-12-29 07:35:26', NULL),
(25, 11, 'ST', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:28', '2025-12-29 07:35:28', NULL),
(26, 11, 'ASM', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:37', '2025-12-29 07:35:37', NULL),
(27, 11, 'DR', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:50', '2025-12-29 07:35:50', NULL),
(28, 11, 'Each', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2025-12-29 07:35:54', '2025-12-29 07:35:54', NULL),
(29, 16, 'درزن', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2026-01-04 15:17:42', '2026-01-04 15:17:42', NULL),
(30, 16, 'علبة', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2026-01-04 15:17:42', '2026-01-04 15:17:42', NULL),
(31, 16, 'حبة', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2026-01-04 15:17:47', '2026-01-04 15:17:47', NULL),
(32, 16, 'طقم', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2026-01-04 15:17:54', '2026-01-04 15:17:54', NULL),
(33, 16, 'ربطة', NULL, 'تم إنشاء هذه الوحدة تلقائياً أثناء استيراد الأصناف', 1, '2026-01-04 15:18:01', '2026-01-04 15:18:01', NULL),
(34, 17, 'كيس', '1', 'كيس', 1, '2026-01-10 08:22:22', '2026-01-10 08:22:43', NULL),
(38, 17, 'حبة', 'PIECE', NULL, 1, '2026-01-15 10:17:40', '2026-01-15 10:17:40', NULL),
(39, 17, '1', 'UNIT-1', NULL, 1, '2026-01-15 10:17:40', '2026-01-15 10:17:40', NULL),
(40, 17, '2', 'UNIT-2', NULL, 1, '2026-01-15 10:17:41', '2026-01-15 10:17:41', NULL),
(41, 17, '1', 'UNIT-1', NULL, 1, '2026-01-15 11:50:54', '2026-01-15 11:50:54', NULL),
(42, 17, '2', 'UNIT-2', NULL, 1, '2026-01-15 11:50:54', '2026-01-15 11:50:54', NULL),
(43, 17, '1', 'UNIT-1', NULL, 1, '2026-01-15 11:54:50', '2026-01-15 11:54:50', NULL),
(44, 17, '2', 'UNIT-2', NULL, 1, '2026-01-15 11:54:50', '2026-01-15 11:54:50', NULL),
(45, 17, '1', 'UNIT-1', NULL, 1, '2026-01-15 12:04:11', '2026-01-15 12:04:11', NULL),
(46, 17, '2', 'UNIT-2', NULL, 1, '2026-01-15 12:04:11', '2026-01-15 12:04:11', NULL),
(49, 17, '1', 'UNIT-1', NULL, 1, '2026-01-15 12:50:29', '2026-01-15 12:50:29', NULL),
(50, 17, '2', 'UNIT-2', NULL, 1, '2026-01-15 12:50:29', '2026-01-15 12:50:29', NULL),
(51, 17, 'حبة', 'UNIT-1', NULL, 1, '2026-01-15 17:37:44', '2026-01-15 17:37:44', NULL),
(52, 17, 'كيس', 'UNIT-2', NULL, 1, '2026-01-15 17:37:44', '2026-01-15 17:37:44', NULL),
(53, 17, 'حبة', 'UNIT-1', NULL, 1, '2026-01-15 18:01:54', '2026-01-15 18:01:54', NULL),
(54, 17, 'كيس', 'UNIT-2', NULL, 1, '2026-01-15 18:01:54', '2026-01-15 18:01:54', NULL),
(55, 17, 'كيس', 'UNIT-2', NULL, 1, '2026-01-15 18:01:54', '2026-01-15 18:01:54', NULL),
(56, 18, 'درزن', '2', 'درزن', 1, '2026-01-20 04:35:49', '2026-01-20 04:35:49', NULL),
(57, 18, 'طقم', '4', 'طقم', 1, '2026-01-20 04:36:54', '2026-01-20 04:36:54', NULL),
(58, 18, 'ربطة', '3', 'ربطة', 1, '2026-01-20 04:37:37', '2026-01-20 04:37:37', NULL),
(59, 18, 'علبة', '5', 'علبة', 1, '2026-01-20 04:38:07', '2026-01-20 04:38:07', NULL),
(60, 18, '=VLOOKUP([1]Worksheet!$D3,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900293', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(61, 18, '=VLOOKUP([1]Worksheet!$D4,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900299', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(62, 18, 'حبة', 'PIECE', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(63, 18, '=VLOOKUP([1]Worksheet!$D5,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900293', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(64, 18, '=VLOOKUP([1]Worksheet!$D6,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900297', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(65, 18, '=VLOOKUP([1]Worksheet!$D7,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900296', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(66, 18, '=VLOOKUP([1]Worksheet!$D8,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900299', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(67, 18, '=VLOOKUP([1]Worksheet!$D9,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900296', NULL, 1, '2026-01-21 10:07:09', '2026-01-21 10:07:09', NULL),
(68, 18, '=VLOOKUP([1]Worksheet!$D10,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900307', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(69, 18, '=VLOOKUP([1]Worksheet!$D11,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900304', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(70, 18, '=VLOOKUP([1]Worksheet!$D12,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900306', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(71, 18, '=VLOOKUP([1]Worksheet!$D13,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900303', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(72, 18, '=VLOOKUP([1]Worksheet!$D14,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900309', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(73, 18, '=VLOOKUP([1]Worksheet!$D15,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900308', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(74, 18, '=VLOOKUP([1]Worksheet!$D16,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900306', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(75, 18, '=VLOOKUP([1]Worksheet!$D17,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900309', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(76, 18, '=VLOOKUP([1]Worksheet!$D18,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900301', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(77, 18, '=VLOOKUP([1]Worksheet!$D19,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900301', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(78, 18, '=VLOOKUP([1]Worksheet!$D20,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900304', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(79, 18, '=VLOOKUP([1]Worksheet!$D21,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900305', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(80, 18, '=VLOOKUP([1]Worksheet!$D22,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900302', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(81, 18, '=VLOOKUP([1]Worksheet!$D23,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900303', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(82, 18, '=VLOOKUP([1]Worksheet!$D24,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900309', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(83, 18, '=VLOOKUP([1]Worksheet!$D25,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900302', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(84, 18, '=VLOOKUP([1]Worksheet!$D26,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900309', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(85, 18, '=VLOOKUP([1]Worksheet!$D27,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900303', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(86, 18, '=VLOOKUP([1]Worksheet!$D28,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900303', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(87, 18, '=VLOOKUP([1]Worksheet!$D29,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900307', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(88, 18, '=VLOOKUP([1]Worksheet!$D30,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900301', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(89, 18, '=VLOOKUP([1]Worksheet!$D31,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900307', NULL, 1, '2026-01-21 10:07:10', '2026-01-21 10:07:10', NULL),
(90, 18, '=VLOOKUP([1]Worksheet!$D32,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(91, 18, '=VLOOKUP([1]Worksheet!$D33,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900318', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(92, 18, '=VLOOKUP([1]Worksheet!$D34,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900318', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(93, 18, '=VLOOKUP([1]Worksheet!$D35,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(94, 18, '=VLOOKUP([1]Worksheet!$D36,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(95, 18, '=VLOOKUP([1]Worksheet!$D37,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900316', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(96, 18, '=VLOOKUP([1]Worksheet!$D38,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(97, 18, '=VLOOKUP([1]Worksheet!$D39,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900313', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(98, 18, '=VLOOKUP([1]Worksheet!$D40,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900312', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(99, 18, '=VLOOKUP([1]Worksheet!$D41,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900316', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(100, 18, '=VLOOKUP([1]Worksheet!$D42,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(101, 18, '=VLOOKUP([1]Worksheet!$D43,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900313', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(102, 18, '=VLOOKUP([1]Worksheet!$D44,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(103, 18, '=VLOOKUP([1]Worksheet!$D45,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900312', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(104, 18, '=VLOOKUP([1]Worksheet!$D46,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900318', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(105, 18, '=VLOOKUP([1]Worksheet!$D47,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900316', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(106, 18, '=VLOOKUP([1]Worksheet!$D48,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(107, 18, '=VLOOKUP([1]Worksheet!$D49,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900316', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(108, 18, '=VLOOKUP([1]Worksheet!$D50,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(109, 18, '=VLOOKUP([1]Worksheet!$D51,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900319', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(110, 18, '=VLOOKUP([1]Worksheet!$D52,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900311', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(111, 18, '=VLOOKUP([1]Worksheet!$D53,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(112, 18, '=VLOOKUP([1]Worksheet!$D54,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(113, 18, '=VLOOKUP([1]Worksheet!$D55,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(114, 18, '=VLOOKUP([1]Worksheet!$D56,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(115, 18, '=VLOOKUP([1]Worksheet!$D57,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900312', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(116, 18, '=VLOOKUP([1]Worksheet!$D58,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(117, 18, '=VLOOKUP([1]Worksheet!$D59,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900315', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(118, 18, '=VLOOKUP([1]Worksheet!$D60,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(119, 18, '=VLOOKUP([1]Worksheet!$D61,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900317', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(120, 18, '=VLOOKUP([1]Worksheet!$D62,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900311', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(121, 18, '=VLOOKUP([1]Worksheet!$D63,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900318', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(122, 18, '=VLOOKUP([1]Worksheet!$D64,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(123, 18, '=VLOOKUP([1]Worksheet!$D65,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900314', NULL, 1, '2026-01-21 10:07:11', '2026-01-21 10:07:11', NULL),
(124, 18, '=VLOOKUP([1]Worksheet!$D66,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900325', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(125, 18, '=VLOOKUP([1]Worksheet!$D67,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900322', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(126, 18, '=VLOOKUP([1]Worksheet!$D68,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900325', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(127, 18, '=VLOOKUP([1]Worksheet!$D69,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900329', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(128, 18, '=VLOOKUP([1]Worksheet!$D70,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900321', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(129, 18, '=VLOOKUP([1]Worksheet!$D71,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900322', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(130, 18, '=VLOOKUP([1]Worksheet!$D72,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900328', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(131, 18, '=VLOOKUP([1]Worksheet!$D73,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900321', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(132, 18, '=VLOOKUP([1]Worksheet!$D74,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900327', NULL, 1, '2026-01-21 10:07:12', '2026-01-21 10:07:12', NULL),
(133, 18, '=VLOOKUP([1]Worksheet!$D75,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900331', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(134, 18, '=VLOOKUP([1]Worksheet!$D76,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900333', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(135, 18, '=VLOOKUP([1]Worksheet!$D77,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900336', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(136, 18, '=VLOOKUP([1]Worksheet!$D78,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900335', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(137, 18, '=VLOOKUP([1]Worksheet!$D79,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900333', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(138, 18, '=VLOOKUP([1]Worksheet!$D80,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900335', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(139, 18, '=VLOOKUP([1]Worksheet!$D81,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900332', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(140, 18, '=VLOOKUP([1]Worksheet!$D82,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900332', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(141, 18, '=VLOOKUP([1]Worksheet!$D83,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900337', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(142, 18, '=VLOOKUP([1]Worksheet!$D84,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900331', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(143, 18, '=VLOOKUP([1]Worksheet!$D85,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(144, 18, '=VLOOKUP([1]Worksheet!$D86,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(145, 18, '=VLOOKUP([1]Worksheet!$D87,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(146, 18, '=VLOOKUP([1]Worksheet!$D88,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900337', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(147, 18, '=VLOOKUP([1]Worksheet!$D89,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(148, 18, '=VLOOKUP([1]Worksheet!$D90,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(149, 18, '=VLOOKUP([1]Worksheet!$D91,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900332', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(150, 18, '=VLOOKUP([1]Worksheet!$D92,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900338', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(151, 18, '=VLOOKUP([1]Worksheet!$D93,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900337', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(152, 18, '=VLOOKUP([1]Worksheet!$D94,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900333', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(153, 18, '=VLOOKUP([1]Worksheet!$D95,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900339', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(154, 18, '=VLOOKUP([1]Worksheet!$D97,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900331', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL),
(155, 18, '=VLOOKUP([1]Worksheet!$D99,[1]الاصناف!$A$3:$D$284,4,0)', 'UNIT-17689900333', NULL, 1, '2026-01-21 10:07:13', '2026-01-21 10:07:13', NULL);

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

--
-- Table structure for table `user_languages`
--

CREATE TABLE `user_languages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `language_id` bigint(20) UNSIGNED NOT NULL,
  `is_preferred` 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 `user_languages`
--

INSERT INTO `user_languages` (`id`, `user_id`, `language_id`, `is_preferred`, `created_at`, `updated_at`) VALUES
(1, 9, 2, 0, '2025-12-03 07:52:11', '2026-02-24 19:11:50'),
(2, 9, 3, 0, '2025-12-03 07:52:22', '2026-02-24 19:11:50'),
(3, 1, 2, 0, '2025-12-03 07:57:25', '2025-12-19 08:17:55'),
(4, 1, 1, 1, '2025-12-03 14:15:37', '2025-12-19 08:17:55'),
(5, 1, 3, 0, '2025-12-03 14:21:53', '2025-12-19 08:17:55'),
(6, 3, 2, 0, '2025-12-04 07:57:17', '2025-12-04 07:57:38'),
(7, 3, 3, 0, '2025-12-04 07:57:32', '2025-12-04 07:57:38'),
(8, 3, 1, 1, '2025-12-04 07:57:38', '2025-12-04 07:57:38'),
(9, 9, 1, 1, '2025-12-06 20:40:12', '2026-02-24 19:11:50'),
(10, 10, 2, 0, '2025-12-07 07:39:05', '2025-12-07 07:51:26'),
(11, 10, 1, 1, '2025-12-07 07:49:21', '2025-12-07 07:51:26'),
(12, 12, 2, 0, '2025-12-07 16:39:38', '2025-12-07 17:27:21'),
(13, 12, 3, 0, '2025-12-07 16:40:04', '2025-12-07 17:27:21'),
(14, 12, 1, 1, '2025-12-07 17:27:17', '2025-12-07 17:27:21'),
(15, 16, 2, 0, '2026-01-09 16:20:05', '2026-01-09 16:23:46'),
(16, 16, 3, 0, '2026-01-09 16:20:23', '2026-01-09 16:23:46'),
(17, 16, 1, 1, '2026-01-09 16:23:46', '2026-01-09 16:23:46');

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

--
-- Table structure for table `user_permission`
--

CREATE TABLE `user_permission` (
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `value` tinyint(1) NOT NULL DEFAULT 1,
  `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 `user_permission`
--

INSERT INTO `user_permission` (`user_id`, `permission_id`, `value`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:16'),
(1, 2, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:17'),
(1, 3, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:17'),
(1, 4, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:17'),
(1, 5, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:17'),
(1, 6, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:17'),
(1, 7, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:18'),
(1, 8, 1, '2025-10-21 15:06:09', '2026-01-09 16:55:18'),
(1, 9, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:18'),
(1, 10, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:18'),
(1, 11, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:18'),
(1, 12, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 13, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 14, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 15, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 16, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 17, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 18, 1, '2025-10-21 15:06:10', '2026-01-09 16:55:19'),
(1, 19, 1, '2025-10-21 15:06:11', '2026-01-09 16:55:19'),
(1, 20, 1, '2025-10-21 15:06:11', '2026-01-09 16:55:19'),
(1, 21, 1, '2025-10-21 15:06:11', '2026-01-09 16:55:19'),
(1, 22, 1, '2025-10-21 15:06:11', '2026-01-09 16:55:19'),
(1, 23, 1, '2025-10-21 15:06:12', '2026-01-09 16:55:19'),
(1, 24, 1, '2025-10-21 15:06:12', '2026-01-09 16:55:20'),
(1, 25, 1, '2025-10-21 15:06:13', '2026-01-09 16:55:20'),
(1, 26, 1, '2025-10-21 15:06:13', '2026-01-09 16:55:20'),
(1, 27, 1, '2025-10-21 15:06:13', '2026-01-09 16:55:20'),
(1, 28, 1, '2025-10-21 15:06:13', '2026-01-09 16:55:20'),
(1, 29, 1, '2025-10-21 15:06:13', '2026-01-09 16:55:20'),
(1, 30, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 31, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 32, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 33, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 34, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 35, 1, '2025-10-21 15:06:14', '2026-01-09 16:55:20'),
(1, 36, 1, '2025-10-21 15:06:15', '2026-01-09 16:55:20'),
(1, 37, 1, '2025-10-21 15:06:15', '2026-01-09 16:55:20'),
(1, 38, 1, '2025-10-21 15:06:15', '2026-01-09 16:55:20'),
(1, 39, 1, '2025-10-21 15:06:15', '2026-01-09 16:55:20'),
(1, 40, 1, '2025-10-21 15:06:15', '2026-01-09 16:55:21'),
(1, 41, 1, '2025-10-21 15:06:16', '2026-01-09 16:55:21'),
(1, 42, 1, '2025-10-21 15:06:16', '2026-01-09 16:55:21'),
(1, 43, 1, '2025-10-21 15:06:16', '2026-01-09 16:55:21'),
(1, 44, 1, '2025-10-21 15:06:16', '2026-01-09 16:55:21'),
(1, 45, 1, '2025-10-21 15:06:17', '2026-01-09 16:55:21'),
(1, 46, 1, '2025-10-21 15:06:17', '2026-01-09 16:55:21'),
(1, 47, 1, '2025-10-21 15:06:17', '2026-01-09 16:55:21'),
(1, 48, 1, '2025-10-21 15:06:17', '2026-01-09 16:55:21'),
(1, 49, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:21'),
(1, 50, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:21'),
(1, 51, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:21'),
(1, 52, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:22'),
(1, 53, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:22'),
(1, 54, 1, '2025-10-21 15:06:18', '2026-01-09 16:55:22'),
(1, 55, 1, '2025-10-21 15:06:19', '2026-01-09 16:55:22'),
(1, 56, 1, '2025-10-21 15:06:19', '2026-01-09 16:55:22'),
(1, 57, 1, '2025-10-21 15:06:19', '2026-01-09 16:55:22'),
(1, 58, 1, '2025-10-21 15:06:19', '2026-01-09 16:55:22'),
(1, 59, 1, '2025-10-21 15:06:19', '2026-01-09 16:55:22'),
(1, 60, 1, '2025-10-21 15:06:20', '2026-01-09 16:55:22'),
(1, 61, 1, '2025-10-21 15:06:20', '2026-01-09 16:55:22'),
(1, 92, 1, '2025-10-21 18:07:56', '2026-01-09 16:55:22'),
(1, 93, 1, '2025-10-21 18:07:56', '2026-01-09 16:55:22'),
(1, 94, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:22'),
(1, 95, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:22'),
(1, 96, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:22'),
(1, 97, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 98, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 99, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 100, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 101, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 102, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 103, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 104, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 105, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 106, 1, '2025-10-21 18:07:57', '2026-01-09 16:55:23'),
(1, 107, 1, '2025-10-21 18:07:58', '2026-01-09 16:55:23'),
(1, 108, 1, '2025-10-21 18:07:58', '2026-01-09 16:55:23'),
(1, 109, 1, '2025-10-21 18:07:58', '2026-01-09 16:55:23'),
(1, 110, 1, '2025-10-21 18:07:58', '2026-01-09 16:55:23'),
(1, 111, 1, '2025-10-21 18:07:59', '2026-01-09 16:55:23'),
(1, 112, 1, '2025-10-21 18:07:59', '2026-01-09 16:55:23'),
(1, 113, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:23'),
(1, 114, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 115, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 116, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 117, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 118, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 119, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 120, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 121, 1, '2025-10-21 18:08:00', '2026-01-09 16:55:24'),
(1, 122, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 123, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 124, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 125, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 126, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 127, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 128, 1, '2025-10-21 18:08:01', '2026-01-09 16:55:25'),
(1, 129, 1, '2025-10-22 14:40:53', '2026-01-09 16:55:25'),
(1, 130, 1, '2025-10-22 14:40:53', '2026-01-09 16:55:25'),
(1, 131, 1, '2025-10-22 14:40:53', '2026-01-09 16:55:25'),
(1, 132, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:25'),
(1, 133, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:25'),
(1, 134, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:25'),
(1, 135, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:25'),
(1, 136, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:25'),
(1, 137, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:26'),
(1, 138, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:26'),
(1, 139, 1, '2025-10-22 14:40:54', '2026-01-09 16:55:26'),
(1, 140, 1, '2025-10-22 14:40:55', '2026-01-09 16:55:27'),
(1, 141, 1, '2025-10-22 14:40:55', '2026-01-09 16:55:27'),
(1, 142, 1, '2025-10-22 14:40:55', '2026-01-09 16:55:27'),
(1, 143, 1, '2025-10-22 14:40:55', '2026-01-09 16:55:27'),
(1, 144, 1, '2025-10-22 14:40:55', '2026-01-09 16:55:27'),
(1, 145, 1, '2025-10-22 14:40:56', '2026-01-09 16:55:27'),
(1, 146, 1, '2025-10-22 14:40:56', '2026-01-09 16:55:27'),
(1, 147, 1, '2025-10-22 14:40:57', '2026-01-09 16:55:27'),
(1, 148, 1, '2025-10-22 14:40:57', '2026-01-09 16:55:28'),
(1, 149, 1, '2025-10-22 14:40:57', '2026-01-09 16:55:28'),
(1, 150, 1, '2025-10-22 14:40:57', '2026-01-09 16:55:28'),
(1, 151, 1, '2025-10-24 19:05:46', '2026-01-09 16:55:29'),
(1, 152, 1, '2025-10-24 19:05:46', '2026-01-09 16:55:29'),
(1, 153, 1, '2025-10-24 19:05:46', '2026-01-09 16:55:29'),
(1, 154, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:29'),
(1, 155, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:30'),
(1, 156, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:30'),
(1, 157, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:30'),
(1, 158, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:31'),
(1, 159, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:31'),
(1, 160, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:31'),
(1, 161, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:31'),
(1, 162, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:31'),
(1, 163, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:32'),
(1, 164, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:32'),
(1, 165, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:32'),
(1, 166, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:32'),
(1, 167, 1, '2025-10-24 19:05:47', '2026-01-09 16:55:32'),
(1, 168, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:32'),
(1, 169, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 170, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 171, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 172, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 173, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 174, 1, '2025-10-24 19:05:48', '2026-01-09 16:55:33'),
(1, 175, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 176, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 177, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 178, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 179, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 180, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:34'),
(1, 181, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:35'),
(1, 182, 1, '2025-10-24 19:05:49', '2026-01-09 16:55:35'),
(1, 183, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:35'),
(1, 184, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:35'),
(1, 186, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:35'),
(1, 187, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:35'),
(1, 188, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:35'),
(1, 189, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:36'),
(1, 190, 1, '2025-10-24 19:05:50', '2026-01-09 16:55:36'),
(1, 191, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 192, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 193, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 194, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 195, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 196, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 197, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:36'),
(1, 198, 1, '2025-10-24 19:05:51', '2026-01-09 16:55:37'),
(1, 199, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 200, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 201, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 202, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 203, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 204, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 205, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 206, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:37'),
(1, 207, 1, '2025-10-24 19:05:52', '2026-01-09 16:55:38'),
(1, 208, 1, '2025-10-24 19:05:53', '2026-01-09 16:55:38'),
(1, 209, 1, '2025-10-24 19:05:53', '2026-01-09 16:55:38'),
(1, 210, 1, '2025-10-24 19:05:53', '2026-01-09 16:55:38'),
(1, 211, 1, '2025-10-24 19:05:53', '2026-01-09 16:55:38'),
(1, 212, 1, '2025-10-24 19:05:53', '2026-01-09 16:55:38'),
(1, 213, 1, '2025-10-24 19:05:54', '2026-01-09 16:55:38'),
(1, 214, 1, '2025-10-24 19:05:54', '2025-12-16 09:22:11'),
(1, 215, 1, '2025-10-24 19:05:54', '2025-12-16 09:22:12'),
(1, 216, 1, '2025-10-24 19:05:54', '2025-12-16 09:22:12'),
(1, 217, 1, '2025-10-24 19:05:54', '2025-12-16 09:22:12'),
(1, 218, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:12'),
(1, 220, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:12'),
(1, 221, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:12'),
(1, 222, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:12'),
(1, 223, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:13'),
(1, 224, 1, '2025-10-24 19:05:55', '2025-12-16 09:22:13'),
(1, 225, 1, '2025-10-24 19:05:56', '2025-12-16 09:22:14'),
(1, 226, 1, '2025-10-24 19:05:56', '2025-12-16 09:22:14'),
(1, 227, 1, '2025-10-24 19:05:56', '2025-12-16 09:22:14'),
(1, 228, 1, '2025-10-24 19:05:56', '2025-12-16 09:22:15'),
(1, 229, 1, '2025-10-24 19:05:56', '2025-12-16 09:22:15'),
(1, 230, 1, '2025-10-26 16:55:23', '2025-12-16 09:22:16'),
(1, 231, 1, '2025-10-26 16:55:23', '2025-12-16 09:22:16'),
(1, 232, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:17'),
(1, 233, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:17'),
(1, 234, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:17'),
(1, 235, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:17'),
(1, 236, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:18'),
(1, 237, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:18'),
(1, 238, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:18'),
(1, 239, 1, '2025-10-26 16:55:24', '2025-12-16 09:22:18'),
(1, 240, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:19'),
(1, 241, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:19'),
(1, 242, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:19'),
(1, 243, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:19'),
(1, 244, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:19'),
(1, 245, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:20'),
(1, 246, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:20'),
(1, 247, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:20'),
(1, 248, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:20'),
(1, 249, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:21'),
(1, 250, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:21'),
(1, 251, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:21'),
(1, 252, 1, '2025-10-26 16:55:25', '2025-12-16 09:22:21'),
(1, 253, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:21'),
(1, 254, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:21'),
(1, 255, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:21'),
(1, 256, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:21'),
(1, 257, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 258, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 259, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 260, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 261, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 262, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 263, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 264, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:22'),
(1, 265, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:23'),
(1, 266, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:23'),
(1, 267, 1, '2025-10-26 16:55:26', '2025-12-16 09:22:23'),
(1, 268, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:23'),
(1, 269, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:23'),
(1, 270, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:23'),
(1, 271, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 272, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 273, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 274, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 275, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 276, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:24'),
(1, 277, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 278, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 279, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 280, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 281, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 282, 1, '2025-10-26 16:55:27', '2025-12-16 09:22:25'),
(1, 283, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:25'),
(1, 284, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 285, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 286, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 287, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 288, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 289, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 290, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:26'),
(1, 291, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:27'),
(1, 292, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:27'),
(1, 293, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:27'),
(1, 294, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:27'),
(1, 295, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:27'),
(1, 296, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:28'),
(1, 297, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:28'),
(1, 298, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:28'),
(1, 299, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:28'),
(1, 300, 1, '2025-10-26 16:55:28', '2025-12-16 09:22:28'),
(1, 301, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:28'),
(1, 302, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:28'),
(1, 303, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:28'),
(1, 304, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:28'),
(1, 305, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:29'),
(1, 306, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:29'),
(1, 307, 1, '2025-10-26 16:55:29', '2025-12-16 09:22:29'),
(1, 308, 1, '2025-10-26 16:55:30', '2025-12-16 09:22:29'),
(1, 309, 1, '2025-10-26 16:55:30', '2025-12-16 09:22:29'),
(1, 310, 1, '2025-10-26 16:55:30', '2025-12-16 09:22:29'),
(1, 311, 1, '2025-10-26 16:55:30', '2025-12-16 09:22:29'),
(1, 312, 1, '2025-10-26 16:55:30', '2025-12-16 09:22:29'),
(1, 313, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:29'),
(1, 314, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:29'),
(1, 315, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:29'),
(1, 316, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:29'),
(1, 317, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:30'),
(1, 318, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:30'),
(1, 319, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:30'),
(1, 320, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:30'),
(1, 321, 1, '2025-10-26 16:55:31', '2025-12-16 09:22:30'),
(1, 322, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:30'),
(1, 323, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:30'),
(1, 324, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:30'),
(1, 325, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:31'),
(1, 326, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:31'),
(1, 328, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:31'),
(1, 329, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:31'),
(1, 330, 1, '2025-10-26 16:55:32', '2025-12-16 09:22:31'),
(1, 331, 1, '2025-10-26 16:55:33', '2025-12-16 09:22:31'),
(1, 332, 1, '2025-10-26 16:55:33', '2025-12-16 09:22:31'),
(1, 333, 1, '2025-10-26 16:55:34', '2025-12-16 09:22:31'),
(1, 334, 1, '2025-10-26 16:55:34', '2025-12-16 09:22:31'),
(1, 335, 1, '2025-10-26 16:55:34', '2025-12-16 09:22:31'),
(1, 336, 1, '2025-10-26 16:55:34', '2025-12-16 09:22:31'),
(1, 337, 1, '2025-10-26 16:55:35', '2025-12-16 09:22:31'),
(1, 338, 1, '2025-10-26 16:55:35', '2025-12-16 09:22:31'),
(1, 339, 1, '2025-10-26 16:55:35', '2025-12-16 09:22:31'),
(1, 340, 1, '2025-10-26 16:55:35', '2025-12-16 09:22:32'),
(1, 341, 1, '2025-10-26 16:55:35', '2025-12-16 09:22:32'),
(1, 342, 1, '2025-10-26 16:55:36', '2025-12-16 09:22:32'),
(1, 343, 1, '2025-10-26 16:55:36', '2025-12-16 09:22:32'),
(1, 344, 1, '2025-10-26 16:55:36', '2025-12-16 09:22:32'),
(1, 345, 1, '2025-10-26 16:55:36', '2025-12-16 09:22:32'),
(1, 346, 1, '2025-10-26 16:55:37', '2025-12-16 09:22:32'),
(1, 347, 1, '2025-10-26 16:55:37', '2025-12-16 09:22:32'),
(1, 348, 1, '2025-10-26 16:55:37', '2025-12-16 09:22:32'),
(1, 349, 1, '2025-10-26 16:55:37', '2025-12-16 09:22:33'),
(1, 350, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:33'),
(1, 351, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:33'),
(1, 352, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:33'),
(1, 353, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:33'),
(1, 354, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:34'),
(1, 355, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:34'),
(1, 356, 1, '2025-10-26 16:55:38', '2025-12-16 09:22:34'),
(1, 358, 1, '2025-11-06 18:36:34', '2025-12-16 09:22:34'),
(1, 359, 1, '2025-11-06 18:36:34', '2025-12-16 09:22:34'),
(1, 360, 1, '2025-11-06 18:36:35', '2025-12-16 09:22:34'),
(1, 361, 1, '2025-11-06 18:36:35', '2025-12-16 09:22:34'),
(1, 362, 1, '2025-11-06 18:36:35', '2025-12-16 09:22:34'),
(1, 363, 1, '2025-11-06 18:36:36', '2025-12-16 09:22:35'),
(1, 364, 1, '2025-11-06 18:36:36', '2025-12-16 09:22:35'),
(1, 365, 1, '2025-11-06 18:36:36', '2025-12-16 09:22:35'),
(1, 366, 1, '2025-11-06 18:36:36', '2025-12-16 09:22:35'),
(1, 367, 1, '2025-11-06 18:36:36', '2025-12-16 09:22:35'),
(1, 368, 1, '2025-11-06 18:36:37', '2025-12-16 09:22:35'),
(1, 369, 1, '2025-11-06 18:36:37', '2025-12-16 09:22:36'),
(1, 370, 1, '2025-11-06 18:36:37', '2025-12-16 09:22:36'),
(1, 371, 1, '2025-11-06 18:36:37', '2025-12-16 09:22:36'),
(1, 372, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:36'),
(1, 373, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 374, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 375, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 376, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 377, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 378, 1, '2025-11-06 18:36:38', '2025-12-16 09:22:37'),
(1, 379, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:38'),
(1, 380, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:38'),
(1, 381, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:38'),
(1, 382, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:39'),
(1, 383, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:40'),
(1, 384, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:40'),
(1, 385, 1, '2025-11-06 18:36:39', '2025-12-16 09:22:40'),
(1, 386, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:41'),
(1, 387, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:41'),
(1, 388, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:41'),
(1, 389, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:42'),
(1, 390, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:42'),
(1, 391, 1, '2025-11-06 18:36:40', '2025-12-16 09:22:42'),
(1, 392, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:43'),
(1, 393, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:43'),
(1, 394, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:43'),
(1, 395, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:44'),
(1, 396, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:45'),
(1, 397, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:45'),
(1, 398, 1, '2025-11-06 18:36:41', '2025-12-16 09:22:46'),
(1, 399, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:46'),
(1, 400, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:47'),
(1, 401, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:47'),
(1, 402, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:47'),
(1, 403, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:48'),
(1, 404, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:48'),
(1, 405, 1, '2025-11-06 18:36:42', '2025-12-16 09:22:48'),
(1, 406, 1, '2025-11-06 18:36:43', '2025-12-16 09:22:48'),
(1, 407, 1, '2025-11-06 18:36:43', '2025-12-16 09:22:48'),
(1, 408, 1, '2025-11-06 18:36:43', '2025-12-16 09:22:48'),
(1, 411, 1, '2025-11-06 18:36:43', '2025-12-16 09:22:49'),
(1, 412, 1, '2025-11-06 18:36:43', '2025-12-16 09:22:49'),
(1, 413, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:49'),
(1, 414, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:49'),
(1, 415, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:49'),
(1, 416, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:50'),
(1, 417, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:50'),
(1, 418, 1, '2025-11-06 18:36:44', '2025-12-16 09:22:50'),
(1, 419, 1, '2025-11-06 18:36:45', '2025-12-16 09:22:50'),
(1, 420, 1, '2025-11-06 18:36:45', '2025-12-16 09:22:50'),
(1, 421, 1, '2025-11-06 18:36:45', '2025-12-16 09:22:50'),
(1, 486, 1, '2025-11-07 17:38:44', '2025-12-16 09:22:51'),
(1, 487, 1, '2025-11-07 17:38:45', '2025-12-16 09:22:51'),
(1, 488, 1, '2025-11-07 17:38:45', '2025-12-16 09:22:51'),
(1, 489, 1, '2025-11-07 17:38:45', '2025-12-16 09:22:51'),
(1, 490, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:51'),
(1, 491, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:51'),
(1, 492, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:51'),
(1, 493, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:51'),
(1, 494, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:51'),
(1, 495, 1, '2025-11-07 17:38:46', '2025-12-16 09:22:52'),
(1, 496, 1, '2025-11-07 17:38:47', '2025-12-16 09:22:52'),
(1, 497, 1, '2025-11-07 17:38:47', '2025-12-16 09:22:52'),
(1, 498, 1, '2025-11-07 17:38:47', '2025-12-16 09:22:52'),
(1, 499, 1, '2025-11-07 17:38:47', '2025-12-16 09:22:52'),
(1, 500, 1, '2025-11-07 17:38:47', '2025-12-16 09:22:52'),
(1, 501, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:52'),
(1, 502, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:52'),
(1, 503, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 504, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 505, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 506, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 507, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 508, 1, '2025-11-07 17:38:48', '2025-12-16 09:22:53'),
(1, 509, 1, '2025-11-07 17:38:49', '2025-12-16 09:22:53'),
(1, 510, 1, '2025-11-07 17:38:49', '2025-12-16 09:22:54'),
(1, 511, 1, '2025-11-07 17:38:49', '2025-12-16 09:22:54'),
(1, 512, 1, '2025-11-07 17:38:49', '2025-12-16 09:22:54'),
(1, 513, 1, '2025-11-07 17:38:49', '2025-12-16 09:22:54'),
(1, 514, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:54'),
(1, 515, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 516, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 517, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 530, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 531, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 532, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 533, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:55'),
(1, 534, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:56'),
(1, 535, 1, '2025-11-07 17:38:50', '2025-12-16 09:22:56'),
(1, 536, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 537, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 538, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 539, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 540, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 541, 1, '2025-11-07 17:38:51', '2025-12-16 09:22:56'),
(1, 543, 1, '2025-11-11 09:05:24', '2025-12-16 09:22:56'),
(1, 544, 1, '2025-11-11 09:05:24', '2025-12-16 09:22:56'),
(1, 545, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:57'),
(1, 546, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:57'),
(1, 547, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:57'),
(1, 548, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:58'),
(1, 549, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:58'),
(1, 550, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:59'),
(1, 551, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:59'),
(1, 552, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:59'),
(1, 553, 1, '2025-11-11 09:05:25', '2025-12-16 09:22:59'),
(1, 554, 1, '2025-11-11 09:05:25', '2025-12-16 09:23:00'),
(1, 555, 1, '2025-11-11 09:05:25', '2025-12-16 09:23:00'),
(1, 556, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:01'),
(1, 557, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:01'),
(1, 558, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:01'),
(1, 559, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:01'),
(1, 560, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:02'),
(1, 561, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:02'),
(1, 562, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:03'),
(1, 563, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:03'),
(1, 564, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:04'),
(1, 565, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:04'),
(1, 566, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:05'),
(1, 567, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:05'),
(1, 568, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:05'),
(1, 569, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:05'),
(1, 570, 1, '2025-11-11 09:05:26', '2025-12-16 09:23:05'),
(1, 571, 1, '2025-11-11 09:05:27', '2025-12-16 09:23:05'),
(1, 572, 1, '2025-11-11 09:05:27', '2025-12-16 09:23:05'),
(1, 573, 1, '2025-11-11 09:05:27', '2025-12-16 09:23:05'),
(1, 574, 1, '2025-11-12 14:16:17', '2025-12-16 09:23:06'),
(1, 575, 1, '2025-11-12 18:49:26', '2025-12-16 09:23:06'),
(1, 576, 1, '2025-11-12 18:49:26', '2025-12-16 09:23:07'),
(1, 577, 1, '2025-11-12 18:49:27', '2025-12-16 09:23:07'),
(1, 578, 1, '2025-11-12 18:49:27', '2025-12-16 09:23:08'),
(1, 579, 1, '2025-11-21 14:34:11', '2025-12-16 09:23:08'),
(1, 580, 1, '2025-11-21 14:34:11', '2025-12-16 09:23:08'),
(1, 581, 1, '2025-11-21 14:34:12', '2025-12-16 09:23:08'),
(1, 582, 1, '2025-11-21 14:34:12', '2025-12-16 09:23:09'),
(1, 583, 1, '2025-11-21 14:34:12', '2025-12-16 09:23:09'),
(1, 584, 1, '2025-11-21 14:34:12', '2025-12-16 09:23:09'),
(1, 585, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:10'),
(1, 586, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:10'),
(1, 587, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:10'),
(1, 588, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:10'),
(1, 589, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:11'),
(1, 590, 1, '2025-11-21 14:34:13', '2025-12-16 09:23:11'),
(1, 591, 1, '2025-11-21 14:34:14', '2025-12-16 09:23:11'),
(1, 592, 1, '2025-11-21 14:34:14', '2025-12-16 09:23:12'),
(1, 593, 1, '2025-11-21 14:34:14', '2025-12-16 09:23:13'),
(1, 594, 1, '2025-11-21 14:34:14', '2025-12-16 09:23:13'),
(1, 595, 1, '2025-11-21 14:34:14', '2025-12-16 09:23:13'),
(1, 596, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:14'),
(1, 597, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:14'),
(1, 598, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:14'),
(1, 599, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:14'),
(1, 600, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:15'),
(1, 601, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:15'),
(1, 602, 1, '2025-11-21 14:34:15', '2025-12-16 09:23:15'),
(1, 603, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:15'),
(1, 604, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:16'),
(1, 605, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:16'),
(1, 606, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:16'),
(1, 607, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:16'),
(1, 608, 1, '2025-11-21 14:34:16', '2025-12-16 09:23:16'),
(1, 609, 1, '2025-11-21 14:34:17', '2025-12-16 09:23:16'),
(1, 610, 1, '2025-11-21 14:34:17', '2025-12-16 09:23:16'),
(1, 611, 1, '2025-11-21 14:34:17', '2025-12-16 09:23:16'),
(1, 612, 1, '2025-11-21 14:34:18', '2025-12-16 09:23:16'),
(1, 613, 1, '2025-11-21 14:34:18', '2025-12-16 09:23:16'),
(1, 614, 1, '2025-11-21 14:34:19', '2025-12-16 09:23:16'),
(1, 615, 1, '2025-11-21 14:34:19', '2025-12-16 09:23:16'),
(1, 616, 1, '2025-11-21 14:34:19', '2025-12-16 09:23:17'),
(1, 617, 1, '2025-11-21 14:34:19', '2025-12-16 09:23:17'),
(1, 618, 1, '2025-11-21 14:34:19', '2025-12-16 09:23:17'),
(1, 619, 1, '2025-11-21 14:34:20', '2025-12-16 09:23:17'),
(1, 620, 1, '2025-11-21 14:34:20', '2025-12-16 09:23:17'),
(1, 621, 1, '2025-11-21 14:34:20', '2025-12-16 09:23:17'),
(1, 626, 1, '2025-11-21 14:34:20', '2025-12-16 09:23:18'),
(1, 649, 1, '2025-11-21 14:34:25', '2025-12-16 09:23:18'),
(1, 650, 1, '2025-11-21 14:34:25', '2025-12-16 09:23:18'),
(1, 651, 1, '2025-11-21 14:34:25', '2025-12-16 09:23:18'),
(1, 652, 1, '2025-11-21 14:34:25', '2025-12-16 09:23:18'),
(1, 653, 1, '2025-11-21 14:34:25', '2025-12-16 09:23:18'),
(1, 654, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:18'),
(1, 655, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:19'),
(1, 656, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:19'),
(1, 657, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:19'),
(1, 658, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:19'),
(1, 659, 1, '2025-11-21 14:34:26', '2025-12-16 09:23:19'),
(1, 660, 1, '2025-11-21 14:34:27', '2025-12-16 09:23:19'),
(1, 661, 1, '2025-11-21 14:34:27', '2025-12-16 09:23:19'),
(1, 662, 1, '2025-11-21 14:34:27', '2025-12-16 09:23:20'),
(1, 663, 1, '2025-11-21 14:34:28', '2025-12-16 09:23:20'),
(1, 664, 1, '2025-11-21 14:34:28', '2025-12-16 09:23:20'),
(1, 665, 1, '2025-11-21 14:34:28', '2025-12-16 09:23:20'),
(1, 666, 1, '2025-11-21 14:34:28', '2025-12-16 09:23:20'),
(1, 667, 1, '2025-11-21 14:34:28', '2025-12-16 09:23:20'),
(1, 668, 1, '2025-11-22 17:14:14', '2025-12-16 09:23:21'),
(1, 669, 1, '2025-11-22 17:14:14', '2025-12-16 09:23:21'),
(1, 670, 1, '2025-11-22 17:14:15', '2025-12-16 09:23:21'),
(1, 671, 1, '2025-11-22 17:14:15', '2025-12-16 09:23:21'),
(1, 672, 1, '2025-11-22 17:14:15', '2025-12-16 09:23:21'),
(1, 673, 1, '2025-12-08 06:43:39', '2025-12-16 09:23:21'),
(1, 674, 1, '2025-12-08 06:43:39', '2025-12-16 09:23:21'),
(1, 675, 1, '2025-12-08 06:43:39', '2025-12-16 09:23:21'),
(1, 676, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:21'),
(1, 677, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:21'),
(1, 678, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 679, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 680, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 681, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 682, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 683, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 684, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 685, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:22'),
(1, 686, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:23'),
(1, 687, 1, '2025-12-08 06:43:40', '2025-12-16 09:23:23'),
(1, 688, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 689, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 690, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 691, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 692, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 693, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:23'),
(1, 694, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:24'),
(1, 695, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:24'),
(1, 696, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:24'),
(1, 697, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:24'),
(1, 698, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:25'),
(1, 699, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:25'),
(1, 700, 1, '2025-12-08 06:43:41', '2025-12-16 09:23:25'),
(1, 701, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:25'),
(1, 702, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:25'),
(1, 703, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 704, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 705, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 706, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 707, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 708, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 709, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 710, 1, '2025-12-08 06:43:42', '2025-12-16 09:23:26'),
(1, 711, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 712, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 713, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 714, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 715, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 716, 1, '2025-12-08 06:43:43', '2025-12-16 09:23:26'),
(1, 717, 1, '2025-12-11 16:18:05', '2025-12-16 09:23:26'),
(1, 718, 1, '2025-12-11 16:18:05', '2025-12-16 09:23:26'),
(1, 719, 1, '2025-12-11 16:18:06', '2025-12-16 09:23:26'),
(1, 720, 1, '2025-12-11 16:18:06', '2025-12-16 09:23:27'),
(1, 721, 1, '2025-12-11 16:18:06', '2025-12-16 09:23:27'),
(1, 722, 1, '2025-12-11 16:18:07', '2025-12-16 09:23:27'),
(1, 723, 1, '2025-12-11 16:18:07', '2025-12-16 09:23:27'),
(1, 724, 1, '2025-12-11 16:18:07', '2025-12-16 09:23:27'),
(1, 725, 1, '2025-12-11 16:18:07', '2025-12-16 09:23:27'),
(1, 726, 1, '2025-12-11 16:18:08', '2025-12-16 09:23:27'),
(1, 727, 1, '2025-12-11 16:18:08', '2025-12-16 09:23:27'),
(1, 728, 1, '2025-12-11 16:18:08', '2025-12-16 09:23:27'),
(1, 729, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:27'),
(1, 730, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:28'),
(1, 731, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:28'),
(1, 732, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:28'),
(1, 733, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:28'),
(1, 734, 1, '2025-12-11 16:18:09', '2025-12-16 09:23:28'),
(1, 735, 1, '2025-12-11 16:18:10', '2025-12-16 09:23:28'),
(1, 736, 1, '2025-12-11 16:18:10', '2025-12-16 09:23:28'),
(1, 737, 1, '2025-12-11 16:18:10', '2025-12-16 09:23:29'),
(1, 738, 1, '2025-12-11 16:18:10', '2025-12-16 09:23:29'),
(1, 739, 1, '2025-12-11 16:18:10', '2025-12-16 09:23:29'),
(1, 740, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 741, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 742, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 743, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 744, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 745, 1, '2025-12-11 16:18:11', '2025-12-16 09:23:29'),
(1, 746, 1, '2025-12-11 16:18:12', '2025-12-16 09:23:29'),
(1, 747, 1, '2025-12-11 16:18:12', '2025-12-16 09:23:30'),
(1, 748, 1, '2025-12-11 16:18:12', '2025-12-16 09:23:30'),
(1, 749, 1, '2025-12-11 16:18:12', '2025-12-16 09:23:30'),
(1, 750, 1, '2025-12-11 16:18:12', '2025-12-16 09:23:30'),
(1, 751, 1, '2025-12-11 16:18:13', '2025-12-16 09:23:30'),
(1, 752, 1, '2025-12-11 14:24:01', '2025-12-16 09:23:30'),
(1, 753, 1, '2025-12-11 14:24:01', '2025-12-16 09:23:30'),
(1, 754, 1, '2025-12-11 14:24:01', '2025-12-16 09:23:30'),
(1, 755, 1, '2025-12-11 14:24:01', '2025-12-16 09:23:30'),
(1, 875, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 876, 1, '2026-02-21 20:38:23', '2026-02-21 20:38:23'),
(1, 877, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 878, 1, '2026-02-21 20:38:23', '2026-02-21 20:38:23'),
(1, 879, 1, '2026-02-21 20:38:28', '2026-02-21 20:38:28'),
(1, 880, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 881, 1, '2026-02-21 20:38:28', '2026-02-21 20:38:28'),
(1, 882, 1, '2026-02-21 20:38:28', '2026-02-21 20:38:28'),
(1, 883, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 884, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 885, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 886, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 887, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 888, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 889, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 890, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 891, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 892, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 893, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 894, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 895, 1, '2026-02-21 20:38:23', '2026-02-21 20:38:23'),
(1, 896, 1, '2026-02-21 20:38:22', '2026-02-21 20:38:22'),
(1, 897, 1, '2026-02-21 20:38:22', '2026-02-21 20:38:22'),
(1, 898, 1, '2026-02-21 20:38:22', '2026-02-21 20:38:22'),
(1, 899, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 900, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 901, 1, '2026-02-21 20:38:27', '2026-02-21 20:38:27'),
(1, 902, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 903, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 904, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 905, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 906, 1, '2026-02-21 20:38:26', '2026-02-21 20:38:26'),
(1, 907, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(1, 908, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 909, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(1, 910, 1, '2026-02-21 20:38:24', '2026-02-21 20:38:24'),
(1, 911, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(1, 912, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(1, 913, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(1, 914, 1, '2026-02-21 20:38:25', '2026-02-21 20:38:25'),
(2, 199, 1, NULL, NULL),
(8, 199, 1, NULL, NULL),
(16, 790, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 791, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 792, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 793, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 794, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 795, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 796, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 797, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 798, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 799, 1, '2026-01-12 14:16:43', '2026-01-12 14:16:43'),
(16, 800, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 801, 1, '2026-01-12 14:16:43', '2026-01-12 14:16:43'),
(16, 802, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 803, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 804, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 805, 1, '2026-01-12 14:16:44', '2026-01-12 14:16:44'),
(16, 806, 1, '2026-01-12 14:16:43', '2026-01-12 14:16:43'),
(16, 807, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 808, 1, '2026-01-12 14:16:43', '2026-01-12 14:16:43'),
(16, 809, 1, '2026-01-12 14:16:43', '2026-01-12 14:16:43'),
(16, 810, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 811, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 812, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 813, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 814, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 815, 1, '2026-01-12 14:16:41', '2026-01-12 14:16:41'),
(16, 816, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 817, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 818, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 819, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 820, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 821, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42'),
(16, 822, 1, '2026-01-12 14:16:42', '2026-01-12 14:16:42');

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

--
-- Table structure for table `user_role`
--

CREATE TABLE `user_role` (
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_role`
--

INSERT INTO `user_role` (`user_id`, `role_id`) VALUES
(1, 1),
(2, 2),
(3, 7),
(6, 9),
(8, 2),
(9, 10),
(10, 11),
(11, 12),
(12, 13),
(14, 72),
(15, 73),
(16, 74),
(17, 76),
(18, 77),
(21, 78);

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

--
-- Table structure for table `variation_orders`
--

CREATE TABLE `variation_orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `contract_id` bigint(20) UNSIGNED NOT NULL,
  `number` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `date` date NOT NULL,
  `total_amount` decimal(15,2) NOT NULL,
  `type` enum('addition','deduction') NOT NULL DEFAULT 'addition',
  `reason` text DEFAULT NULL,
  `status` enum('draft','submitted','approved','rejected') NOT NULL DEFAULT 'draft',
  `notes` text DEFAULT NULL,
  `attachment` varchar(255) DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variation_orders`
--

INSERT INTO `variation_orders` (`id`, `company_id`, `contract_id`, `number`, `title`, `description`, `date`, `total_amount`, `type`, `reason`, `status`, `notes`, `attachment`, `created_by`, `approved_by`, `approved_at`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 11, 7, '1', '1', '1', '2026-02-23', 0.00, 'addition', NULL, 'approved', '1', NULL, 9, 9, '2026-02-23 08:03:59', '2026-02-23 08:03:59', '2026-02-23 08:03:59', NULL),
(2, 11, 7, '111', '111', '11', '2026-02-23', 0.00, 'addition', NULL, 'submitted', '11', NULL, 9, NULL, NULL, '2026-02-23 08:11:05', '2026-02-23 08:11:05', NULL),
(3, 11, 7, '23', '33', '333', '2026-02-23', 100.00, 'addition', '33', 'submitted', '33', NULL, 9, NULL, NULL, '2026-02-23 08:33:48', '2026-02-28 01:45:48', NULL),
(4, 11, 7, '12', '2222', '22', '2026-02-28', 10000.00, 'addition', '22', 'submitted', NULL, NULL, 9, NULL, NULL, '2026-02-28 16:45:28', '2026-02-28 16:59:19', NULL);

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

--
-- Table structure for table `variation_order_items`
--

CREATE TABLE `variation_order_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `variation_order_id` bigint(20) UNSIGNED NOT NULL,
  `contract_item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `item_code` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `unit` varchar(255) NOT NULL,
  `unit_price` decimal(15,2) NOT NULL,
  `total_price` decimal(15,2) NOT NULL,
  `action_type` enum('add','modify','delete') NOT NULL DEFAULT 'add',
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variation_order_items`
--

INSERT INTO `variation_order_items` (`id`, `company_id`, `variation_order_id`, `contract_item_id`, `item_code`, `description`, `quantity`, `unit`, `unit_price`, `total_price`, `action_type`, `notes`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 11, 3, 11, 'ITEM-1771836067', 'بند جديد مضاف', 10.00, 'متر', 10.00, 100.00, 'add', NULL, '2026-02-28 01:45:48', '2026-02-28 01:45:48', NULL),
(2, 11, 4, NULL, 'VO-1772297958-1681', 'بند جديد', 100.00, 'متر', 100.00, 10000.00, 'add', NULL, '2026-02-28 16:59:18', '2026-02-28 16:59:18', NULL);

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

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

CREATE TABLE `vehicles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `transport_company_id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_type_id` bigint(20) UNSIGNED NOT NULL,
  `registration_number` varchar(50) NOT NULL,
  `chassis_number` varchar(100) NOT NULL,
  `engine_number` varchar(100) NOT NULL,
  `plate_number` varchar(50) NOT NULL,
  `color` varchar(50) DEFAULT NULL,
  `brand` varchar(100) NOT NULL,
  `model` varchar(100) NOT NULL,
  `year` year(4) NOT NULL,
  `capacity_seats` int(11) NOT NULL,
  `capacity_weight` int(11) DEFAULT NULL,
  `purchase_date` date NOT NULL,
  `acquisition_cost` decimal(12,2) NOT NULL,
  `current_value` decimal(12,2) NOT NULL,
  `last_maintenance_date` date DEFAULT NULL,
  `next_maintenance_date` date DEFAULT NULL,
  `mileage` int(11) NOT NULL DEFAULT 0,
  `fuel_consumption_per_km` decimal(5,2) DEFAULT NULL,
  `registration_expiry` date DEFAULT NULL,
  `inspection_expiry` date DEFAULT NULL,
  `insurance_policy_number` varchar(100) DEFAULT NULL,
  `insurance_expiry` date DEFAULT NULL,
  `driver_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` enum('active','inactive','maintenance','retired') NOT NULL DEFAULT 'active',
  `is_available` tinyint(1) NOT NULL DEFAULT 1,
  `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 `vehicles`
--

INSERT INTO `vehicles` (`id`, `transport_company_id`, `vehicle_type_id`, `registration_number`, `chassis_number`, `engine_number`, `plate_number`, `color`, `brand`, `model`, `year`, `capacity_seats`, `capacity_weight`, `purchase_date`, `acquisition_cost`, `current_value`, `last_maintenance_date`, `next_maintenance_date`, `mileage`, `fuel_consumption_per_km`, `registration_expiry`, `inspection_expiry`, `insurance_policy_number`, `insurance_expiry`, `driver_id`, `status`, `is_available`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'REG-001', 'CHASSIS-001', 'ENGINE-001', 'KS-0001', 'أسود', 'مرسيدس', 'موديل 2021', '2021', 40, NULL, '2024-02-21', 500000.00, 400000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 'active', 1, NULL, '2026-02-21 08:27:35', '2026-02-21 08:27:35'),
(2, 1, 2, 'REG-002', 'CHASSIS-002', 'ENGINE-002', 'KS-0002', 'أبيض', 'هينو', 'موديل 2022', '2022', 40, NULL, '2024-02-21', 500000.00, 400000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 'active', 1, NULL, '2026-02-21 08:27:36', '2026-02-21 08:27:36'),
(3, 1, 2, 'REG-003', 'CHASSIS-003', 'ENGINE-003', 'KS-0003', 'أحمر', 'هينو', 'موديل 2023', '2023', 40, NULL, '2024-02-21', 500000.00, 400000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 'active', 1, NULL, '2026-02-21 08:27:36', '2026-02-21 08:27:36'),
(4, 1, 1, 'REG-004', 'CHASSIS-004', 'ENGINE-004', 'KS-0004', 'أزرق', 'مان', 'موديل 2024', '2024', 40, NULL, '2024-02-21', 500000.00, 400000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 'active', 1, NULL, '2026-02-21 08:27:36', '2026-02-21 08:27:36'),
(5, 1, 3, 'REG-005', 'CHASSIS-005', 'ENGINE-005', 'KS-0005', 'فضي', 'مرسيدس', 'موديل 2025', '2025', 40, NULL, '2024-02-21', 500000.00, 400000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 'active', 1, NULL, '2026-02-21 08:27:36', '2026-02-21 08:27:36');

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

--
-- Table structure for table `vehicle_maintenance_schedules`
--

CREATE TABLE `vehicle_maintenance_schedules` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vehicle_id` bigint(20) UNSIGNED NOT NULL,
  `maintenance_type` varchar(100) NOT NULL,
  `scheduled_date` date NOT NULL,
  `completed_date` date DEFAULT NULL,
  `maintenance_cost` decimal(12,2) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `performed_by` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `mileage_at_maintenance` int(11) DEFAULT NULL,
  `next_maintenance_due` date DEFAULT NULL,
  `status` enum('pending','in_progress','completed','cancelled') NOT NULL DEFAULT 'pending',
  `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_types`
--

CREATE TABLE `vehicle_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(50) NOT NULL,
  `capacity` int(11) NOT NULL DEFAULT 0,
  `type_category` varchar(100) DEFAULT NULL,
  `fuel_type` varchar(50) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `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_types`
--

INSERT INTO `vehicle_types` (`id`, `company_id`, `name`, `code`, `capacity`, `type_category`, `fuel_type`, `description`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 1, 'باص صغير', 'VT-01', 20, 'small_bus', 'diesel', NULL, 1, '2026-02-21 08:27:34', '2026-02-21 08:27:34'),
(2, 1, 'باص متوسط', 'VT-02', 40, 'medium_bus', 'diesel', NULL, 1, '2026-02-21 08:27:34', '2026-02-21 08:27:34'),
(3, 1, 'باص كبير', 'VT-03', 55, 'large_bus', 'diesel', NULL, 1, '2026-02-21 08:27:34', '2026-02-21 08:27:34'),
(4, 1, 'سيارة ركاب', 'VT-04', 5, 'car', 'petrol', NULL, 1, '2026-02-21 08:27:35', '2026-02-21 08:27:35');

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

--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `chart_of_account_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `manager` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouses`
--

INSERT INTO `warehouses` (`id`, `company_id`, `chart_of_account_id`, `name`, `code`, `address`, `phone`, `manager`, `is_active`, `notes`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 49, 'مخزون موقع (مواد تحت التشغيل)', '1', NULL, NULL, '1', 1, NULL, '2025-11-19 22:50:46', '2025-11-19 22:50:46', NULL),
(2, 1, 50, 'المخزن الرئيسي', NULL, NULL, NULL, NULL, 1, NULL, '2025-11-19 22:54:26', '2025-11-19 22:54:26', NULL),
(3, 10, 157, 'المخزن الرئيسي', '1', NULL, '1', '1', 1, NULL, '2025-12-01 09:01:09', '2025-12-01 09:01:09', NULL),
(4, 11, 209, 'المخزن الرئيسي', '5', NULL, '1111111', NULL, 1, NULL, '2025-12-02 14:45:33', '2025-12-02 14:45:33', NULL),
(5, 11, 186, 'مخزون موقع (مواد تحت التشغيل)', '6', NULL, NULL, NULL, 1, NULL, '2025-12-02 14:48:21', '2025-12-02 15:15:40', NULL),
(6, 11, 329, 'مخزن منتج تام رقم 1', NULL, NULL, NULL, NULL, 1, NULL, '2025-12-23 08:01:06', '2025-12-23 08:01:30', NULL),
(7, 11, 330, 'مخزن خامات للتصنيع', NULL, NULL, NULL, NULL, 1, NULL, '2025-12-23 08:02:02', '2025-12-23 08:02:02', NULL),
(8, 16, 361, 'المخزن الرئيسي', '1', '1', '1', '1', 1, NULL, '2026-01-04 15:09:28', '2026-01-04 15:09:28', NULL),
(9, 17, 416, 'المخزن الرئيسي', '1', NULL, NULL, NULL, 1, NULL, '2026-01-10 08:09:08', '2026-01-10 08:09:08', NULL),
(10, 18, 480, 'المخزن الرئيسي', NULL, NULL, NULL, NULL, 1, NULL, '2026-01-20 04:34:54', '2026-01-20 04:35:08', NULL);

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

--
-- Table structure for table `warehouse_managers`
--

CREATE TABLE `warehouse_managers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `warehouse_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `is_primary` tinyint(1) 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 `warehouse_managers`
--

INSERT INTO `warehouse_managers` (`id`, `warehouse_id`, `user_id`, `is_primary`, `created_at`, `updated_at`) VALUES
(1, 3, 6, 1, '2025-12-01 10:12:17', '2025-12-01 10:12:17'),
(2, 4, 9, 1, '2025-12-02 14:45:33', '2025-12-02 14:45:33'),
(3, 5, 9, 1, '2025-12-02 15:15:40', '2025-12-02 15:15:40'),
(4, 6, 9, 1, '2025-12-23 08:01:30', '2025-12-23 08:01:30'),
(5, 7, 9, 1, '2025-12-23 08:02:02', '2025-12-23 08:02:02'),
(6, 8, 15, 1, '2026-01-04 15:09:28', '2026-01-04 15:09:28'),
(7, 9, 16, 1, '2026-01-10 08:09:08', '2026-01-10 08:09:08'),
(8, 10, 17, 1, '2026-01-20 04:35:08', '2026-01-20 04:35:08');

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

--
-- Table structure for table `work_in_progresses`
--

CREATE TABLE `work_in_progresses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `batch_number` varchar(255) NOT NULL,
  `quantity` int(11) NOT NULL,
  `status` enum('started','in_progress','paused','completed') NOT NULL DEFAULT 'started',
  `started_at` datetime NOT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `deleted_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 `work_stations`
--

CREATE TABLE `work_stations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `production_line_id` bigint(20) UNSIGNED NOT NULL,
  `code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `station_number` int(11) NOT NULL,
  `process_type` varchar(255) NOT NULL,
  `cycle_time_seconds` int(11) NOT NULL,
  `capacity` decimal(12,2) NOT NULL,
  `sequence_order` int(11) NOT NULL,
  `required_skills` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`required_skills`)),
  `equipment_needed` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`equipment_needed`)),
  `status` enum('active','inactive','maintenance') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `zakat_calculations`
--

CREATE TABLE `zakat_calculations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `fiscal_year_id` bigint(20) UNSIGNED DEFAULT NULL,
  `calculation_date` date NOT NULL,
  `zakat_base` decimal(15,2) NOT NULL DEFAULT 0.00,
  `zakat_rate` decimal(5,2) NOT NULL DEFAULT 2.50,
  `zakat_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `zatca_operations`
--

CREATE TABLE `zatca_operations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED NOT NULL,
  `operation_type` varchar(255) NOT NULL,
  `status` enum('pending','in_progress','success','failed','retry') NOT NULL DEFAULT 'pending',
  `attempt_number` int(11) NOT NULL DEFAULT 1,
  `max_attempts` int(11) NOT NULL DEFAULT 3,
  `request_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`request_data`)),
  `response_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_data`)),
  `error_type` varchar(255) DEFAULT NULL,
  `error_message` text DEFAULT NULL,
  `error_stack` text DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `execution_time` int(11) DEFAULT NULL,
  `next_retry_at` datetime DEFAULT NULL,
  `reference_id` varchar(255) DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `accounting_periods`
--
ALTER TABLE `accounting_periods`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `accounting_periods_fiscal_year_id_name_unique` (`fiscal_year_id`,`name`),
  ADD KEY `accounting_periods_company_id_foreign` (`company_id`);

--
-- Indexes for table `account_balances`
--
ALTER TABLE `account_balances`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `account_balances_unique_index` (`company_id`,`account_id`,`fiscal_year_id`,`accounting_period_id`),
  ADD KEY `account_balances_account_id_foreign` (`account_id`),
  ADD KEY `account_balances_fiscal_year_id_foreign` (`fiscal_year_id`),
  ADD KEY `account_balances_accounting_period_id_foreign` (`accounting_period_id`),
  ADD KEY `account_balances_period_index` (`company_id`,`fiscal_year_id`,`accounting_period_id`);

--
-- Indexes for table `account_categories`
--
ALTER TABLE `account_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `account_categories_company_id_code_unique` (`company_id`,`code`);

--
-- Indexes for table `account_mappings`
--
ALTER TABLE `account_mappings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `account_mappings_company_id_transaction_type_unique` (`company_id`,`transaction_type`),
  ADD KEY `account_mappings_debit_account_id_foreign` (`debit_account_id`),
  ADD KEY `account_mappings_credit_account_id_foreign` (`credit_account_id`),
  ADD KEY `account_mappings_company_id_transaction_type_index` (`company_id`,`transaction_type`);

--
-- Indexes for table `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subject` (`subject_type`,`subject_id`),
  ADD KEY `causer` (`causer_type`,`causer_id`),
  ADD KEY `activity_log_log_name_index` (`log_name`);

--
-- Indexes for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `activity_logs_company_id_foreign` (`company_id`),
  ADD KEY `activity_logs_user_id_foreign` (`user_id`);

--
-- Indexes for table `analytics`
--
ALTER TABLE `analytics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `analytics_company_id_metric_type_index` (`company_id`,`metric_type`);

--
-- Indexes for table `assets`
--
ALTER TABLE `assets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `assets_asset_code_unique` (`asset_code`),
  ADD KEY `assets_company_id_foreign` (`company_id`),
  ADD KEY `assets_asset_category_id_foreign` (`asset_category_id`);

--
-- Indexes for table `asset_categories`
--
ALTER TABLE `asset_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_categories_company_id_foreign` (`company_id`),
  ADD KEY `asset_categories_depreciation_account_id_foreign` (`depreciation_account_id`),
  ADD KEY `asset_categories_accumulated_depreciation_account_id_foreign` (`accumulated_depreciation_account_id`),
  ADD KEY `asset_categories_asset_account_id_foreign` (`asset_account_id`),
  ADD KEY `asset_categories_expense_account_id_foreign` (`expense_account_id`);

--
-- Indexes for table `asset_depreciations`
--
ALTER TABLE `asset_depreciations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_depreciations_company_id_foreign` (`company_id`),
  ADD KEY `asset_depreciations_asset_id_foreign` (`asset_id`),
  ADD KEY `asset_depreciations_journal_entry_id_foreign` (`journal_entry_id`);

--
-- Indexes for table `asset_disposals`
--
ALTER TABLE `asset_disposals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_disposals_company_id_foreign` (`company_id`),
  ADD KEY `asset_disposals_asset_id_foreign` (`asset_id`),
  ADD KEY `asset_disposals_journal_entry_id_foreign` (`journal_entry_id`);

--
-- Indexes for table `asset_maintenances`
--
ALTER TABLE `asset_maintenances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_maintenances_company_id_foreign` (`company_id`),
  ADD KEY `asset_maintenances_asset_id_foreign` (`asset_id`),
  ADD KEY `asset_maintenances_journal_entry_id_foreign` (`journal_entry_id`);

--
-- Indexes for table `attendances`
--
ALTER TABLE `attendances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `attendances_company_id_foreign` (`company_id`);

--
-- Indexes for table `baladi_integrations`
--
ALTER TABLE `baladi_integrations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `baladi_integrations_company_id_foreign` (`company_id`);

--
-- Indexes for table `banks`
--
ALTER TABLE `banks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `banks_company_name_unique` (`company_id`,`name`),
  ADD KEY `banks_company_id_foreign` (`company_id`),
  ADD KEY `banks_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `bank_deposits`
--
ALTER TABLE `bank_deposits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bank_deposits_company_id_foreign` (`company_id`),
  ADD KEY `bank_deposits_bank_account_id_foreign` (`bank_account_id`),
  ADD KEY `bank_deposits_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `bank_deposits_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `bank_deposits_created_by_foreign` (`created_by`),
  ADD KEY `bank_deposits_approved_by_foreign` (`approved_by`),
  ADD KEY `bank_deposits_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `bank_reconciliations`
--
ALTER TABLE `bank_reconciliations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bank_reconciliations_company_id_foreign` (`company_id`),
  ADD KEY `bank_reconciliations_bank_account_id_foreign` (`bank_account_id`),
  ADD KEY `bank_reconciliations_created_by_foreign` (`created_by`),
  ADD KEY `bank_reconciliations_completed_by_foreign` (`completed_by`);

--
-- Indexes for table `bank_reconciliation_items`
--
ALTER TABLE `bank_reconciliation_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bank_reconciliation_items_bank_reconciliation_id_foreign` (`bank_reconciliation_id`),
  ADD KEY `bank_reconciliation_items_reconciled_by_foreign` (`reconciled_by`);

--
-- Indexes for table `bank_withdrawals`
--
ALTER TABLE `bank_withdrawals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bank_withdrawals_company_id_foreign` (`company_id`),
  ADD KEY `bank_withdrawals_bank_account_id_foreign` (`bank_account_id`),
  ADD KEY `bank_withdrawals_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `bank_withdrawals_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `bank_withdrawals_created_by_foreign` (`created_by`),
  ADD KEY `bank_withdrawals_approved_by_foreign` (`approved_by`),
  ADD KEY `bank_withdrawals_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `bills_of_materials`
--
ALTER TABLE `bills_of_materials`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bills_of_materials_company_id_index` (`company_id`);

--
-- Indexes for table `bom_items`
--
ALTER TABLE `bom_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bom_items_bill_of_material_id_foreign` (`bill_of_material_id`);

--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `bookings_booking_code_unique` (`booking_code`),
  ADD KEY `bookings_pickup_stop_id_foreign` (`pickup_stop_id`),
  ADD KEY `bookings_dropoff_stop_id_foreign` (`dropoff_stop_id`),
  ADD KEY `bookings_transport_company_id_index` (`transport_company_id`),
  ADD KEY `bookings_trip_id_index` (`trip_id`),
  ADD KEY `bookings_passenger_id_index` (`passenger_id`),
  ADD KEY `bookings_booking_status_index` (`booking_status`),
  ADD KEY `bookings_payment_status_index` (`payment_status`);

--
-- Indexes for table `branches`
--
ALTER TABLE `branches`
  ADD PRIMARY KEY (`id`),
  ADD KEY `branches_company_id_foreign` (`company_id`);

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

--
-- Indexes for table `chart_of_accounts`
--
ALTER TABLE `chart_of_accounts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `chart_of_accounts_company_id_code_unique` (`company_id`,`code`),
  ADD KEY `chart_of_accounts_account_category_id_foreign` (`account_category_id`),
  ADD KEY `chart_of_accounts_parent_id_foreign` (`parent_id`),
  ADD KEY `chart_of_accounts_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `checks`
--
ALTER TABLE `checks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `checks_company_id_foreign` (`company_id`),
  ADD KEY `checks_bank_id_foreign` (`bank_id`),
  ADD KEY `checks_bank_account_id_foreign` (`bank_account_id`),
  ADD KEY `checks_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `checks_created_by_foreign` (`created_by`),
  ADD KEY `checks_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `checks_deposited_by_foreign` (`deposited_by`),
  ADD KEY `checks_cashed_by_foreign` (`cashed_by`),
  ADD KEY `checks_returned_by_foreign` (`returned_by`),
  ADD KEY `checks_cancelled_by_foreign` (`cancelled_by`);

--
-- Indexes for table `company_owners`
--
ALTER TABLE `company_owners`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `company_owners_email_unique` (`email`),
  ADD KEY `company_owners_user_id_foreign` (`user_id`),
  ADD KEY `company_owners_company_id_index` (`company_id`),
  ADD KEY `company_owners_email_index` (`email`),
  ADD KEY `company_owners_status_index` (`status`);

--
-- Indexes for table `contracts`
--
ALTER TABLE `contracts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contracts_company_id_number_unique` (`company_id`,`number`),
  ADD KEY `contracts_company_id_foreign` (`company_id`),
  ADD KEY `contracts_project_id_foreign` (`project_id`),
  ADD KEY `contracts_customer_id_foreign` (`customer_id`),
  ADD KEY `contracts_created_by_foreign` (`created_by`);

--
-- Indexes for table `contract_analytics`
--
ALTER TABLE `contract_analytics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contract_analytics_contract_id_foreign` (`contract_id`),
  ADD KEY `contract_analytics_company_id_contract_id_analysis_date_index` (`company_id`,`contract_id`,`analysis_date`);

--
-- Indexes for table `contract_items`
--
ALTER TABLE `contract_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contract_items_company_id_foreign` (`company_id`),
  ADD KEY `contract_items_contract_id_foreign` (`contract_id`);

--
-- Indexes for table `cost_centers`
--
ALTER TABLE `cost_centers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `cost_centers_company_id_code_unique` (`company_id`,`code`),
  ADD UNIQUE KEY `cost_centers_company_code_unique` (`company_id`,`code`),
  ADD UNIQUE KEY `cost_centers_company_name_unique` (`company_id`,`name`),
  ADD KEY `cost_centers_cost_center_type_id_foreign` (`cost_center_type_id`),
  ADD KEY `cost_centers_cost_center_category_id_foreign` (`cost_center_category_id`),
  ADD KEY `cost_centers_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `cost_center_categories`
--
ALTER TABLE `cost_center_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `cost_center_categories_company_id_code_unique` (`company_id`,`code`);

--
-- Indexes for table `cost_center_types`
--
ALTER TABLE `cost_center_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `cost_center_types_company_id_code_unique` (`company_id`,`code`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customers_company_id_foreign` (`company_id`),
  ADD KEY `customers_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `customer_contracts`
--
ALTER TABLE `customer_contracts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_contracts_contract_number_unique` (`contract_number`),
  ADD KEY `customer_contracts_company_id_foreign` (`company_id`),
  ADD KEY `customer_contracts_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `customer_invoices`
--
ALTER TABLE `customer_invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_invoices_invoice_number_company_id_unique` (`invoice_number`,`company_id`),
  ADD UNIQUE KEY `customer_invoices_invoice_sequence_unique` (`invoice_sequence`),
  ADD KEY `customer_invoices_company_id_foreign` (`company_id`),
  ADD KEY `customer_invoices_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_invoices_customer_contract_id_foreign` (`customer_contract_id`),
  ADD KEY `customer_invoices_invoice_sequence_index` (`invoice_sequence`),
  ADD KEY `customer_invoices_zatca_compliance_status_index` (`zatca_compliance_status`);

--
-- Indexes for table `customer_invoice_cost_centers`
--
ALTER TABLE `customer_invoice_cost_centers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_invoice_cost_centers_company_id_foreign` (`company_id`),
  ADD KEY `customer_invoice_cost_centers_customer_invoice_id_foreign` (`customer_invoice_id`),
  ADD KEY `customer_invoice_cost_centers_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `customer_invoice_cost_centers_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `customer_invoice_items`
--
ALTER TABLE `customer_invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_invoice_items_company_id_index` (`company_id`),
  ADD KEY `customer_invoice_items_customer_invoice_id_index` (`customer_invoice_id`),
  ADD KEY `customer_invoice_items_item_id_foreign` (`item_id`),
  ADD KEY `customer_invoice_items_item_unit_id_foreign` (`item_unit_id`);

--
-- Indexes for table `customer_invoice_returns`
--
ALTER TABLE `customer_invoice_returns`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_invoice_returns_return_number_unique` (`return_number`),
  ADD KEY `customer_invoice_returns_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_invoice_returns_company_id_customer_id_index` (`company_id`,`customer_id`),
  ADD KEY `customer_invoice_returns_customer_invoice_id_index` (`customer_invoice_id`);

--
-- Indexes for table `customer_invoice_return_items`
--
ALTER TABLE `customer_invoice_return_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_invoice_return_items_customer_invoice_return_id_index` (`customer_invoice_return_id`),
  ADD KEY `customer_invoice_return_items_customer_invoice_item_id_index` (`customer_invoice_item_id`);

--
-- Indexes for table `customer_payments`
--
ALTER TABLE `customer_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_payments_payment_number_unique` (`payment_number`),
  ADD KEY `customer_payments_company_id_foreign` (`company_id`),
  ADD KEY `customer_payments_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_payments_customer_invoice_id_foreign` (`customer_invoice_id`),
  ADD KEY `customer_payments_treasury_id_foreign` (`treasury_id`),
  ADD KEY `customer_payments_bank_account_id_foreign` (`bank_account_id`);

--
-- Indexes for table `custom_reports`
--
ALTER TABLE `custom_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `custom_reports_company_id_report_type_index` (`company_id`,`report_type`);

--
-- Indexes for table `drivers`
--
ALTER TABLE `drivers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `drivers_license_number_unique` (`license_number`),
  ADD KEY `drivers_transport_company_id_index` (`transport_company_id`),
  ADD KEY `drivers_user_id_index` (`user_id`),
  ADD KEY `drivers_status_index` (`status`);

--
-- Indexes for table `driver_salaries`
--
ALTER TABLE `driver_salaries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `driver_salaries_transport_company_id_foreign` (`transport_company_id`),
  ADD KEY `driver_salaries_calculated_by_foreign` (`calculated_by`),
  ADD KEY `driver_salaries_approved_by_foreign` (`approved_by`),
  ADD KEY `driver_salaries_paid_by_foreign` (`paid_by`),
  ADD KEY `driver_salaries_driver_id_index` (`driver_id`),
  ADD KEY `driver_salaries_status_index` (`status`),
  ADD KEY `driver_salaries_salary_period_start_index` (`salary_period_start`);

--
-- Indexes for table `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `employees_company_id_employee_number_unique` (`company_id`,`employee_number`),
  ADD UNIQUE KEY `employees_email_unique` (`email`),
  ADD KEY `employees_branch_id_foreign` (`branch_id`),
  ADD KEY `employees_user_id_foreign` (`user_id`),
  ADD KEY `employees_employee_number_index` (`employee_number`),
  ADD KEY `employees_salary_structure_id_foreign` (`salary_structure_id`);

--
-- Indexes for table `employee_bonuses`
--
ALTER TABLE `employee_bonuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `employee_bonuses_company_id_foreign` (`company_id`),
  ADD KEY `employee_bonuses_employee_id_foreign` (`employee_id`),
  ADD KEY `employee_bonuses_payroll_id_foreign` (`payroll_id`),
  ADD KEY `employee_bonuses_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `employee_contracts`
--
ALTER TABLE `employee_contracts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `employee_contracts_company_id_contract_number_unique` (`company_id`,`contract_number`),
  ADD KEY `employee_contracts_employee_id_foreign` (`employee_id`),
  ADD KEY `employee_contracts_contract_number_index` (`contract_number`);

--
-- Indexes for table `employee_deductions`
--
ALTER TABLE `employee_deductions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `employee_deductions_company_id_foreign` (`company_id`),
  ADD KEY `employee_deductions_employee_id_foreign` (`employee_id`),
  ADD KEY `employee_deductions_payroll_id_foreign` (`payroll_id`),
  ADD KEY `employee_deductions_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `employee_leaves`
--
ALTER TABLE `employee_leaves`
  ADD PRIMARY KEY (`id`),
  ADD KEY `employee_leaves_company_id_foreign` (`company_id`),
  ADD KEY `employee_leaves_employee_id_foreign` (`employee_id`),
  ADD KEY `employee_leaves_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `employee_loans`
--
ALTER TABLE `employee_loans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `employee_loans_company_id_foreign` (`company_id`),
  ADD KEY `employee_loans_employee_id_foreign` (`employee_id`),
  ADD KEY `employee_loans_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `equipment`
--
ALTER TABLE `equipment`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `equipment_equipment_code_unique` (`equipment_code`),
  ADD KEY `equipment_company_id_foreign` (`company_id`),
  ADD KEY `equipment_equipment_category_id_foreign` (`equipment_category_id`);

--
-- Indexes for table `equipment_categories`
--
ALTER TABLE `equipment_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `equipment_categories_code_unique` (`code`),
  ADD KEY `equipment_categories_company_id_foreign` (`company_id`),
  ADD KEY `equipment_categories_asset_account_id_foreign` (`asset_account_id`),
  ADD KEY `equipment_categories_depreciation_account_id_foreign` (`depreciation_account_id`),
  ADD KEY `equipment_categories_accumulated_depreciation_account_id_foreign` (`accumulated_depreciation_account_id`),
  ADD KEY `equipment_categories_maintenance_expense_account_id_foreign` (`maintenance_expense_account_id`),
  ADD KEY `equipment_categories_fuel_expense_account_id_foreign` (`fuel_expense_account_id`);

--
-- Indexes for table `equipment_fuel`
--
ALTER TABLE `equipment_fuel`
  ADD PRIMARY KEY (`id`),
  ADD KEY `equipment_fuel_company_id_foreign` (`company_id`),
  ADD KEY `equipment_fuel_equipment_id_foreign` (`equipment_id`),
  ADD KEY `equipment_fuel_project_id_foreign` (`project_id`),
  ADD KEY `equipment_fuel_created_by_foreign` (`created_by`);

--
-- Indexes for table `equipment_maintenance`
--
ALTER TABLE `equipment_maintenance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `equipment_maintenance_company_id_foreign` (`company_id`),
  ADD KEY `equipment_maintenance_equipment_id_foreign` (`equipment_id`),
  ADD KEY `equipment_maintenance_created_by_foreign` (`created_by`),
  ADD KEY `equipment_maintenance_updated_by_foreign` (`updated_by`);

--
-- Indexes for table `equipment_schedule`
--
ALTER TABLE `equipment_schedule`
  ADD PRIMARY KEY (`id`),
  ADD KEY `equipment_schedule_company_id_foreign` (`company_id`),
  ADD KEY `equipment_schedule_equipment_id_foreign` (`equipment_id`),
  ADD KEY `equipment_schedule_project_id_foreign` (`project_id`),
  ADD KEY `equipment_schedule_assigned_to_foreign` (`assigned_to`),
  ADD KEY `equipment_schedule_created_by_foreign` (`created_by`);

--
-- Indexes for table `equipment_spare_parts`
--
ALTER TABLE `equipment_spare_parts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `equipment_spare_parts_company_id_foreign` (`company_id`),
  ADD KEY `equipment_spare_parts_equipment_category_id_foreign` (`equipment_category_id`);

--
-- Indexes for table `e_invoices`
--
ALTER TABLE `e_invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `e_invoices_uuid_unique` (`uuid`),
  ADD UNIQUE KEY `e_invoices_invoice_number_unique` (`invoice_number`),
  ADD KEY `e_invoices_company_id_foreign` (`company_id`),
  ADD KEY `e_invoices_customer_id_foreign` (`customer_id`),
  ADD KEY `e_invoices_customer_invoice_id_foreign` (`customer_invoice_id`),
  ADD KEY `e_invoices_company_id_index` (`company_id`),
  ADD KEY `e_invoices_company_id_invoice_sequence_index` (`company_id`,`invoice_sequence`),
  ADD KEY `e_invoices_status_index` (`status`),
  ADD KEY `e_invoices_xml_hash_index` (`xml_hash`),
  ADD KEY `e_invoices_previous_hash_index` (`previous_hash`);

--
-- Indexes for table `e_invoice_items`
--
ALTER TABLE `e_invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `e_invoice_items_e_invoice_id_foreign` (`e_invoice_id`);

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

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

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

--
-- Indexes for table `financial_reports`
--
ALTER TABLE `financial_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `financial_reports_created_by_foreign` (`created_by`),
  ADD KEY `financial_reports_approved_by_foreign` (`approved_by`),
  ADD KEY `financial_reports_company_id_report_type_period_from_index` (`company_id`,`report_type`,`period_from`),
  ADD KEY `financial_reports_transport_company_id_foreign` (`transport_company_id`),
  ADD KEY `financial_reports_generated_by_foreign` (`generated_by`);

--
-- Indexes for table `finished_goods`
--
ALTER TABLE `finished_goods`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `finished_goods_product_code_unique` (`product_code`),
  ADD KEY `finished_goods_company_id_product_code_index` (`company_id`,`product_code`);

--
-- Indexes for table `finished_goods_recipients`
--
ALTER TABLE `finished_goods_recipients`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `finished_goods_recipients_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `finished_goods_recipients_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `finished_goods_warehouses`
--
ALTER TABLE `finished_goods_warehouses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `finished_goods_warehouses_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `finished_goods_warehouses_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `fiscal_years`
--
ALTER TABLE `fiscal_years`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `fiscal_years_company_id_name_unique` (`company_id`,`name`);

--
-- Indexes for table `fuel_logs`
--
ALTER TABLE `fuel_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fuel_logs_vehicle_id_index` (`vehicle_id`),
  ADD KEY `fuel_logs_trip_id_index` (`trip_id`),
  ADD KEY `fuel_logs_refueling_date_index` (`refueling_date`);

--
-- Indexes for table `goods_receipt_notes`
--
ALTER TABLE `goods_receipt_notes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `goods_receipt_notes_grn_number_unique` (`grn_number`),
  ADD KEY `goods_receipt_notes_company_id_status_index` (`company_id`,`status`),
  ADD KEY `goods_receipt_notes_purchase_order_id_index` (`purchase_order_id`),
  ADD KEY `goods_receipt_notes_supplier_id_index` (`supplier_id`);

--
-- Indexes for table `goods_receipt_note_items`
--
ALTER TABLE `goods_receipt_note_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `goods_receipt_note_items_item_id_foreign` (`item_id`),
  ADD KEY `goods_receipt_note_items_unit_id_foreign` (`unit_id`),
  ADD KEY `goods_receipt_note_items_goods_receipt_note_id_index` (`goods_receipt_note_id`),
  ADD KEY `goods_receipt_note_items_purchase_order_item_id_index` (`purchase_order_item_id`);

--
-- Indexes for table `insurances`
--
ALTER TABLE `insurances`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `insurances_policy_number_unique` (`policy_number`),
  ADD KEY `insurances_vehicle_id_index` (`vehicle_id`),
  ADD KEY `insurances_status_index` (`status`),
  ADD KEY `insurances_expiry_date_index` (`expiry_date`);

--
-- Indexes for table `inventory_balances`
--
ALTER TABLE `inventory_balances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventory_balances_company_id_foreign` (`company_id`);

--
-- Indexes for table `inventory_counts`
--
ALTER TABLE `inventory_counts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventory_counts_company_id_foreign` (`company_id`),
  ADD KEY `inventory_counts_warehouse_id_foreign` (`warehouse_id`),
  ADD KEY `inventory_counts_created_by_foreign` (`created_by`),
  ADD KEY `inventory_counts_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `inventory_count_items`
--
ALTER TABLE `inventory_count_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventory_count_items_count_id_foreign` (`count_id`),
  ADD KEY `inventory_count_items_item_id_foreign` (`item_id`),
  ADD KEY `inventory_count_items_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `inventory_documents`
--
ALTER TABLE `inventory_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `company_id` (`company_id`),
  ADD KEY `document_type_id` (`document_type_id`),
  ADD KEY `from_warehouse_id` (`from_warehouse_id`),
  ADD KEY `to_warehouse_id` (`to_warehouse_id`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `approved_by` (`approved_by`),
  ADD KEY `inventory_documents_customer_invoice_id_foreign` (`customer_invoice_id`);

--
-- Indexes for table `inventory_document_items`
--
ALTER TABLE `inventory_document_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `document_id` (`document_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `unit_id` (`unit_id`),
  ADD KEY `inventory_document_items_cost_center_id_foreign` (`cost_center_id`);

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

--
-- Indexes for table `items`
--
ALTER TABLE `items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `items_company_id_name_unique` (`company_id`,`name`),
  ADD UNIQUE KEY `items_company_id_code_unique` (`company_id`,`code`),
  ADD KEY `items_company_id_foreign` (`company_id`),
  ADD KEY `items_primary_unit_id_foreign` (`primary_unit_id`),
  ADD KEY `items_account_id_foreign` (`account_id`),
  ADD KEY `items_category_id_foreign` (`category_id`);

--
-- Indexes for table `item_categories`
--
ALTER TABLE `item_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `item_categories_company_id_foreign` (`company_id`);

--
-- Indexes for table `item_units`
--
ALTER TABLE `item_units`
  ADD PRIMARY KEY (`id`),
  ADD KEY `item_units_item_id_foreign` (`item_id`),
  ADD KEY `item_units_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `journals`
--
ALTER TABLE `journals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `journals_company_id_journal_type_unique` (`company_id`,`journal_type`);

--
-- Indexes for table `journal_details`
--
ALTER TABLE `journal_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `journal_details_account_id_foreign` (`account_id`),
  ADD KEY `journal_details_company_id_account_id_index` (`company_id`,`account_id`),
  ADD KEY `journal_details_journal_entry_id_account_id_index` (`journal_entry_id`,`account_id`),
  ADD KEY `journal_details_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `journal_entries`
--
ALTER TABLE `journal_entries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `journal_entries_company_reference_unique` (`company_id`,`reference_number`),
  ADD KEY `journal_entries_branch_id_foreign` (`branch_id`),
  ADD KEY `journal_entries_fiscal_year_id_foreign` (`fiscal_year_id`),
  ADD KEY `journal_entries_accounting_period_id_foreign` (`accounting_period_id`),
  ADD KEY `journal_entries_created_by_foreign` (`created_by`),
  ADD KEY `journal_entries_approved_by_foreign` (`approved_by`),
  ADD KEY `journal_entries_company_id_entry_date_index` (`company_id`,`entry_date`),
  ADD KEY `journal_entries_period_index` (`company_id`,`fiscal_year_id`,`accounting_period_id`),
  ADD KEY `journal_entries_source_type_source_id_index` (`source_type`,`source_id`),
  ADD KEY `journal_entries_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `journal_entries_journal_id_foreign` (`journal_id`);

--
-- Indexes for table `k_p_i_metrics`
--
ALTER TABLE `k_p_i_metrics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `k_p_i_metrics_kpi_code_unique` (`kpi_code`),
  ADD KEY `k_p_i_metrics_company_id_category_index` (`company_id`,`category`);

--
-- Indexes for table `labor_allocations`
--
ALTER TABLE `labor_allocations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `labor_allocations_company_id_foreign` (`company_id`),
  ADD KEY `labor_allocations_production_line_id_foreign` (`production_line_id`),
  ADD KEY `labor_allocations_work_station_id_foreign` (`work_station_id`),
  ADD KEY `labor_allocations_employee_id_foreign` (`employee_id`);

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

--
-- Indexes for table `leave_approvals`
--
ALTER TABLE `leave_approvals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `leave_approvals_approved_by_foreign` (`approved_by`),
  ADD KEY `leave_approvals_leave_request_id_index` (`leave_request_id`);

--
-- Indexes for table `leave_balances`
--
ALTER TABLE `leave_balances`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `leave_balances_employee_id_leave_type_id_financial_year_unique` (`employee_id`,`leave_type_id`,`financial_year`),
  ADD KEY `leave_balances_leave_type_id_foreign` (`leave_type_id`),
  ADD KEY `leave_balances_company_id_financial_year_index` (`company_id`,`financial_year`);

--
-- Indexes for table `leave_requests`
--
ALTER TABLE `leave_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `leave_requests_employee_id_foreign` (`employee_id`),
  ADD KEY `leave_requests_leave_type_id_foreign` (`leave_type_id`),
  ADD KEY `leave_requests_approved_by_foreign` (`approved_by`),
  ADD KEY `leave_requests_created_by_foreign` (`created_by`),
  ADD KEY `leave_requests_company_id_employee_id_status_index` (`company_id`,`employee_id`,`status`),
  ADD KEY `leave_requests_start_date_end_date_index` (`start_date`,`end_date`);

--
-- Indexes for table `leave_types`
--
ALTER TABLE `leave_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `leave_types_code_unique` (`code`),
  ADD KEY `leave_types_company_id_is_active_index` (`company_id`,`is_active`);

--
-- Indexes for table `manufacturing_centers`
--
ALTER TABLE `manufacturing_centers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `manufacturing_centers_company_id_code_unique` (`company_id`,`code`),
  ADD KEY `manufacturing_centers_branch_id_foreign` (`branch_id`),
  ADD KEY `manufacturing_centers_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `manufacturing_centers_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `manufacturing_centers_code_index` (`code`);

--
-- Indexes for table `menu_categories`
--
ALTER TABLE `menu_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `menu_categories_company_id_foreign` (`company_id`),
  ADD KEY `menu_categories_restaurant_id_company_id_is_active_index` (`restaurant_id`,`company_id`,`is_active`);

--
-- Indexes for table `menu_items`
--
ALTER TABLE `menu_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `menu_items_restaurant_id_foreign` (`restaurant_id`),
  ADD KEY `menu_items_company_id_foreign` (`company_id`),
  ADD KEY `menu_items_category_id_foreign` (`category_id`),
  ADD KEY `menu_items_item_id_foreign` (`item_id`),
  ADD KEY `menu_items_unit_id_foreign` (`unit_id`);

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

--
-- Indexes for table `module_visibilities`
--
ALTER TABLE `module_visibilities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `module_visibilities_company_module_unique` (`company_id`,`module_name`);

--
-- Indexes for table `passengers`
--
ALTER TABLE `passengers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `passengers_email_index` (`email`),
  ADD KEY `passengers_phone_index` (`phone`);

--
-- Indexes for table `passenger_invoices`
--
ALTER TABLE `passenger_invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `passenger_invoices_invoice_number_unique` (`invoice_number`),
  ADD KEY `passenger_invoices_passenger_id_foreign` (`passenger_id`),
  ADD KEY `passenger_invoices_trip_id_foreign` (`trip_id`),
  ADD KEY `passenger_invoices_transport_company_id_foreign` (`transport_company_id`),
  ADD KEY `passenger_invoices_created_by_foreign` (`created_by`),
  ADD KEY `passenger_invoices_approved_by_foreign` (`approved_by`),
  ADD KEY `passenger_invoices_invoice_number_index` (`invoice_number`),
  ADD KEY `passenger_invoices_booking_id_index` (`booking_id`),
  ADD KEY `passenger_invoices_status_index` (`status`),
  ADD KEY `passenger_invoices_payment_status_index` (`payment_status`),
  ADD KEY `passenger_invoices_invoice_date_index` (`invoice_date`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payments_payment_reference_unique` (`payment_reference`),
  ADD KEY `payments_passenger_invoice_id_foreign` (`passenger_invoice_id`),
  ADD KEY `payments_booking_id_foreign` (`booking_id`),
  ADD KEY `payments_transport_company_id_foreign` (`transport_company_id`),
  ADD KEY `payments_processed_by_foreign` (`processed_by`),
  ADD KEY `payments_payment_reference_index` (`payment_reference`),
  ADD KEY `payments_status_index` (`status`),
  ADD KEY `payments_payment_method_index` (`payment_method`),
  ADD KEY `payments_payment_date_index` (`payment_date`);

--
-- Indexes for table `payment_certificates`
--
ALTER TABLE `payment_certificates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payment_certificates_company_id_foreign` (`company_id`),
  ADD KEY `payment_certificates_contract_id_foreign` (`contract_id`),
  ADD KEY `payment_certificates_project_id_foreign` (`project_id`),
  ADD KEY `payment_certificates_created_by_foreign` (`created_by`),
  ADD KEY `payment_certificates_approved_by_foreign` (`approved_by`),
  ADD KEY `payment_certificates_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `payment_certificate_items`
--
ALTER TABLE `payment_certificate_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payment_certificate_items_company_id_foreign` (`company_id`),
  ADD KEY `payment_certificate_items_payment_certificate_id_foreign` (`payment_certificate_id`),
  ADD KEY `payment_certificate_items_contract_item_id_foreign` (`contract_item_id`);

--
-- Indexes for table `payrolls`
--
ALTER TABLE `payrolls`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payrolls_company_id_payroll_number_unique` (`company_id`,`payroll_number`),
  ADD KEY `payrolls_created_by_foreign` (`created_by`),
  ADD KEY `payrolls_approved_by_foreign` (`approved_by`),
  ADD KEY `payrolls_payroll_number_index` (`payroll_number`);

--
-- Indexes for table `payroll_items`
--
ALTER TABLE `payroll_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payroll_items_company_id_payroll_id_employee_id_unique` (`company_id`,`payroll_id`,`employee_id`),
  ADD KEY `payroll_items_payroll_id_foreign` (`payroll_id`),
  ADD KEY `payroll_items_employee_id_foreign` (`employee_id`);

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_name_unique` (`name`);

--
-- 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`);

--
-- Indexes for table `production_batches`
--
ALTER TABLE `production_batches`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `production_batches_batch_number_unique` (`batch_number`),
  ADD KEY `production_batches_company_id_status_index` (`company_id`,`status`);

--
-- Indexes for table `production_costs`
--
ALTER TABLE `production_costs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `production_costs_company_id_cost_type_index` (`company_id`,`cost_type`);

--
-- Indexes for table `production_lines`
--
ALTER TABLE `production_lines`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `production_lines_manufacturing_center_id_code_unique` (`manufacturing_center_id`,`code`),
  ADD KEY `production_lines_company_id_foreign` (`company_id`),
  ADD KEY `production_lines_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `production_lines_code_index` (`code`);

--
-- Indexes for table `production_operations`
--
ALTER TABLE `production_operations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `production_operations_company_id_foreign` (`company_id`),
  ADD KEY `production_operations_production_order_id_foreign` (`production_order_id`),
  ADD KEY `production_operations_work_station_id_foreign` (`work_station_id`),
  ADD KEY `production_operations_operator_id_foreign` (`operator_id`);

--
-- Indexes for table `production_orders`
--
ALTER TABLE `production_orders`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `production_orders_order_number_unique` (`order_number`),
  ADD KEY `production_orders_company_id_foreign` (`company_id`),
  ADD KEY `production_orders_production_line_id_foreign` (`production_line_id`),
  ADD KEY `production_orders_project_id_foreign` (`project_id`),
  ADD KEY `production_orders_contract_id_foreign` (`contract_id`),
  ADD KEY `production_orders_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `production_orders_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `production_orders_item_id_foreign` (`item_id`),
  ADD KEY `production_orders_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `production_plans`
--
ALTER TABLE `production_plans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `production_plans_company_id_index` (`company_id`);

--
-- Indexes for table `production_reports`
--
ALTER TABLE `production_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `production_reports_company_id_foreign` (`company_id`),
  ADD KEY `production_reports_manufacturing_center_id_foreign` (`manufacturing_center_id`),
  ADD KEY `production_reports_production_line_id_foreign` (`production_line_id`),
  ADD KEY `production_reports_created_by_foreign` (`created_by`);

--
-- Indexes for table `production_schedules`
--
ALTER TABLE `production_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `production_schedules_company_id_foreign` (`company_id`),
  ADD KEY `production_schedules_production_line_id_foreign` (`production_line_id`),
  ADD KEY `production_schedules_production_order_id_foreign` (`production_order_id`);

--
-- Indexes for table `production_sites_or_lines`
--
ALTER TABLE `production_sites_or_lines`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `production_sites_or_lines_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `production_sites_or_lines_project_id_foreign` (`project_id`);

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

--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
  ADD PRIMARY KEY (`id`),
  ADD KEY `projects_company_id_foreign` (`company_id`),
  ADD KEY `projects_customer_id_foreign` (`customer_id`),
  ADD KEY `projects_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `project_analytics`
--
ALTER TABLE `project_analytics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_analytics_project_id_foreign` (`project_id`),
  ADD KEY `project_analytics_company_id_project_id_analysis_date_index` (`company_id`,`project_id`,`analysis_date`);

--
-- Indexes for table `project_documents`
--
ALTER TABLE `project_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_documents_company_id_foreign` (`company_id`),
  ADD KEY `project_documents_project_id_foreign` (`project_id`),
  ADD KEY `project_documents_uploaded_by_foreign` (`uploaded_by`);

--
-- Indexes for table `project_invoices`
--
ALTER TABLE `project_invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_invoices_company_id_foreign` (`company_id`),
  ADD KEY `project_invoices_project_id_foreign` (`project_id`),
  ADD KEY `project_invoices_customer_id_foreign` (`customer_id`),
  ADD KEY `project_invoices_created_by_foreign` (`created_by`);

--
-- Indexes for table `project_invoice_items`
--
ALTER TABLE `project_invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_invoice_items_company_id_foreign` (`company_id`),
  ADD KEY `project_invoice_items_project_invoice_id_foreign` (`project_invoice_id`);

--
-- Indexes for table `project_material_issue_headers`
--
ALTER TABLE `project_material_issue_headers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `project_material_issue_headers_issue_no_unique` (`issue_no`),
  ADD KEY `project_material_issue_headers_branch_id_foreign` (`branch_id`),
  ADD KEY `project_material_issue_headers_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `project_material_issue_headers_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `project_material_issue_headers_created_by_foreign` (`created_by`),
  ADD KEY `project_material_issue_headers_approved_by_foreign` (`approved_by`),
  ADD KEY `project_material_issue_headers_company_id_issue_date_index` (`company_id`,`issue_date`),
  ADD KEY `project_material_issue_headers_project_id_cost_center_id_index` (`project_id`,`cost_center_id`),
  ADD KEY `project_material_issue_headers_warehouse_id_index` (`warehouse_id`);

--
-- Indexes for table `project_material_issue_lines`
--
ALTER TABLE `project_material_issue_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_material_issue_lines_company_id_foreign` (`company_id`),
  ADD KEY `project_material_issue_lines_unit_id_foreign` (`unit_id`),
  ADD KEY `project_material_issue_lines_header_id_index` (`header_id`),
  ADD KEY `project_material_issue_lines_item_id_index` (`item_id`);

--
-- Indexes for table `project_phases`
--
ALTER TABLE `project_phases`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_phases_company_id_foreign` (`company_id`),
  ADD KEY `project_phases_project_id_foreign` (`project_id`),
  ADD KEY `project_phases_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `project_resources`
--
ALTER TABLE `project_resources`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_resources_company_id_foreign` (`company_id`),
  ADD KEY `project_resources_project_id_foreign` (`project_id`),
  ADD KEY `project_resources_resource_type_resource_id_index` (`resource_type`,`resource_id`),
  ADD KEY `project_resources_assigned_to_foreign` (`assigned_to`);

--
-- Indexes for table `project_returns`
--
ALTER TABLE `project_returns`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `project_returns_return_number_unique` (`return_number`),
  ADD KEY `project_returns_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `project_returns_warehouse_id_foreign` (`warehouse_id`),
  ADD KEY `project_returns_created_by_foreign` (`created_by`),
  ADD KEY `project_returns_approved_by_foreign` (`approved_by`),
  ADD KEY `project_returns_company_id_cost_center_id_index` (`company_id`,`cost_center_id`),
  ADD KEY `project_returns_company_id_status_index` (`company_id`,`status`);

--
-- Indexes for table `project_return_items`
--
ALTER TABLE `project_return_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_return_items_project_return_id_foreign` (`project_return_id`),
  ADD KEY `project_return_items_item_id_foreign` (`item_id`);

--
-- Indexes for table `project_risks`
--
ALTER TABLE `project_risks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_risks_company_id_foreign` (`company_id`),
  ADD KEY `project_risks_project_id_foreign` (`project_id`),
  ADD KEY `project_risks_assigned_to_foreign` (`assigned_to`);

--
-- Indexes for table `project_tasks`
--
ALTER TABLE `project_tasks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_tasks_company_id_foreign` (`company_id`),
  ADD KEY `project_tasks_project_id_foreign` (`project_id`),
  ADD KEY `project_tasks_project_phase_id_foreign` (`project_phase_id`),
  ADD KEY `project_tasks_assigned_to_foreign` (`assigned_to`);

--
-- Indexes for table `purchase_budgets`
--
ALTER TABLE `purchase_budgets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchase_budgets_company_id_budget_date_budget_type_unique` (`company_id`,`budget_date`,`budget_type`),
  ADD KEY `purchase_budgets_company_id_budget_date_index` (`company_id`,`budget_date`),
  ADD KEY `purchase_budgets_budget_date_index` (`budget_date`);

--
-- Indexes for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchase_orders_po_number_unique` (`po_number`),
  ADD KEY `purchase_orders_supplier_contract_id_foreign` (`supplier_contract_id`),
  ADD KEY `purchase_orders_company_id_status_index` (`company_id`,`status`),
  ADD KEY `purchase_orders_supplier_id_index` (`supplier_id`),
  ADD KEY `purchase_orders_requisition_id_index` (`requisition_id`);

--
-- Indexes for table `purchase_order_items`
--
ALTER TABLE `purchase_order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_order_items_unit_id_foreign` (`unit_id`),
  ADD KEY `purchase_order_items_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `purchase_order_items_purchase_order_id_index` (`purchase_order_id`),
  ADD KEY `purchase_order_items_item_id_index` (`item_id`);

--
-- Indexes for table `purchase_requisitions`
--
ALTER TABLE `purchase_requisitions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchase_requisitions_requisition_number_unique` (`requisition_number`),
  ADD KEY `purchase_requisitions_approved_by_foreign` (`approved_by`),
  ADD KEY `purchase_requisitions_company_id_status_index` (`company_id`,`status`),
  ADD KEY `purchase_requisitions_cost_center_id_index` (`cost_center_id`);

--
-- Indexes for table `purchase_requisition_items`
--
ALTER TABLE `purchase_requisition_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_requisition_items_unit_id_foreign` (`unit_id`),
  ADD KEY `purchase_requisition_items_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `purchase_requisition_items_purchase_requisition_id_index` (`purchase_requisition_id`),
  ADD KEY `purchase_requisition_items_item_id_index` (`item_id`);

--
-- Indexes for table `purchase_returns`
--
ALTER TABLE `purchase_returns`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchase_returns_return_number_unique` (`return_number`),
  ADD KEY `purchase_returns_supplier_id_foreign` (`supplier_id`),
  ADD KEY `purchase_returns_supplier_invoice_id_foreign` (`supplier_invoice_id`),
  ADD KEY `purchase_returns_warehouse_id_foreign` (`warehouse_id`),
  ADD KEY `purchase_returns_created_by_foreign` (`created_by`),
  ADD KEY `purchase_returns_approved_by_foreign` (`approved_by`),
  ADD KEY `purchase_returns_company_id_supplier_id_index` (`company_id`,`supplier_id`),
  ADD KEY `purchase_returns_company_id_status_index` (`company_id`,`status`);

--
-- Indexes for table `purchase_return_items`
--
ALTER TABLE `purchase_return_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_return_items_purchase_return_id_foreign` (`purchase_return_id`),
  ADD KEY `purchase_return_items_item_id_foreign` (`item_id`),
  ADD KEY `purchase_return_items_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `quality_checklists`
--
ALTER TABLE `quality_checklists`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quality_checklists_company_id_foreign` (`company_id`),
  ADD KEY `quality_checklists_quality_standard_id_foreign` (`quality_standard_id`);

--
-- Indexes for table `quality_controls`
--
ALTER TABLE `quality_controls`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quality_controls_company_id_foreign` (`company_id`),
  ADD KEY `quality_controls_production_order_id_foreign` (`production_order_id`),
  ADD KEY `quality_controls_inspector_id_foreign` (`inspector_id`);

--
-- Indexes for table `quality_standards`
--
ALTER TABLE `quality_standards`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quality_standards_company_id_foreign` (`company_id`),
  ADD KEY `quality_standards_created_by_foreign` (`created_by`),
  ADD KEY `quality_standards_updated_by_foreign` (`updated_by`);

--
-- Indexes for table `quotations`
--
ALTER TABLE `quotations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotations_company_id_foreign` (`company_id`),
  ADD KEY `quotations_supplier_id_foreign` (`supplier_id`);

--
-- Indexes for table `quotation_items`
--
ALTER TABLE `quotation_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotation_items_unit_id_foreign` (`unit_id`),
  ADD KEY `quotation_items_quotation_id_index` (`quotation_id`),
  ADD KEY `quotation_items_item_id_index` (`item_id`);

--
-- Indexes for table `quotation_requests`
--
ALTER TABLE `quotation_requests`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `quotation_requests_company_id_rq_number_unique` (`company_id`,`rq_number`),
  ADD KEY `quotation_requests_company_id_status_index` (`company_id`,`status`);

--
-- Indexes for table `quotation_request_items`
--
ALTER TABLE `quotation_request_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotation_request_items_unit_id_foreign` (`unit_id`),
  ADD KEY `quotation_request_items_quotation_request_id_index` (`quotation_request_id`),
  ADD KEY `quotation_request_items_item_id_index` (`item_id`);

--
-- Indexes for table `quotation_request_suppliers`
--
ALTER TABLE `quotation_request_suppliers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotation_request_suppliers_quotation_request_id_foreign` (`quotation_request_id`),
  ADD KEY `quotation_request_suppliers_supplier_id_foreign` (`supplier_id`);

--
-- Indexes for table `raw_materials_warehouses`
--
ALTER TABLE `raw_materials_warehouses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `raw_materials_warehouses_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `raw_materials_warehouses_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `raw_material_issues`
--
ALTER TABLE `raw_material_issues`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `raw_material_issues_issue_number_unique` (`issue_number`),
  ADD KEY `raw_material_issues_company_id_foreign` (`company_id`),
  ADD KEY `raw_material_issues_manufacturing_center_id_foreign` (`manufacturing_center_id`),
  ADD KEY `raw_material_issues_production_order_id_foreign` (`production_order_id`),
  ADD KEY `raw_material_issues_item_id_foreign` (`item_id`),
  ADD KEY `raw_material_issues_warehouse_id_foreign` (`warehouse_id`),
  ADD KEY `raw_material_issues_issued_by_foreign` (`issued_by`),
  ADD KEY `raw_material_issues_received_by_foreign` (`received_by`);

--
-- Indexes for table `report_executions`
--
ALTER TABLE `report_executions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `report_executions_custom_report_id_index` (`custom_report_id`),
  ADD KEY `report_executions_user_id_index` (`user_id`);

--
-- Indexes for table `restaurants`
--
ALTER TABLE `restaurants`
  ADD PRIMARY KEY (`id`),
  ADD KEY `restaurants_company_id_is_active_index` (`company_id`,`is_active`);

--
-- Indexes for table `restaurant_branches`
--
ALTER TABLE `restaurant_branches`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_branches_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `restaurant_branches_chart_of_account_id_foreign` (`chart_of_account_id`),
  ADD KEY `restaurant_branches_restaurant_id_company_id_is_active_index` (`restaurant_id`,`company_id`,`is_active`);

--
-- Indexes for table `restaurant_invoices`
--
ALTER TABLE `restaurant_invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_invoices_invoice_number_unique` (`invoice_number`),
  ADD KEY `restaurant_invoices_order_id_foreign` (`order_id`),
  ADD KEY `restaurant_invoices_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_invoices_customer_id_foreign` (`customer_id`),
  ADD KEY `restaurant_invoices_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `restaurant_invoices_branch_id_company_id_status_index` (`branch_id`,`company_id`,`status`),
  ADD KEY `restaurant_invoices_invoice_date_index` (`invoice_date`),
  ADD KEY `restaurant_invoices_pos_terminal_id_foreign` (`pos_terminal_id`);

--
-- Indexes for table `restaurant_orders`
--
ALTER TABLE `restaurant_orders`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_orders_order_number_unique` (`order_number`),
  ADD KEY `restaurant_orders_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_orders_table_id_foreign` (`table_id`),
  ADD KEY `restaurant_orders_staff_id_foreign` (`staff_id`),
  ADD KEY `restaurant_orders_customer_id_foreign` (`customer_id`),
  ADD KEY `restaurant_orders_branch_id_company_id_status_index` (`branch_id`,`company_id`,`status`),
  ADD KEY `restaurant_orders_order_date_index` (`order_date`),
  ADD KEY `restaurant_orders_pos_terminal_id_foreign` (`pos_terminal_id`);

--
-- Indexes for table `restaurant_order_items`
--
ALTER TABLE `restaurant_order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `restaurant_order_items_menu_item_id_foreign` (`menu_item_id`),
  ADD KEY `restaurant_order_items_order_id_menu_item_id_index` (`order_id`,`menu_item_id`);

--
-- Indexes for table `restaurant_payments`
--
ALTER TABLE `restaurant_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_payments_payment_number_unique` (`payment_number`),
  ADD KEY `restaurant_payments_branch_id_foreign` (`branch_id`),
  ADD KEY `restaurant_payments_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_payments_invoice_id_branch_id_company_id_index` (`invoice_id`,`branch_id`,`company_id`),
  ADD KEY `restaurant_payments_payment_date_index` (`payment_date`),
  ADD KEY `restaurant_payments_treasury_id_foreign` (`treasury_id`),
  ADD KEY `restaurant_payments_journal_entry_id_foreign` (`journal_entry_id`);

--
-- Indexes for table `restaurant_pos_terminals`
--
ALTER TABLE `restaurant_pos_terminals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_pos_terminals_company_id_branch_id_name_unique` (`company_id`,`branch_id`,`name`),
  ADD UNIQUE KEY `restaurant_pos_terminals_code_unique` (`code`),
  ADD KEY `restaurant_pos_terminals_treasury_id_foreign` (`treasury_id`),
  ADD KEY `restaurant_pos_terminals_company_id_is_active_index` (`company_id`,`is_active`),
  ADD KEY `restaurant_pos_terminals_branch_id_is_active_index` (`branch_id`,`is_active`),
  ADD KEY `restaurant_pos_terminals_staff_user_id_index` (`staff_user_id`),
  ADD KEY `restaurant_pos_terminals_warehouse_id_foreign` (`warehouse_id`),
  ADD KEY `restaurant_pos_terminals_default_customer_id_foreign` (`default_customer_id`),
  ADD KEY `restaurant_pos_terminals_default_warehouse_id_foreign` (`default_warehouse_id`);

--
-- Indexes for table `restaurant_reservations`
--
ALTER TABLE `restaurant_reservations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `restaurant_reservations_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_reservations_branch_id_foreign` (`branch_id`),
  ADD KEY `restaurant_reservations_customer_id_foreign` (`customer_id`),
  ADD KEY `restaurant_reservations_table_id_foreign` (`table_id`);

--
-- Indexes for table `restaurant_staff`
--
ALTER TABLE `restaurant_staff`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_staff_restaurant_id_user_id_unique` (`restaurant_id`,`user_id`),
  ADD KEY `restaurant_staff_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_staff_user_id_foreign` (`user_id`),
  ADD KEY `restaurant_staff_restaurant_id_company_id_index` (`restaurant_id`,`company_id`);

--
-- Indexes for table `restaurant_tables`
--
ALTER TABLE `restaurant_tables`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `restaurant_tables_branch_id_table_number_unique` (`branch_id`,`table_number`),
  ADD KEY `restaurant_tables_company_id_foreign` (`company_id`),
  ADD KEY `restaurant_tables_branch_id_company_id_status_index` (`branch_id`,`company_id`,`status`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_company_id_name_unique` (`company_id`,`name`);

--
-- Indexes for table `role_permission`
--
ALTER TABLE `role_permission`
  ADD PRIMARY KEY (`role_id`,`permission_id`),
  ADD KEY `role_permission_permission_id_foreign` (`permission_id`);

--
-- Indexes for table `routes`
--
ALTER TABLE `routes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `routes_route_code_unique` (`route_code`),
  ADD KEY `routes_transport_company_id_index` (`transport_company_id`);

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

--
-- Indexes for table `salary_structures`
--
ALTER TABLE `salary_structures`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `salary_structures_company_id_name_unique` (`company_id`,`name`);

--
-- Indexes for table `scrap_materials`
--
ALTER TABLE `scrap_materials`
  ADD PRIMARY KEY (`id`),
  ADD KEY `scrap_materials_company_id_foreign` (`company_id`);

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

--
-- Indexes for table `sidebar_visibilities`
--
ALTER TABLE `sidebar_visibilities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sidebar_visibilities_module_name_unique` (`module_name`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscriptions_subscription_plan_id_foreign` (`subscription_plan_id`),
  ADD KEY `subscriptions_company_id_index` (`company_id`),
  ADD KEY `subscriptions_status_index` (`status`),
  ADD KEY `subscriptions_subscription_end_date_index` (`subscription_end_date`);

--
-- Indexes for table `subscription_invoices`
--
ALTER TABLE `subscription_invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscription_invoices_subscription_id_foreign` (`subscription_id`),
  ADD KEY `subscription_invoices_company_id_foreign` (`company_id`);

--
-- Indexes for table `subscription_logs`
--
ALTER TABLE `subscription_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscription_logs_user_id_foreign` (`user_id`),
  ADD KEY `subscription_logs_subscription_id_index` (`subscription_id`),
  ADD KEY `subscription_logs_company_id_index` (`company_id`),
  ADD KEY `subscription_logs_action_index` (`action`),
  ADD KEY `subscription_logs_created_at_index` (`created_at`);

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

--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `suppliers_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `suppliers_company_id_foreign` (`company_id`),
  ADD KEY `suppliers_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `supplier_contracts`
--
ALTER TABLE `supplier_contracts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_contracts_company_id_foreign` (`company_id`),
  ADD KEY `supplier_contracts_supplier_id_foreign` (`supplier_id`),
  ADD KEY `supplier_contracts_project_id_foreign` (`project_id`);

--
-- Indexes for table `supplier_invoices`
--
ALTER TABLE `supplier_invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_invoices_company_id_foreign` (`company_id`),
  ADD KEY `supplier_invoices_supplier_id_foreign` (`supplier_id`),
  ADD KEY `supplier_invoices_supplier_contract_id_foreign` (`supplier_contract_id`),
  ADD KEY `supplier_invoices_warehouse_id_foreign` (`warehouse_id`);

--
-- Indexes for table `supplier_invoice_items`
--
ALTER TABLE `supplier_invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_invoice_items_company_id_foreign` (`company_id`),
  ADD KEY `supplier_invoice_items_item_id_foreign` (`item_id`),
  ADD KEY `supplier_invoice_items_item_unit_id_foreign` (`item_unit_id`),
  ADD KEY `supplier_invoice_items_supplier_invoice_id_index` (`supplier_invoice_id`);

--
-- Indexes for table `supplier_payments`
--
ALTER TABLE `supplier_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_payments_company_id_foreign` (`company_id`),
  ADD KEY `supplier_payments_supplier_id_foreign` (`supplier_id`),
  ADD KEY `supplier_payments_supplier_invoice_id_foreign` (`supplier_invoice_id`),
  ADD KEY `supplier_payments_bank_account_id_foreign` (`bank_account_id`),
  ADD KEY `supplier_payments_treasury_id_foreign` (`treasury_id`);

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `system_settings_key_unique` (`key`);

--
-- Indexes for table `tasks`
--
ALTER TABLE `tasks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tasks_company_id_foreign` (`company_id`),
  ADD KEY `tasks_project_id_foreign` (`project_id`),
  ADD KEY `tasks_assigned_to_foreign` (`assigned_to`);

--
-- Indexes for table `tax_declarations`
--
ALTER TABLE `tax_declarations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tax_declarations_company_id_foreign` (`company_id`);

--
-- Indexes for table `translations`
--
ALTER TABLE `translations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `translations_language_id_translation_key_id_company_id_unique` (`language_id`,`translation_key_id`,`company_id`),
  ADD KEY `translations_translation_key_id_foreign` (`translation_key_id`),
  ADD KEY `translations_company_id_foreign` (`company_id`),
  ADD KEY `translations_created_by_foreign` (`created_by`),
  ADD KEY `translations_approved_by_foreign` (`approved_by`),
  ADD KEY `translations_language_id_company_id_status_index` (`language_id`,`company_id`,`status`);

--
-- Indexes for table `translation_history`
--
ALTER TABLE `translation_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `translation_history_translation_id_foreign` (`translation_id`),
  ADD KEY `translation_history_changed_by_foreign` (`changed_by`);

--
-- Indexes for table `translation_keys`
--
ALTER TABLE `translation_keys`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `translation_keys_key_unique` (`key`),
  ADD KEY `translation_keys_view_path_index` (`view_path`);

--
-- Indexes for table `transport_companies`
--
ALTER TABLE `transport_companies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transport_companies_code_unique` (`code`),
  ADD KEY `transport_companies_company_id_index` (`company_id`);

--
-- Indexes for table `transport_documents`
--
ALTER TABLE `transport_documents`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transport_documents_document_code_unique` (`document_code`),
  ADD KEY `transport_documents_documentable_type_documentable_id_index` (`documentable_type`,`documentable_id`),
  ADD KEY `transport_documents_documentable_type_index` (`documentable_type`),
  ADD KEY `transport_documents_documentable_id_index` (`documentable_id`),
  ADD KEY `transport_documents_document_type_index` (`document_type`),
  ADD KEY `transport_documents_status_index` (`status`);

--
-- Indexes for table `treasuries`
--
ALTER TABLE `treasuries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `treasuries_company_code_unique` (`company_id`,`code`),
  ADD UNIQUE KEY `treasuries_company_name_unique` (`company_id`,`name`),
  ADD KEY `treasuries_company_id_foreign` (`company_id`),
  ADD KEY `treasuries_branch_id_foreign` (`branch_id`),
  ADD KEY `treasuries_responsible_user_id_foreign` (`responsible_user_id`),
  ADD KEY `treasuries_chart_of_account_id_foreign` (`chart_of_account_id`);

--
-- Indexes for table `treasury_deposits`
--
ALTER TABLE `treasury_deposits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `treasury_deposits_reference_number_unique` (`reference_number`),
  ADD KEY `treasury_deposits_company_id_foreign` (`company_id`),
  ADD KEY `treasury_deposits_branch_id_foreign` (`branch_id`),
  ADD KEY `treasury_deposits_treasury_id_foreign` (`treasury_id`),
  ADD KEY `treasury_deposits_created_by_foreign` (`created_by`),
  ADD KEY `treasury_deposits_approved_by_foreign` (`approved_by`),
  ADD KEY `treasury_deposits_account_id_foreign` (`account_id`),
  ADD KEY `treasury_deposits_debit_account_id_foreign` (`debit_account_id`),
  ADD KEY `treasury_deposits_credit_account_id_foreign` (`credit_account_id`),
  ADD KEY `treasury_deposits_journal_entry_id_foreign` (`journal_entry_id`);

--
-- Indexes for table `treasury_deposit_cost_centers`
--
ALTER TABLE `treasury_deposit_cost_centers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `treasury_deposit_cost_centers_treasury_deposit_id_foreign` (`treasury_deposit_id`),
  ADD KEY `treasury_deposit_cost_centers_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `treasury_payments`
--
ALTER TABLE `treasury_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `treasury_payments_reference_number_unique` (`reference_number`),
  ADD KEY `treasury_payments_company_id_foreign` (`company_id`),
  ADD KEY `treasury_payments_branch_id_foreign` (`branch_id`),
  ADD KEY `treasury_payments_treasury_id_foreign` (`treasury_id`),
  ADD KEY `treasury_payments_created_by_foreign` (`created_by`),
  ADD KEY `treasury_payments_approved_by_foreign` (`approved_by`),
  ADD KEY `treasury_payments_account_id_foreign` (`account_id`),
  ADD KEY `treasury_payments_debit_account_id_foreign` (`debit_account_id`),
  ADD KEY `treasury_payments_credit_account_id_foreign` (`credit_account_id`),
  ADD KEY `treasury_payments_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `treasury_payments_cost_center_id_foreign` (`cost_center_id`),
  ADD KEY `treasury_payments_cash_account_id_foreign` (`cash_account_id`);

--
-- Indexes for table `treasury_payment_cost_centers`
--
ALTER TABLE `treasury_payment_cost_centers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `treasury_payment_cost_centers_treasury_payment_id_foreign` (`treasury_payment_id`),
  ADD KEY `treasury_payment_cost_centers_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `treasury_transactions`
--
ALTER TABLE `treasury_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `treasury_transactions_company_id_foreign` (`company_id`),
  ADD KEY `treasury_transactions_branch_id_foreign` (`branch_id`),
  ADD KEY `treasury_transactions_treasury_id_foreign` (`treasury_id`),
  ADD KEY `treasury_transactions_created_by_foreign` (`created_by`);

--
-- Indexes for table `treasury_transfers`
--
ALTER TABLE `treasury_transfers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `treasury_transfers_reference_number_unique` (`reference_number`),
  ADD KEY `treasury_transfers_company_id_foreign` (`company_id`),
  ADD KEY `treasury_transfers_branch_id_foreign` (`branch_id`),
  ADD KEY `treasury_transfers_from_treasury_id_foreign` (`from_treasury_id`),
  ADD KEY `treasury_transfers_to_treasury_id_foreign` (`to_treasury_id`),
  ADD KEY `treasury_transfers_created_by_foreign` (`created_by`),
  ADD KEY `treasury_transfers_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `trips`
--
ALTER TABLE `trips`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trips_driver_id_foreign` (`driver_id`),
  ADD KEY `trips_transport_company_id_index` (`transport_company_id`),
  ADD KEY `trips_route_id_index` (`route_id`),
  ADD KEY `trips_vehicle_id_index` (`vehicle_id`);

--
-- Indexes for table `trip_stops`
--
ALTER TABLE `trip_stops`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trip_stops_trip_id_index` (`trip_id`),
  ADD KEY `trip_stops_route_stop_id_index` (`route_stop_id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`),
  ADD KEY `units_company_id_foreign` (`company_id`);

--
-- Indexes for table `user_languages`
--
ALTER TABLE `user_languages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_languages_user_id_language_id_unique` (`user_id`,`language_id`),
  ADD KEY `user_languages_language_id_foreign` (`language_id`);

--
-- Indexes for table `user_permission`
--
ALTER TABLE `user_permission`
  ADD PRIMARY KEY (`user_id`,`permission_id`),
  ADD KEY `user_permission_permission_id_foreign` (`permission_id`);

--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
  ADD PRIMARY KEY (`user_id`,`role_id`),
  ADD KEY `user_role_role_id_foreign` (`role_id`);

--
-- Indexes for table `variation_orders`
--
ALTER TABLE `variation_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_orders_company_id_foreign` (`company_id`),
  ADD KEY `variation_orders_contract_id_foreign` (`contract_id`),
  ADD KEY `variation_orders_created_by_foreign` (`created_by`),
  ADD KEY `variation_orders_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `variation_order_items`
--
ALTER TABLE `variation_order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_order_items_company_id_foreign` (`company_id`),
  ADD KEY `variation_order_items_variation_order_id_foreign` (`variation_order_id`),
  ADD KEY `variation_order_items_contract_item_id_foreign` (`contract_item_id`);

--
-- Indexes for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicles_transport_company_id_foreign` (`transport_company_id`),
  ADD KEY `vehicles_vehicle_type_id_foreign` (`vehicle_type_id`);

--
-- Indexes for table `vehicle_maintenance_schedules`
--
ALTER TABLE `vehicle_maintenance_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vehicle_maintenance_schedules_vehicle_id_index` (`vehicle_id`),
  ADD KEY `vehicle_maintenance_schedules_status_index` (`status`),
  ADD KEY `vehicle_maintenance_schedules_scheduled_date_index` (`scheduled_date`);

--
-- Indexes for table `vehicle_types`
--
ALTER TABLE `vehicle_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vehicle_types_code_unique` (`code`),
  ADD KEY `vehicle_types_company_id_index` (`company_id`);

--
-- Indexes for table `warehouses`
--
ALTER TABLE `warehouses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `warehouses_company_id_name_unique` (`company_id`,`name`),
  ADD KEY `warehouses_company_id_foreign` (`company_id`),
  ADD KEY `warehouses_chart_of_account_id_foreign` (`chart_of_account_id`);

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

--
-- Indexes for table `work_in_progresses`
--
ALTER TABLE `work_in_progresses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `work_in_progresses_batch_number_unique` (`batch_number`),
  ADD KEY `work_in_progresses_company_id_status_index` (`company_id`,`status`);

--
-- Indexes for table `work_stations`
--
ALTER TABLE `work_stations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `work_stations_production_line_id_code_unique` (`production_line_id`,`code`),
  ADD KEY `work_stations_company_id_foreign` (`company_id`),
  ADD KEY `work_stations_code_index` (`code`);

--
-- Indexes for table `zakat_calculations`
--
ALTER TABLE `zakat_calculations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `zakat_calculations_company_id_foreign` (`company_id`),
  ADD KEY `zakat_calculations_fiscal_year_id_foreign` (`fiscal_year_id`);

--
-- Indexes for table `zatca_operations`
--
ALTER TABLE `zatca_operations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `zatca_operations_company_id_index` (`company_id`),
  ADD KEY `zatca_operations_status_index` (`status`),
  ADD KEY `zatca_operations_operation_type_index` (`operation_type`),
  ADD KEY `zatca_operations_next_retry_at_index` (`next_retry_at`),
  ADD KEY `zatca_operations_created_at_index` (`created_at`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `accounting_periods`
--
ALTER TABLE `accounting_periods`
  ADD CONSTRAINT `accounting_periods_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `accounting_periods_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `account_balances`
--
ALTER TABLE `account_balances`
  ADD CONSTRAINT `account_balances_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_balances_accounting_period_id_foreign` FOREIGN KEY (`accounting_period_id`) REFERENCES `accounting_periods` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_balances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_balances_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `account_categories`
--
ALTER TABLE `account_categories`
  ADD CONSTRAINT `account_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `account_mappings`
--
ALTER TABLE `account_mappings`
  ADD CONSTRAINT `account_mappings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_mappings_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `account_mappings_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `chart_of_accounts` (`id`);

--
-- Constraints for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD CONSTRAINT `activity_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `activity_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `analytics`
--
ALTER TABLE `analytics`
  ADD CONSTRAINT `analytics_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`);

--
-- Constraints for table `assets`
--
ALTER TABLE `assets`
  ADD CONSTRAINT `assets_asset_category_id_foreign` FOREIGN KEY (`asset_category_id`) REFERENCES `asset_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `assets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `asset_categories`
--
ALTER TABLE `asset_categories`
  ADD CONSTRAINT `asset_categories_accumulated_depreciation_account_id_foreign` FOREIGN KEY (`accumulated_depreciation_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `asset_categories_asset_account_id_foreign` FOREIGN KEY (`asset_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `asset_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_categories_depreciation_account_id_foreign` FOREIGN KEY (`depreciation_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `asset_categories_expense_account_id_foreign` FOREIGN KEY (`expense_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `asset_depreciations`
--
ALTER TABLE `asset_depreciations`
  ADD CONSTRAINT `asset_depreciations_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_depreciations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_depreciations_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `asset_disposals`
--
ALTER TABLE `asset_disposals`
  ADD CONSTRAINT `asset_disposals_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_disposals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_disposals_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `asset_maintenances`
--
ALTER TABLE `asset_maintenances`
  ADD CONSTRAINT `asset_maintenances_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_maintenances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_maintenances_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `attendances`
--
ALTER TABLE `attendances`
  ADD CONSTRAINT `attendances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `baladi_integrations`
--
ALTER TABLE `baladi_integrations`
  ADD CONSTRAINT `baladi_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `banks`
--
ALTER TABLE `banks`
  ADD CONSTRAINT `banks_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `banks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bank_deposits`
--
ALTER TABLE `bank_deposits`
  ADD CONSTRAINT `bank_deposits_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_deposits_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_deposits_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_deposits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_deposits_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_deposits_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_deposits_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `bank_reconciliations`
--
ALTER TABLE `bank_reconciliations`
  ADD CONSTRAINT `bank_reconciliations_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_reconciliations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_reconciliations_completed_by_foreign` FOREIGN KEY (`completed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_reconciliations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `bank_reconciliation_items`
--
ALTER TABLE `bank_reconciliation_items`
  ADD CONSTRAINT `bank_reconciliation_items_bank_reconciliation_id_foreign` FOREIGN KEY (`bank_reconciliation_id`) REFERENCES `bank_reconciliations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_reconciliation_items_reconciled_by_foreign` FOREIGN KEY (`reconciled_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `bank_withdrawals`
--
ALTER TABLE `bank_withdrawals`
  ADD CONSTRAINT `bank_withdrawals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_withdrawals_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_withdrawals_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_withdrawals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bank_withdrawals_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_withdrawals_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bank_withdrawals_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `bills_of_materials`
--
ALTER TABLE `bills_of_materials`
  ADD CONSTRAINT `bills_of_materials_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bom_items`
--
ALTER TABLE `bom_items`
  ADD CONSTRAINT `bom_items_bill_of_material_id_foreign` FOREIGN KEY (`bill_of_material_id`) REFERENCES `bills_of_materials` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bookings`
--
ALTER TABLE `bookings`
  ADD CONSTRAINT `bookings_dropoff_stop_id_foreign` FOREIGN KEY (`dropoff_stop_id`) REFERENCES `route_stops` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bookings_passenger_id_foreign` FOREIGN KEY (`passenger_id`) REFERENCES `passengers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bookings_pickup_stop_id_foreign` FOREIGN KEY (`pickup_stop_id`) REFERENCES `route_stops` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `bookings_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bookings_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `branches`
--
ALTER TABLE `branches`
  ADD CONSTRAINT `branches_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `chart_of_accounts`
--
ALTER TABLE `chart_of_accounts`
  ADD CONSTRAINT `chart_of_accounts_account_category_id_foreign` FOREIGN KEY (`account_category_id`) REFERENCES `account_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `chart_of_accounts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `chart_of_accounts_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `chart_of_accounts_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `checks`
--
ALTER TABLE `checks`
  ADD CONSTRAINT `checks_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `checks_cancelled_by_foreign` FOREIGN KEY (`cancelled_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_cashed_by_foreign` FOREIGN KEY (`cashed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `checks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_deposited_by_foreign` FOREIGN KEY (`deposited_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `checks_returned_by_foreign` FOREIGN KEY (`returned_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `company_owners`
--
ALTER TABLE `company_owners`
  ADD CONSTRAINT `company_owners_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `company_owners_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `contracts`
--
ALTER TABLE `contracts`
  ADD CONSTRAINT `contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contracts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `contracts_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contracts_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contract_analytics`
--
ALTER TABLE `contract_analytics`
  ADD CONSTRAINT `contract_analytics_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  ADD CONSTRAINT `contract_analytics_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`);

--
-- Constraints for table `contract_items`
--
ALTER TABLE `contract_items`
  ADD CONSTRAINT `contract_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contract_items_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cost_centers`
--
ALTER TABLE `cost_centers`
  ADD CONSTRAINT `cost_centers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `cost_centers_cost_center_category_id_foreign` FOREIGN KEY (`cost_center_category_id`) REFERENCES `cost_center_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `cost_centers_cost_center_type_id_foreign` FOREIGN KEY (`cost_center_type_id`) REFERENCES `cost_center_types` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `cost_centers_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `cost_center_categories`
--
ALTER TABLE `cost_center_categories`
  ADD CONSTRAINT `cost_center_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `customers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_contracts`
--
ALTER TABLE `customer_contracts`
  ADD CONSTRAINT `customer_contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_contracts_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_invoices`
--
ALTER TABLE `customer_invoices`
  ADD CONSTRAINT `customer_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_invoices_customer_contract_id_foreign` FOREIGN KEY (`customer_contract_id`) REFERENCES `customer_contracts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_invoices_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_invoice_cost_centers`
--
ALTER TABLE `customer_invoice_cost_centers`
  ADD CONSTRAINT `customer_invoice_cost_centers_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_invoice_cost_centers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_invoice_cost_centers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_invoice_cost_centers_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_invoice_items`
--
ALTER TABLE `customer_invoice_items`
  ADD CONSTRAINT `customer_invoice_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_invoice_items_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_invoice_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_invoice_items_item_unit_id_foreign` FOREIGN KEY (`item_unit_id`) REFERENCES `item_units` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_invoice_returns`
--
ALTER TABLE `customer_invoice_returns`
  ADD CONSTRAINT `customer_invoice_returns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  ADD CONSTRAINT `customer_invoice_returns_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `customer_invoice_returns_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`);

--
-- Constraints for table `customer_invoice_return_items`
--
ALTER TABLE `customer_invoice_return_items`
  ADD CONSTRAINT `customer_invoice_return_items_customer_invoice_item_id_foreign` FOREIGN KEY (`customer_invoice_item_id`) REFERENCES `customer_invoice_items` (`id`),
  ADD CONSTRAINT `customer_invoice_return_items_customer_invoice_return_id_foreign` FOREIGN KEY (`customer_invoice_return_id`) REFERENCES `customer_invoice_returns` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_payments`
--
ALTER TABLE `customer_payments`
  ADD CONSTRAINT `customer_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_payments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_payments_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_payments_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `custom_reports`
--
ALTER TABLE `custom_reports`
  ADD CONSTRAINT `custom_reports_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `drivers`
--
ALTER TABLE `drivers`
  ADD CONSTRAINT `drivers_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `drivers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `driver_salaries`
--
ALTER TABLE `driver_salaries`
  ADD CONSTRAINT `driver_salaries_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `driver_salaries_calculated_by_foreign` FOREIGN KEY (`calculated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `driver_salaries_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `driver_salaries_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `driver_salaries_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `employees`
--
ALTER TABLE `employees`
  ADD CONSTRAINT `employees_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employees_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employees_salary_structure_id_foreign` FOREIGN KEY (`salary_structure_id`) REFERENCES `salary_structures` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `employees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `employee_bonuses`
--
ALTER TABLE `employee_bonuses`
  ADD CONSTRAINT `employee_bonuses_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `employee_bonuses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_bonuses_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_bonuses_payroll_id_foreign` FOREIGN KEY (`payroll_id`) REFERENCES `payrolls` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `employee_contracts`
--
ALTER TABLE `employee_contracts`
  ADD CONSTRAINT `employee_contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_contracts_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `employee_deductions`
--
ALTER TABLE `employee_deductions`
  ADD CONSTRAINT `employee_deductions_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `employee_deductions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_deductions_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_deductions_payroll_id_foreign` FOREIGN KEY (`payroll_id`) REFERENCES `payrolls` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `employee_leaves`
--
ALTER TABLE `employee_leaves`
  ADD CONSTRAINT `employee_leaves_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `employee_leaves_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_leaves_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `employee_loans`
--
ALTER TABLE `employee_loans`
  ADD CONSTRAINT `employee_loans_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `employee_loans_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `employee_loans_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `equipment`
--
ALTER TABLE `equipment`
  ADD CONSTRAINT `equipment_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_equipment_category_id_foreign` FOREIGN KEY (`equipment_category_id`) REFERENCES `equipment_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `equipment_categories`
--
ALTER TABLE `equipment_categories`
  ADD CONSTRAINT `equipment_categories_accumulated_depreciation_account_id_foreign` FOREIGN KEY (`accumulated_depreciation_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_categories_asset_account_id_foreign` FOREIGN KEY (`asset_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_categories_depreciation_account_id_foreign` FOREIGN KEY (`depreciation_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_categories_fuel_expense_account_id_foreign` FOREIGN KEY (`fuel_expense_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_categories_maintenance_expense_account_id_foreign` FOREIGN KEY (`maintenance_expense_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `equipment_fuel`
--
ALTER TABLE `equipment_fuel`
  ADD CONSTRAINT `equipment_fuel_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_fuel_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_fuel_equipment_id_foreign` FOREIGN KEY (`equipment_id`) REFERENCES `equipment` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_fuel_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `equipment_maintenance`
--
ALTER TABLE `equipment_maintenance`
  ADD CONSTRAINT `equipment_maintenance_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_maintenance_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_maintenance_equipment_id_foreign` FOREIGN KEY (`equipment_id`) REFERENCES `equipment` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_maintenance_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `equipment_schedule`
--
ALTER TABLE `equipment_schedule`
  ADD CONSTRAINT `equipment_schedule_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_schedule_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_schedule_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `equipment_schedule_equipment_id_foreign` FOREIGN KEY (`equipment_id`) REFERENCES `equipment` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_schedule_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `equipment_spare_parts`
--
ALTER TABLE `equipment_spare_parts`
  ADD CONSTRAINT `equipment_spare_parts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  ADD CONSTRAINT `equipment_spare_parts_equipment_category_id_foreign` FOREIGN KEY (`equipment_category_id`) REFERENCES `equipment_categories` (`id`);

--
-- Constraints for table `e_invoices`
--
ALTER TABLE `e_invoices`
  ADD CONSTRAINT `e_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  ADD CONSTRAINT `e_invoices_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `e_invoices_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`);

--
-- Constraints for table `e_invoice_items`
--
ALTER TABLE `e_invoice_items`
  ADD CONSTRAINT `e_invoice_items_e_invoice_id_foreign` FOREIGN KEY (`e_invoice_id`) REFERENCES `e_invoices` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `financial_reports`
--
ALTER TABLE `financial_reports`
  ADD CONSTRAINT `financial_reports_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `financial_reports_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `financial_reports_generated_by_foreign` FOREIGN KEY (`generated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `financial_reports_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `finished_goods`
--
ALTER TABLE `finished_goods`
  ADD CONSTRAINT `finished_goods_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `finished_goods_recipients`
--
ALTER TABLE `finished_goods_recipients`
  ADD CONSTRAINT `finished_goods_recipients_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `finished_goods_recipients_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `finished_goods_warehouses`
--
ALTER TABLE `finished_goods_warehouses`
  ADD CONSTRAINT `finished_goods_warehouses_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `finished_goods_warehouses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `fiscal_years`
--
ALTER TABLE `fiscal_years`
  ADD CONSTRAINT `fiscal_years_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `fuel_logs`
--
ALTER TABLE `fuel_logs`
  ADD CONSTRAINT `fuel_logs_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fuel_logs_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `goods_receipt_notes`
--
ALTER TABLE `goods_receipt_notes`
  ADD CONSTRAINT `goods_receipt_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `goods_receipt_notes_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `goods_receipt_notes_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `goods_receipt_note_items`
--
ALTER TABLE `goods_receipt_note_items`
  ADD CONSTRAINT `goods_receipt_note_items_goods_receipt_note_id_foreign` FOREIGN KEY (`goods_receipt_note_id`) REFERENCES `goods_receipt_notes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `goods_receipt_note_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `goods_receipt_note_items_purchase_order_item_id_foreign` FOREIGN KEY (`purchase_order_item_id`) REFERENCES `purchase_order_items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `goods_receipt_note_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

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

--
-- Constraints for table `inventory_balances`
--
ALTER TABLE `inventory_balances`
  ADD CONSTRAINT `inventory_balances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `inventory_counts`
--
ALTER TABLE `inventory_counts`
  ADD CONSTRAINT `inventory_counts_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `inventory_counts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `inventory_counts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `inventory_counts_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`);

--
-- Constraints for table `inventory_count_items`
--
ALTER TABLE `inventory_count_items`
  ADD CONSTRAINT `inventory_count_items_count_id_foreign` FOREIGN KEY (`count_id`) REFERENCES `inventory_counts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `inventory_count_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  ADD CONSTRAINT `inventory_count_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `inventory_documents`
--
ALTER TABLE `inventory_documents`
  ADD CONSTRAINT `inventory_documents_customer_invoice_id_foreign` FOREIGN KEY (`customer_invoice_id`) REFERENCES `customer_invoices` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `inventory_documents_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `inventory_documents_ibfk_2` FOREIGN KEY (`document_type_id`) REFERENCES `inventory_document_types` (`id`),
  ADD CONSTRAINT `inventory_documents_ibfk_3` FOREIGN KEY (`from_warehouse_id`) REFERENCES `warehouses` (`id`),
  ADD CONSTRAINT `inventory_documents_ibfk_4` FOREIGN KEY (`to_warehouse_id`) REFERENCES `warehouses` (`id`),
  ADD CONSTRAINT `inventory_documents_ibfk_5` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `inventory_documents_ibfk_6` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `inventory_document_items`
--
ALTER TABLE `inventory_document_items`
  ADD CONSTRAINT `inventory_document_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `inventory_document_items_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `inventory_documents` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `inventory_document_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  ADD CONSTRAINT `inventory_document_items_ibfk_3` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `items`
--
ALTER TABLE `items`
  ADD CONSTRAINT `items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `items_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `item_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `items_primary_unit_id_foreign` FOREIGN KEY (`primary_unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `item_categories`
--
ALTER TABLE `item_categories`
  ADD CONSTRAINT `item_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `item_units`
--
ALTER TABLE `item_units`
  ADD CONSTRAINT `item_units_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `item_units_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `journals`
--
ALTER TABLE `journals`
  ADD CONSTRAINT `journals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `journal_details`
--
ALTER TABLE `journal_details`
  ADD CONSTRAINT `journal_details_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `journal_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `journal_details_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `journal_details_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `journal_entries`
--
ALTER TABLE `journal_entries`
  ADD CONSTRAINT `journal_entries_accounting_period_id_foreign` FOREIGN KEY (`accounting_period_id`) REFERENCES `accounting_periods` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `journal_entries_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `journal_entries_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `journal_entries_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `journal_entries_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `journal_entries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `journal_entries_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `journal_entries_journal_id_foreign` FOREIGN KEY (`journal_id`) REFERENCES `journals` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `k_p_i_metrics`
--
ALTER TABLE `k_p_i_metrics`
  ADD CONSTRAINT `k_p_i_metrics_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`);

--
-- Constraints for table `labor_allocations`
--
ALTER TABLE `labor_allocations`
  ADD CONSTRAINT `labor_allocations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `labor_allocations_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  ADD CONSTRAINT `labor_allocations_production_line_id_foreign` FOREIGN KEY (`production_line_id`) REFERENCES `production_lines` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `labor_allocations_work_station_id_foreign` FOREIGN KEY (`work_station_id`) REFERENCES `work_stations` (`id`);

--
-- Constraints for table `leave_approvals`
--
ALTER TABLE `leave_approvals`
  ADD CONSTRAINT `leave_approvals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `leave_approvals_leave_request_id_foreign` FOREIGN KEY (`leave_request_id`) REFERENCES `leave_requests` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `leave_balances`
--
ALTER TABLE `leave_balances`
  ADD CONSTRAINT `leave_balances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `leave_balances_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `leave_balances_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `leave_requests`
--
ALTER TABLE `leave_requests`
  ADD CONSTRAINT `leave_requests_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `leave_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `leave_requests_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `leave_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `leave_requests_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `leave_types`
--
ALTER TABLE `leave_types`
  ADD CONSTRAINT `leave_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `manufacturing_centers`
--
ALTER TABLE `manufacturing_centers`
  ADD CONSTRAINT `manufacturing_centers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `manufacturing_centers_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `manufacturing_centers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `manufacturing_centers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `menu_categories`
--
ALTER TABLE `menu_categories`
  ADD CONSTRAINT `menu_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `menu_categories_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `menu_items`
--
ALTER TABLE `menu_items`
  ADD CONSTRAINT `menu_items_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `menu_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `menu_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `menu_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `menu_items_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `menu_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `module_visibilities`
--
ALTER TABLE `module_visibilities`
  ADD CONSTRAINT `module_visibilities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `module_visibility_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `passenger_invoices`
--
ALTER TABLE `passenger_invoices`
  ADD CONSTRAINT `passenger_invoices_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `passenger_invoices_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `passenger_invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `passenger_invoices_passenger_id_foreign` FOREIGN KEY (`passenger_id`) REFERENCES `passengers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `passenger_invoices_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `passenger_invoices_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payments`
--
ALTER TABLE `payments`
  ADD CONSTRAINT `payments_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payments_passenger_invoice_id_foreign` FOREIGN KEY (`passenger_invoice_id`) REFERENCES `passenger_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payments_processed_by_foreign` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `payments_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payment_certificates`
--
ALTER TABLE `payment_certificates`
  ADD CONSTRAINT `payment_certificates_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `payment_certificates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_certificates_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_certificates_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `payment_certificates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_certificates_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payment_certificate_items`
--
ALTER TABLE `payment_certificate_items`
  ADD CONSTRAINT `payment_certificate_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_certificate_items_contract_item_id_foreign` FOREIGN KEY (`contract_item_id`) REFERENCES `contract_items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `payment_certificate_items_payment_certificate_id_foreign` FOREIGN KEY (`payment_certificate_id`) REFERENCES `payment_certificates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payrolls`
--
ALTER TABLE `payrolls`
  ADD CONSTRAINT `payrolls_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `payrolls_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payrolls_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payroll_items`
--
ALTER TABLE `payroll_items`
  ADD CONSTRAINT `payroll_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payroll_items_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payroll_items_payroll_id_foreign` FOREIGN KEY (`payroll_id`) REFERENCES `payrolls` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_batches`
--
ALTER TABLE `production_batches`
  ADD CONSTRAINT `production_batches_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_costs`
--
ALTER TABLE `production_costs`
  ADD CONSTRAINT `production_costs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_lines`
--
ALTER TABLE `production_lines`
  ADD CONSTRAINT `production_lines_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_lines_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `production_lines_manufacturing_center_id_foreign` FOREIGN KEY (`manufacturing_center_id`) REFERENCES `manufacturing_centers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_operations`
--
ALTER TABLE `production_operations`
  ADD CONSTRAINT `production_operations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_operations_operator_id_foreign` FOREIGN KEY (`operator_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `production_operations_production_order_id_foreign` FOREIGN KEY (`production_order_id`) REFERENCES `production_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_operations_work_station_id_foreign` FOREIGN KEY (`work_station_id`) REFERENCES `work_stations` (`id`);

--
-- Constraints for table `production_orders`
--
ALTER TABLE `production_orders`
  ADD CONSTRAINT `production_orders_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `production_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_orders_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `production_orders_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  ADD CONSTRAINT `production_orders_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  ADD CONSTRAINT `production_orders_production_line_id_foreign` FOREIGN KEY (`production_line_id`) REFERENCES `production_lines` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_orders_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `production_orders_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `production_plans`
--
ALTER TABLE `production_plans`
  ADD CONSTRAINT `production_plans_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_reports`
--
ALTER TABLE `production_reports`
  ADD CONSTRAINT `production_reports_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_reports_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `production_reports_manufacturing_center_id_foreign` FOREIGN KEY (`manufacturing_center_id`) REFERENCES `manufacturing_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_reports_production_line_id_foreign` FOREIGN KEY (`production_line_id`) REFERENCES `production_lines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `production_schedules`
--
ALTER TABLE `production_schedules`
  ADD CONSTRAINT `production_schedules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_schedules_production_line_id_foreign` FOREIGN KEY (`production_line_id`) REFERENCES `production_lines` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_schedules_production_order_id_foreign` FOREIGN KEY (`production_order_id`) REFERENCES `production_orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `production_sites_or_lines`
--
ALTER TABLE `production_sites_or_lines`
  ADD CONSTRAINT `production_sites_or_lines_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `production_sites_or_lines_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `projects`
--
ALTER TABLE `projects`
  ADD CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `projects_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `projects_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_analytics`
--
ALTER TABLE `project_analytics`
  ADD CONSTRAINT `project_analytics_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  ADD CONSTRAINT `project_analytics_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`);

--
-- Constraints for table `project_documents`
--
ALTER TABLE `project_documents`
  ADD CONSTRAINT `project_documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_documents_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_documents_uploaded_by_foreign` FOREIGN KEY (`uploaded_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_invoices`
--
ALTER TABLE `project_invoices`
  ADD CONSTRAINT `project_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_invoices_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_invoices_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_invoice_items`
--
ALTER TABLE `project_invoice_items`
  ADD CONSTRAINT `project_invoice_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_invoice_items_project_invoice_id_foreign` FOREIGN KEY (`project_invoice_id`) REFERENCES `project_invoices` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_material_issue_headers`
--
ALTER TABLE `project_material_issue_headers`
  ADD CONSTRAINT `project_material_issue_headers_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_material_issue_headers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_material_issue_headers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_material_issue_headers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  ADD CONSTRAINT `project_material_issue_headers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `project_material_issue_headers_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_material_issue_headers_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`),
  ADD CONSTRAINT `project_material_issue_headers_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`);

--
-- Constraints for table `project_material_issue_lines`
--
ALTER TABLE `project_material_issue_lines`
  ADD CONSTRAINT `project_material_issue_lines_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_material_issue_lines_header_id_foreign` FOREIGN KEY (`header_id`) REFERENCES `project_material_issue_headers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_material_issue_lines_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  ADD CONSTRAINT `project_material_issue_lines_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `project_phases`
--
ALTER TABLE `project_phases`
  ADD CONSTRAINT `project_phases_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_phases_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  ADD CONSTRAINT `project_phases_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_resources`
--
ALTER TABLE `project_resources`
  ADD CONSTRAINT `project_resources_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_resources_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_resources_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_returns`
--
ALTER TABLE `project_returns`
  ADD CONSTRAINT `project_returns_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_returns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_returns_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_returns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_returns_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_return_items`
--
ALTER TABLE `project_return_items`
  ADD CONSTRAINT `project_return_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_return_items_project_return_id_foreign` FOREIGN KEY (`project_return_id`) REFERENCES `project_returns` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_risks`
--
ALTER TABLE `project_risks`
  ADD CONSTRAINT `project_risks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_risks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_risks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `project_tasks`
--
ALTER TABLE `project_tasks`
  ADD CONSTRAINT `project_tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `project_tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `project_tasks_project_phase_id_foreign` FOREIGN KEY (`project_phase_id`) REFERENCES `project_phases` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `purchase_budgets`
--
ALTER TABLE `purchase_budgets`
  ADD CONSTRAINT `purchase_budgets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD CONSTRAINT `purchase_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_orders_requisition_id_foreign` FOREIGN KEY (`requisition_id`) REFERENCES `purchase_requisitions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `purchase_orders_supplier_contract_id_foreign` FOREIGN KEY (`supplier_contract_id`) REFERENCES `supplier_contracts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `purchase_orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `purchase_order_items`
--
ALTER TABLE `purchase_order_items`
  ADD CONSTRAINT `purchase_order_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `purchase_order_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_order_items_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_order_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `purchase_requisitions`
--
ALTER TABLE `purchase_requisitions`
  ADD CONSTRAINT `purchase_requisitions_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `purchase_requisitions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_requisitions_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `purchase_requisition_items`
--
ALTER TABLE `purchase_requisition_items`
  ADD CONSTRAINT `purchase_requisition_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `purchase_requisition_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_requisition_items_purchase_requisition_id_foreign` FOREIGN KEY (`purchase_requisition_id`) REFERENCES `purchase_requisitions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_requisition_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `purchase_returns`
--
ALTER TABLE `purchase_returns`
  ADD CONSTRAINT `purchase_returns_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_returns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_returns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_returns_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_returns_supplier_invoice_id_foreign` FOREIGN KEY (`supplier_invoice_id`) REFERENCES `supplier_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_returns_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `purchase_return_items`
--
ALTER TABLE `purchase_return_items`
  ADD CONSTRAINT `purchase_return_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_return_items_purchase_return_id_foreign` FOREIGN KEY (`purchase_return_id`) REFERENCES `purchase_returns` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_return_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quality_checklists`
--
ALTER TABLE `quality_checklists`
  ADD CONSTRAINT `quality_checklists_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quality_checklists_quality_standard_id_foreign` FOREIGN KEY (`quality_standard_id`) REFERENCES `quality_standards` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quality_controls`
--
ALTER TABLE `quality_controls`
  ADD CONSTRAINT `quality_controls_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quality_controls_inspector_id_foreign` FOREIGN KEY (`inspector_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `quality_controls_production_order_id_foreign` FOREIGN KEY (`production_order_id`) REFERENCES `production_orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quality_standards`
--
ALTER TABLE `quality_standards`
  ADD CONSTRAINT `quality_standards_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quality_standards_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `quality_standards_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `quotations`
--
ALTER TABLE `quotations`
  ADD CONSTRAINT `quotations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotations_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quotation_items`
--
ALTER TABLE `quotation_items`
  ADD CONSTRAINT `quotation_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotation_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `quotation_requests`
--
ALTER TABLE `quotation_requests`
  ADD CONSTRAINT `quotation_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quotation_request_items`
--
ALTER TABLE `quotation_request_items`
  ADD CONSTRAINT `quotation_request_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotation_request_items_quotation_request_id_foreign` FOREIGN KEY (`quotation_request_id`) REFERENCES `quotation_requests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotation_request_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`);

--
-- Constraints for table `quotation_request_suppliers`
--
ALTER TABLE `quotation_request_suppliers`
  ADD CONSTRAINT `quotation_request_suppliers_quotation_request_id_foreign` FOREIGN KEY (`quotation_request_id`) REFERENCES `quotation_requests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quotation_request_suppliers_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `raw_materials_warehouses`
--
ALTER TABLE `raw_materials_warehouses`
  ADD CONSTRAINT `raw_materials_warehouses_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `raw_materials_warehouses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `raw_material_issues`
--
ALTER TABLE `raw_material_issues`
  ADD CONSTRAINT `raw_material_issues_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `raw_material_issues_issued_by_foreign` FOREIGN KEY (`issued_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `raw_material_issues_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  ADD CONSTRAINT `raw_material_issues_manufacturing_center_id_foreign` FOREIGN KEY (`manufacturing_center_id`) REFERENCES `manufacturing_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `raw_material_issues_production_order_id_foreign` FOREIGN KEY (`production_order_id`) REFERENCES `production_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `raw_material_issues_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `raw_material_issues_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `report_executions`
--
ALTER TABLE `report_executions`
  ADD CONSTRAINT `report_executions_custom_report_id_foreign` FOREIGN KEY (`custom_report_id`) REFERENCES `custom_reports` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `report_executions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `restaurants`
--
ALTER TABLE `restaurants`
  ADD CONSTRAINT `restaurants_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `restaurant_branches`
--
ALTER TABLE `restaurant_branches`
  ADD CONSTRAINT `restaurant_branches_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_branches_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_branches_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `restaurant_invoices`
--
ALTER TABLE `restaurant_invoices`
  ADD CONSTRAINT `restaurant_invoices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_invoices_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_invoices_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_invoices_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `restaurant_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_invoices_pos_terminal_id_foreign` FOREIGN KEY (`pos_terminal_id`) REFERENCES `restaurant_pos_terminals` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `restaurant_orders`
--
ALTER TABLE `restaurant_orders`
  ADD CONSTRAINT `restaurant_orders_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_orders_pos_terminal_id_foreign` FOREIGN KEY (`pos_terminal_id`) REFERENCES `restaurant_pos_terminals` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_orders_staff_id_foreign` FOREIGN KEY (`staff_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_orders_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `restaurant_tables` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `restaurant_order_items`
--
ALTER TABLE `restaurant_order_items`
  ADD CONSTRAINT `restaurant_order_items_menu_item_id_foreign` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`),
  ADD CONSTRAINT `restaurant_order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `restaurant_orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `restaurant_payments`
--
ALTER TABLE `restaurant_payments`
  ADD CONSTRAINT `restaurant_payments_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `restaurant_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_payments_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_payments_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`);

--
-- Constraints for table `restaurant_pos_terminals`
--
ALTER TABLE `restaurant_pos_terminals`
  ADD CONSTRAINT `restaurant_pos_terminals_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_pos_terminals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_pos_terminals_default_customer_id_foreign` FOREIGN KEY (`default_customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_pos_terminals_default_warehouse_id_foreign` FOREIGN KEY (`default_warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_pos_terminals_staff_user_id_foreign` FOREIGN KEY (`staff_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `restaurant_pos_terminals_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`),
  ADD CONSTRAINT `restaurant_pos_terminals_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`);

--
-- Constraints for table `restaurant_reservations`
--
ALTER TABLE `restaurant_reservations`
  ADD CONSTRAINT `restaurant_reservations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_reservations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_reservations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_reservations_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `restaurant_tables` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `restaurant_staff`
--
ALTER TABLE `restaurant_staff`
  ADD CONSTRAINT `restaurant_staff_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_staff_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_staff_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `restaurant_tables`
--
ALTER TABLE `restaurant_tables`
  ADD CONSTRAINT `restaurant_tables_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `restaurant_branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `restaurant_tables_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `roles`
--
ALTER TABLE `roles`
  ADD CONSTRAINT `roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `role_permission`
--
ALTER TABLE `role_permission`
  ADD CONSTRAINT `role_permission_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_permission_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `routes`
--
ALTER TABLE `routes`
  ADD CONSTRAINT `routes_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `salary_structures`
--
ALTER TABLE `salary_structures`
  ADD CONSTRAINT `salary_structures_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `scrap_materials`
--
ALTER TABLE `scrap_materials`
  ADD CONSTRAINT `scrap_materials_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscriptions_subscription_plan_id_foreign` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`);

--
-- Constraints for table `subscription_invoices`
--
ALTER TABLE `subscription_invoices`
  ADD CONSTRAINT `subscription_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscription_invoices_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscription_logs`
--
ALTER TABLE `subscription_logs`
  ADD CONSTRAINT `subscription_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscription_logs_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscription_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD CONSTRAINT `suppliers_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `suppliers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supplier_contracts`
--
ALTER TABLE `supplier_contracts`
  ADD CONSTRAINT `supplier_contracts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_contracts_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_contracts_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supplier_invoices`
--
ALTER TABLE `supplier_invoices`
  ADD CONSTRAINT `supplier_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_invoices_supplier_contract_id_foreign` FOREIGN KEY (`supplier_contract_id`) REFERENCES `supplier_contracts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_invoices_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_invoices_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `supplier_invoice_items`
--
ALTER TABLE `supplier_invoice_items`
  ADD CONSTRAINT `supplier_invoice_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_invoice_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_invoice_items_item_unit_id_foreign` FOREIGN KEY (`item_unit_id`) REFERENCES `item_units` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_invoice_items_supplier_invoice_id_foreign` FOREIGN KEY (`supplier_invoice_id`) REFERENCES `supplier_invoices` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supplier_payments`
--
ALTER TABLE `supplier_payments`
  ADD CONSTRAINT `supplier_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_payments_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplier_payments_supplier_invoice_id_foreign` FOREIGN KEY (`supplier_invoice_id`) REFERENCES `supplier_invoices` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `supplier_payments_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `tasks`
--
ALTER TABLE `tasks`
  ADD CONSTRAINT `tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tax_declarations`
--
ALTER TABLE `tax_declarations`
  ADD CONSTRAINT `tax_declarations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `translations`
--
ALTER TABLE `translations`
  ADD CONSTRAINT `translations_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `translations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `translations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `translations_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `translations_translation_key_id_foreign` FOREIGN KEY (`translation_key_id`) REFERENCES `translation_keys` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `translation_history`
--
ALTER TABLE `translation_history`
  ADD CONSTRAINT `translation_history_changed_by_foreign` FOREIGN KEY (`changed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `translation_history_translation_id_foreign` FOREIGN KEY (`translation_id`) REFERENCES `translations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transport_companies`
--
ALTER TABLE `transport_companies`
  ADD CONSTRAINT `transport_companies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasuries`
--
ALTER TABLE `treasuries`
  ADD CONSTRAINT `treasuries_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasuries_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `treasuries_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasuries_responsible_user_id_foreign` FOREIGN KEY (`responsible_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `treasury_deposits`
--
ALTER TABLE `treasury_deposits`
  ADD CONSTRAINT `treasury_deposits_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_deposits_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_deposits_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_deposits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_deposits_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_deposits_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_deposits_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_deposits_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_deposits_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasury_deposit_cost_centers`
--
ALTER TABLE `treasury_deposit_cost_centers`
  ADD CONSTRAINT `treasury_deposit_cost_centers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_deposit_cost_centers_treasury_deposit_id_foreign` FOREIGN KEY (`treasury_deposit_id`) REFERENCES `treasury_deposits` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasury_payments`
--
ALTER TABLE `treasury_payments`
  ADD CONSTRAINT `treasury_payments_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_payments_cash_account_id_foreign` FOREIGN KEY (`cash_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_payments_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_payments_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_payments_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasury_payment_cost_centers`
--
ALTER TABLE `treasury_payment_cost_centers`
  ADD CONSTRAINT `treasury_payment_cost_centers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_payment_cost_centers_treasury_payment_id_foreign` FOREIGN KEY (`treasury_payment_id`) REFERENCES `treasury_payments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasury_transactions`
--
ALTER TABLE `treasury_transactions`
  ADD CONSTRAINT `treasury_transactions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transactions_treasury_id_foreign` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treasury_transfers`
--
ALTER TABLE `treasury_transfers`
  ADD CONSTRAINT `treasury_transfers_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `treasury_transfers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transfers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transfers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transfers_from_treasury_id_foreign` FOREIGN KEY (`from_treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `treasury_transfers_to_treasury_id_foreign` FOREIGN KEY (`to_treasury_id`) REFERENCES `treasuries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `trips`
--
ALTER TABLE `trips`
  ADD CONSTRAINT `trips_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trips_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trips_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trips_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `trip_stops`
--
ALTER TABLE `trip_stops`
  ADD CONSTRAINT `trip_stops_route_stop_id_foreign` FOREIGN KEY (`route_stop_id`) REFERENCES `route_stops` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trip_stops_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `units`
--
ALTER TABLE `units`
  ADD CONSTRAINT `units_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_languages`
--
ALTER TABLE `user_languages`
  ADD CONSTRAINT `user_languages_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_languages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_permission`
--
ALTER TABLE `user_permission`
  ADD CONSTRAINT `user_permission_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_permission_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_role`
--
ALTER TABLE `user_role`
  ADD CONSTRAINT `user_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_role_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variation_orders`
--
ALTER TABLE `variation_orders`
  ADD CONSTRAINT `variation_orders_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `variation_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `variation_orders_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `variation_orders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variation_order_items`
--
ALTER TABLE `variation_order_items`
  ADD CONSTRAINT `variation_order_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `variation_order_items_contract_item_id_foreign` FOREIGN KEY (`contract_item_id`) REFERENCES `contract_items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `variation_order_items_variation_order_id_foreign` FOREIGN KEY (`variation_order_id`) REFERENCES `variation_orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD CONSTRAINT `vehicles_transport_company_id_foreign` FOREIGN KEY (`transport_company_id`) REFERENCES `transport_companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `vehicles_vehicle_type_id_foreign` FOREIGN KEY (`vehicle_type_id`) REFERENCES `vehicle_types` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `vehicle_types`
--
ALTER TABLE `vehicle_types`
  ADD CONSTRAINT `vehicle_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `warehouses`
--
ALTER TABLE `warehouses`
  ADD CONSTRAINT `warehouses_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`),
  ADD CONSTRAINT `warehouses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `warehouse_managers`
--
ALTER TABLE `warehouse_managers`
  ADD CONSTRAINT `warehouse_managers_ibfk_1` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `warehouse_managers_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `warehouse_managers_ibfk_3` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `warehouse_managers_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `work_in_progresses`
--
ALTER TABLE `work_in_progresses`
  ADD CONSTRAINT `work_in_progresses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `work_stations`
--
ALTER TABLE `work_stations`
  ADD CONSTRAINT `work_stations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `work_stations_production_line_id_foreign` FOREIGN KEY (`production_line_id`) REFERENCES `production_lines` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `zakat_calculations`
--
ALTER TABLE `zakat_calculations`
  ADD CONSTRAINT `zakat_calculations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `zakat_calculations_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `zatca_operations`
--
ALTER TABLE `zatca_operations`
  ADD CONSTRAINT `zatca_operations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;
COMMIT;

