-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `farmtoapmc`
--

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

--
-- Table structure for table `addresses`
--

CREATE TABLE `addresses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `address_type` enum('Permanent','Current','Office','Market','Warehouse') DEFAULT 'Permanent',
  `village` varchar(100) DEFAULT NULL,
  `city` varchar(100) NOT NULL,
  `taluka` varchar(100) DEFAULT NULL,
  `district` varchar(100) NOT NULL,
  `state` varchar(100) NOT NULL,
  `pin_code` char(6) NOT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT 0,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `addresses`
--

INSERT INTO `addresses` (`id`, `user_id`, `address_type`, `village`, `city`, `taluka`, `district`, `state`, `pin_code`, `latitude`, `longitude`, `is_default`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 2, 'Permanent', 'Rannagar', 'manglar', 'Kuba', 'Azamgarh', 'Uttar Pradesh', '276203', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-06 08:40:47', '2026-01-06 08:40:47', NULL),
(2, 4, 'Permanent', 'Rannagar', 'manglar', 'Kuba', 'Azamgarh', 'Uttar Pradesh', '276203', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-06 08:41:57', '2026-01-06 08:41:57', NULL),
(3, 6, 'Permanent', 'Rannagar', 'manglar', 'Kuba', 'Azamgarh', 'Uttar Pradesh', '276203', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-06 08:43:02', '2026-01-06 08:43:02', NULL),
(4, 8, 'Permanent', 'Rannagar', 'manglar', 'Kuba', 'Azamgarh', 'Uttar Pradesh', '276203', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-06 08:47:58', '2026-01-06 08:47:58', NULL),
(5, 10, 'Permanent', 'Rannagar', 'manglar', 'Kuba', 'Azamgarh', 'Uttar Pradesh', '276203', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-13 10:26:33', '2026-01-13 10:26:33', NULL),
(6, 14, 'Permanent', 'pune', 'pune', 'pune', 'pune', 'pune', '400070', NULL, NULL, 0, NULL, NULL, NULL, '2026-01-19 12:18:12', '2026-01-19 12:18:12', NULL),
(7, 15, 'Permanent', 'pune', 'pune', 'pune', 'pune', 'pune', '400070', NULL, NULL, 0, NULL, NULL, NULL, '2026-06-17 14:04:09', '2026-06-17 14:04:09', NULL);

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

--
-- Table structure for table `apmc_master`
--

CREATE TABLE `apmc_master` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `apmc_name` varchar(255) NOT NULL,
  `address_line1` varchar(255) DEFAULT NULL,
  `address_line2` varchar(255) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `district` varchar(100) DEFAULT NULL,
  `state` varchar(100) DEFAULT NULL,
  `pincode` varchar(10) DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `apmc_master`
--

INSERT INTO `apmc_master` (`id`, `apmc_name`, `address_line1`, `address_line2`, `city`, `district`, `state`, `pincode`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'APMC Vashi', 'Sector 19', 'Vashi Market Yard', 'Navi Mumbai', 'Thane', 'Maharashtra', '400703', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(2, 'APMC Pune', 'Market Yard', 'Gultekdi', 'Pune', 'Pune', 'Maharashtra', '411037', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(3, 'APMC Nagpur', 'Kalamna Market', 'Kalamna', 'Nagpur', 'Nagpur', 'Maharashtra', '440008', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(4, 'APMC Nashik', 'Panchavati', 'Dindori Road', 'Nashik', 'Nashik', 'Maharashtra', '422003', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(5, 'APMC Kolhapur', 'Shivaji Market Yard', 'Shiroli', 'Kolhapur', 'Kolhapur', 'Maharashtra', '416122', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(6, 'APMC Aurangabad', 'CIDCO Market Yard', 'CIDCO', 'Aurangabad', 'Aurangabad', 'Maharashtra', '431003', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(7, 'APMC Solapur', 'Market Yard', 'Hotgi Road', 'Solapur', 'Solapur', 'Maharashtra', '413003', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL),
(8, 'APMC Jalgaon', 'Market Yard', 'Ajanta Road', 'Jalgaon', 'Jalgaon', 'Maharashtra', '425001', 1, NULL, NULL, '2026-03-16 14:08:27', '2026-03-16 14:08:27', NULL);

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

--
-- Table structure for table `crops`
--

CREATE TABLE `crops` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `crop_name` varchar(100) NOT NULL,
  `slug` varchar(150) DEFAULT NULL,
  `crop_category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `default_measure_unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `image_url` varchar(255) DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `crops`
--

INSERT INTO `crops` (`id`, `crop_name`, `slug`, `crop_category_id`, `default_measure_unit_id`, `image_url`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Wheat', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(2, 'Rice (Paddy)', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(3, 'Maize', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(4, 'Barley', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(5, 'Jowar', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(6, 'Bajra', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(7, 'Ragi', NULL, 1, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:14:54', '2025-12-17 02:14:54', NULL),
(8, 'Tur Dal (Arhar)', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(9, 'Moong Dal', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(10, 'Urad Dal', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(11, 'Chana', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(12, 'Masoor', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(13, 'Peas', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(14, 'Rajma', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(15, 'Horse Gram', NULL, 2, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:18', '2025-12-17 02:15:18', NULL),
(16, 'Soybean', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(17, 'Mustard', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(18, 'Groundnut', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(19, 'Sunflower', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(20, 'Sesame (Til)', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(21, 'Linseed', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(22, 'Castor Seed', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(23, 'Niger Seed', NULL, 3, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:31', '2025-12-17 02:15:31', NULL),
(24, 'Potato', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(25, 'Onion', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(26, 'Tomato', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(27, 'Brinjal', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(28, 'Cabbage', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(29, 'Cauliflower', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(30, 'Lady Finger (Okra)', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(31, 'Green Chilli', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(32, 'Carrot', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(33, 'Beans', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(34, 'Bottle Gourd', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(35, 'Bitter Gourd', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(36, 'Pumpkin', NULL, 4, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:15:44', '2025-12-17 02:15:44', NULL),
(37, 'Apple', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(38, 'Banana', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(39, 'Mango', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(40, 'Orange', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(41, 'Grapes', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(42, 'Papaya', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(43, 'Pomegranate', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(44, 'Guava', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(45, 'Pineapple', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(46, 'Watermelon', NULL, 5, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:04', '2025-12-17 02:16:04', NULL),
(47, 'Dry Chilli', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(48, 'Green Chilli', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(49, 'Turmeric', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(50, 'Ginger', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(51, 'Coriander', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(52, 'Cumin (Jeera)', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(53, 'Fenugreek (Methi)', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(54, 'Garlic', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(55, 'Clove', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(56, 'Black Pepper', NULL, 6, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:19', '2025-12-17 02:16:19', NULL),
(57, 'Cotton', NULL, 7, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:35', '2025-12-17 02:16:35', NULL),
(58, 'Jute', NULL, 7, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:35', '2025-12-17 02:16:35', NULL),
(59, 'Mesta', NULL, 7, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:35', '2025-12-17 02:16:35', NULL),
(60, 'Sugarcane', NULL, 8, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:48', '2025-12-17 02:16:48', NULL),
(61, 'Tea', NULL, 8, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:48', '2025-12-17 02:16:48', NULL),
(62, 'Coffee', NULL, 8, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:48', '2025-12-17 02:16:48', NULL),
(63, 'Tobacco', NULL, 8, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:48', '2025-12-17 02:16:48', NULL),
(64, 'Rubber', NULL, 8, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:16:48', '2025-12-17 02:16:48', NULL),
(65, 'Cashew', NULL, 9, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:03', '2025-12-17 02:17:03', NULL),
(66, 'Almond', NULL, 9, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:03', '2025-12-17 02:17:03', NULL),
(67, 'Walnut', NULL, 9, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:03', '2025-12-17 02:17:03', NULL),
(68, 'Pistachio', NULL, 9, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:03', '2025-12-17 02:17:03', NULL),
(69, 'Raisins', NULL, 9, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:03', '2025-12-17 02:17:03', NULL),
(70, 'Berseem', NULL, 10, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:16', '2025-12-17 02:17:16', NULL),
(71, 'Maize Fodder', NULL, 10, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:16', '2025-12-17 02:17:16', NULL),
(72, 'Jowar Fodder', NULL, 10, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:16', '2025-12-17 02:17:16', NULL),
(73, 'Bajra Fodder', NULL, 10, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:16', '2025-12-17 02:17:16', NULL),
(74, 'Napier Grass', NULL, 10, 1, NULL, NULL, NULL, NULL, '2025-12-17 02:17:16', '2025-12-17 02:17:16', NULL);

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

--
-- Table structure for table `crop_categories`
--

CREATE TABLE `crop_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL,
  `category_name` varchar(100) NOT NULL,
  `slug` varchar(150) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `crop_categories`
--

INSERT INTO `crop_categories` (`id`, `parent_id`, `category_name`, `slug`, `description`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, NULL, 'Cereals', NULL, 'Food grain crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(2, NULL, 'Pulses', NULL, 'Dal and legume crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(3, NULL, 'Oilseeds', NULL, 'Oil producing crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(4, NULL, 'Vegetables', NULL, 'Fresh vegetable crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(5, NULL, 'Fruits', NULL, 'Horticulture fruit crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(6, NULL, 'Spices', NULL, 'Spices and condiments', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(7, NULL, 'Fibre Crops', NULL, 'Industrial fibre crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(8, NULL, 'Cash Crops', NULL, 'Commercial crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(9, NULL, 'Dry Fruits', NULL, 'Nut and dry fruit crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL),
(10, NULL, 'Fodder', NULL, 'Animal feed crops', NULL, NULL, NULL, '2025-12-17 02:01:33', '2025-12-17 02:01:33', NULL);

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

--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `document_type_id` bigint(20) UNSIGNED NOT NULL,
  `document_url` varchar(255) NOT NULL,
  `document_number` varchar(50) DEFAULT NULL,
  `status` enum('pending','verified','rejected') DEFAULT 'pending',
  `comment` text DEFAULT NULL,
  `approved_by` bigint(20) DEFAULT NULL,
  `rejected_by` bigint(20) DEFAULT NULL,
  `deleted_by` bigint(20) DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `updated_by` bigint(20) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `documents`
--

INSERT INTO `documents` (`id`, `user_id`, `document_type_id`, `document_url`, `document_number`, `status`, `comment`, `approved_by`, `rejected_by`, `deleted_by`, `created_by`, `updated_by`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 8, 1, 'farmers/kyc/develope_695cd20052925.PNG', NULL, 'pending', 'Pen card have problem', NULL, NULL, NULL, 8, NULL, NULL, '2026-01-06 09:12:32', '2026-01-06 11:44:58'),
(2, 8, 2, 'farmers/kyc/akino_695cd20055e8c.png', NULL, 'pending', 'you Aahar card is reject because the some to do some ting ', NULL, NULL, NULL, 8, NULL, NULL, '2026-01-06 09:12:32', '2026-01-06 11:45:06'),
(6, 14, 1, 'farmers/kyc/Gemini_Generated_Image_v6nuryv6nuryv6nu_696e253ec0274.png', NULL, 'pending', NULL, NULL, NULL, NULL, 14, NULL, NULL, '2026-01-19 12:36:14', '2026-01-19 12:36:14'),
(7, 14, 2, 'farmers/kyc/unsure_ai_bg.png (1)_696e253ec48e2.jfif', NULL, 'pending', NULL, NULL, NULL, NULL, 14, NULL, NULL, '2026-01-19 12:36:14', '2026-01-19 12:36:14'),
(8, 14, 3, 'farmers/kyc/unsure_ai_bg.png (2)_696e253ec5cf6.jpeg', NULL, 'verified', NULL, 1, NULL, NULL, 14, NULL, NULL, '2026-01-19 12:36:14', '2026-06-09 11:40:43'),
(9, 15, 1, 'farmers/kyc/Gemini_Generated_Image_v6nuryv6nuryv6nu_6a32aaa2ac56a.png', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, '2026-06-17 14:35:31', '2026-06-17 14:09:40', '2026-06-17 14:35:31'),
(10, 15, 2, 'farmers/kyc/unsure_ai_bg.png (1)_6a32aaa44367b.jfif', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, '2026-06-17 14:35:31', '2026-06-17 14:09:40', '2026-06-17 14:35:31'),
(11, 15, 3, 'farmers/kyc/unsure_ai_bg.png (2)_6a32aaa445c84.jpeg', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, '2026-06-17 14:35:31', '2026-06-17 14:09:40', '2026-06-17 14:35:31'),
(12, 15, 1, 'farmers/kyc/Gemini_Generated_Image_v6nuryv6nuryv6nu_6a32b0b36eebe.png', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, NULL, '2026-06-17 14:35:31', '2026-06-17 14:35:31'),
(13, 15, 2, 'farmers/kyc/unsure_ai_bg.png (1)_6a32b0b37b408.jfif', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, NULL, '2026-06-17 14:35:31', '2026-06-17 14:35:31'),
(14, 15, 3, 'farmers/kyc/unsure_ai_bg.png (2)_6a32b0b37e84d.jpeg', NULL, 'pending', NULL, NULL, NULL, NULL, 15, NULL, NULL, '2026-06-17 14:35:31', '2026-06-17 14:35:31');

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

--
-- Table structure for table `document_types`
--

CREATE TABLE `document_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `type_name` varchar(100) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `document_types`
--

INSERT INTO `document_types` (`id`, `type_name`, `description`, `is_active`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Pan Card', NULL, 1, NULL, NULL, NULL, '2026-01-06 09:10:40', '2026-01-06 09:10:40', NULL),
(2, 'Aadhar Card', NULL, 1, NULL, NULL, NULL, '2026-01-06 09:10:40', '2026-01-06 09:10:40', NULL),
(3, 'GST Certificate', NULL, 1, NULL, NULL, NULL, '2026-01-19 12:35:13', '2026-01-19 12:35:13', NULL);

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

--
-- Table structure for table `enquiry`
--

CREATE TABLE `enquiry` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(10) NOT NULL,
  `email` varchar(150) DEFAULT NULL,
  `address` varchar(500) NOT NULL,
  `message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

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

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

--
-- Table structure for table `farmers`
--

CREATE TABLE `farmers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `first_name` varchar(100) DEFAULT NULL,
  `middle_name` varchar(100) DEFAULT NULL,
  `last_name` varchar(100) DEFAULT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` enum('male','female','other') DEFAULT 'male',
  `profile_image` varchar(255) DEFAULT NULL,
  `land_area` decimal(10,2) DEFAULT NULL,
  `ownership_type` varchar(100) DEFAULT NULL,
  `main_crops` text DEFAULT NULL,
  `where_do_you_sell` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `status` enum('pending','approved','rejected','comment') DEFAULT 'pending',
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `farmers`
--

INSERT INTO `farmers` (`id`, `user_id`, `first_name`, `middle_name`, `last_name`, `phone`, `date_of_birth`, `gender`, `profile_image`, `land_area`, `ownership_type`, `main_crops`, `where_do_you_sell`, `is_active`, `status`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 2, 'Ram', 'Manohar', 'Kushwaha', '8877445594', '1980-01-01', 'male', NULL, NULL, NULL, '', NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-06 08:40:47', '2026-01-06 08:40:47', NULL),
(2, 4, 'Ram', 'Manohar', 'Kushwaha', '8877485594', '1980-01-01', 'male', NULL, NULL, NULL, '', NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-06 08:41:57', '2026-01-06 08:41:57', NULL),
(3, 6, 'Ram', 'Manohar', 'Kushwaha', '8877485593', '1980-01-01', 'male', NULL, NULL, NULL, '', NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-06 08:43:02', '2026-01-06 08:43:02', NULL),
(4, 8, 'Ram', 'Manohar', 'Kushwaha', '8877885593', '1980-01-01', 'male', NULL, 100.00, NULL, '', 'local vendero', 1, 'pending', NULL, NULL, NULL, '2026-01-06 08:47:58', '2026-01-06 09:12:32', NULL),
(5, 8, 'Ram', 'Manohar', 'Kushwaha', '8877885593', '1980-01-01', 'male', NULL, NULL, NULL, '', NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-06 08:47:58', '2026-01-06 08:47:58', NULL),
(6, 10, 'Ram', 'Manohar', 'Kushwaha', '9874563210', '1980-01-01', 'male', NULL, NULL, NULL, NULL, NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-13 10:26:33', '2026-01-13 10:26:33', NULL),
(7, 10, 'Ram', 'Manohar', 'Kushwaha', '9874563210', '1980-01-01', 'male', NULL, NULL, NULL, NULL, NULL, 1, 'pending', NULL, NULL, NULL, '2026-01-13 10:26:33', '2026-01-13 10:26:33', NULL);

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

--
-- Table structure for table `farmers_crop`
--

CREATE TABLE `farmers_crop` (
  `id` int(11) NOT NULL,
  `primary_image` varchar(255) DEFAULT NULL,
  `image_urls` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `farmer_id` int(11) NOT NULL,
  `crop_id` int(11) NOT NULL,
  `variety` varchar(100) DEFAULT NULL,
  `grade` enum('A','B','C') NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `quantity_unit` enum('Kg','Quintal','Ton') DEFAULT 'Kg',
  `expected_price_per_unit` decimal(10,2) NOT NULL,
  `status` enum('Available','Sold','Cancelled') DEFAULT 'Available',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `farmers_crop`
--

INSERT INTO `farmers_crop` (`id`, `primary_image`, `image_urls`, `farmer_id`, `crop_id`, `variety`, `grade`, `quantity`, `quantity_unit`, `expected_price_per_unit`, `status`, `created_at`, `updated_at`) VALUES
(2, 'farmer-crops/primary-images/ChatGPT Image Jan 6, 2026, 06_02_27 PM_696a2cd519a90.png', '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/Gemini_Generated_Image_wfxbopwfxbopwfxb_696a2cd51a8b6.png\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/Gemini_Generated_Image_v6nuryv6nuryv6nu_696a2cd51b03e.png\\\"]\"', 8, 2, 'uhiuhiuhsi', 'A', 2.00, 'Kg', 3456.00, 'Sold', '2026-01-16 11:37:24', '2026-01-16 12:19:33'),
(3, 'farmer-crops/primary-images/curated_bundles_696a234758a0f.png', '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/unsure_ai_bg.png (2)_696a23475c50b.jpeg\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/Symbol_Neozar_For White Background (1)_696a23475cb48.png\\\"]\"', 8, 3, 'uhiuhiuhsi', 'A', 2.00, 'Kg', 2435.00, 'Available', '2026-01-16 11:38:47', '2026-01-16 11:38:47'),
(4, 'farmer-crops/primary-images/curated_bundles_696a23bf40280.png', '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/unsure_ai_bg.png (2)_696a23bf43ef5.jpeg\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/Symbol_Neozar_For White Background (1)_696a23bf445ee.png\\\"]\"', 8, 4, 'uhiuhiuhsi', 'A', 2.00, 'Kg', 2435.00, 'Available', '2026-01-16 11:40:47', '2026-06-23 05:53:09'),
(6, NULL, '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/chahbanner_696e33a124e1d.PNG\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/20250112190239_makar_696e33a12b0ba.webp\\\"]\"', 10, 6, NULL, 'A', 287.00, 'Kg', 40.00, 'Available', '2026-01-19 13:37:37', '2026-01-19 13:37:37'),
(7, NULL, '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/chahbanner_696e33aea5264.PNG\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/20250112190239_makar_696e33aea7615.webp\\\"]\"', 10, 5, NULL, 'A', 287.00, 'Kg', 40.00, 'Available', '2026-01-19 13:37:50', '2026-01-19 13:37:50'),
(8, NULL, '\"[\\\"farmer-crops\\\\\\/additional-images\\\\\\/chahbanner_696e33b6adbe4.PNG\\\",\\\"farmer-crops\\\\\\/additional-images\\\\\\/20250112190239_makar_696e33b6b0c0b.webp\\\"]\"', 10, 3, NULL, 'A', 287.00, 'Kg', 40.00, 'Available', '2026-01-19 13:37:58', '2026-01-19 13:37:58');

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

--
-- Table structure for table `interested_farmers`
--

CREATE TABLE `interested_farmers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `farmer_id` bigint(20) UNSIGNED NOT NULL,
  `vendor_rate_card_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `measure_unit_id` bigint(20) UNSIGNED NOT NULL,
  `status` enum('pending','contacted','negotiating','finalized','cancelled') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `interests`
--

CREATE TABLE `interests` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vendor_id` bigint(20) UNSIGNED NOT NULL,
  `farmer_id` bigint(20) UNSIGNED NOT NULL,
  `farmer_crop_id` bigint(20) UNSIGNED NOT NULL,
  `offered_price` decimal(10,2) DEFAULT NULL,
  `quantity` decimal(10,2) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `status` enum('pending','accepted','rejected','completed') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interests`
--

INSERT INTO `interests` (`id`, `vendor_id`, `farmer_id`, `farmer_crop_id`, `offered_price`, `quantity`, `message`, `status`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES
(1, 2, 8, 4, NULL, NULL, NULL, 'accepted', '2026-06-23 08:19:08', '2026-06-23 09:28:55', 8, 8),
(2, 2, 8, 2, 3456.00, 2.00, NULL, 'accepted', '2026-06-25 06:54:35', '2026-06-25 06:54:35', NULL, NULL);

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

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

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `job_batches`
--

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

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

--
-- Table structure for table `master_rate_card`
--

CREATE TABLE `master_rate_card` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `apmc_id` bigint(20) UNSIGNED NOT NULL,
  `crop_id` bigint(20) UNSIGNED NOT NULL,
  `measure_unit_id` bigint(20) UNSIGNED NOT NULL,
  `min_rate` decimal(10,2) NOT NULL,
  `max_rate` decimal(10,2) NOT NULL,
  `effective_from` date NOT NULL,
  `effective_to` date NOT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `master_rate_card`
--

INSERT INTO `master_rate_card` (`id`, `apmc_id`, `crop_id`, `measure_unit_id`, `min_rate`, `max_rate`, `effective_from`, `effective_to`, `is_active`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 5, 4, 1, 3.00, 4.00, '2026-03-16', '2026-03-17', 1, 1, NULL, NULL, '2026-03-16 14:13:34', '2026-03-16 14:13:34', NULL),
(2, 3, 14, 1, 7.00, 10.00, '2026-06-12', '2026-06-26', 1, 1, NULL, NULL, '2026-06-12 07:35:46', '2026-06-12 07:35:46', NULL),
(3, 2, 2, 1, 7.00, 8.70, '2026-06-13', '2026-06-14', 1, 1, NULL, NULL, '2026-06-13 09:01:48', '2026-06-13 09:01:48', NULL),
(4, 2, 3, 2, 9.00, 10.00, '2026-06-13', '2026-06-14', 1, 1, NULL, NULL, '2026-06-13 09:02:34', '2026-06-13 09:02:34', NULL);

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

--
-- Table structure for table `measure_units`
--

CREATE TABLE `measure_units` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `unit_name` varchar(50) NOT NULL,
  `short_code` varchar(10) DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `measure_units`
--

INSERT INTO `measure_units` (`id`, `unit_name`, `short_code`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Quintal', 'qntl', NULL, NULL, NULL, '2026-01-03 07:01:49', '2026-01-03 07:01:49', NULL),
(2, 'Kilogram', 'Kg', NULL, NULL, NULL, '2026-01-19 12:45:46', '2026-01-19 12:45:46', NULL);

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

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

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

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_09_25_055557_create_menus_table', 1),
(5, '2025_09_25_055557_create_roles_table', 1),
(6, '2025_09_25_055558_create_menu_actions_table', 1),
(7, '2025_09_25_055558_create_role_based_menus_table', 1),
(8, '2025_09_25_055601_create_role_based_menu_actions_table', 1),
(9, '2026_06_25_115209_add_columns_to_notifications_table', 2);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `type` varchar(100) DEFAULT NULL,
  `reference_id` bigint(20) UNSIGNED DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `user_id`, `title`, `message`, `type`, `reference_id`, `is_read`, `created_at`, `updated_at`) VALUES
(1, 15, 'Interest Updated', 'Farmer has accept your offer.', 'interest', 1, 0, '2026-06-23 08:54:51', '2026-06-23 08:54:51'),
(2, 8, 'Vendor Accepted Your Crop', 'rohit bansiwala has accepted your listing for Rice (Paddy).', 'interest', 2, 0, '2026-06-25 06:54:35', '2026-06-25 06:54:35');

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `alias` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `alias`, `is_active`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Super Admin', 'SA', 1, NULL, NULL, '2025-09-24 19:04:23', '2025-09-24 19:04:23', NULL),
(2, 'Farmer', 'FAR', 1, NULL, NULL, NULL, NULL, NULL),
(3, 'Vendor', 'VEND', 1, NULL, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `seo_pages`
--

CREATE TABLE `seo_pages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `page_name` varchar(255) NOT NULL,
  `page_url` varchar(255) NOT NULL,
  `meta_title` varchar(255) DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `meta_keywords` text DEFAULT NULL,
  `h1_title` varchar(255) DEFAULT NULL,
  `canonical_url` varchar(255) DEFAULT NULL,
  `schema_markup` longtext DEFAULT NULL,
  `og_title` varchar(255) DEFAULT NULL,
  `og_description` text DEFAULT NULL,
  `og_image` varchar(255) DEFAULT NULL,
  `twitter_title` varchar(255) DEFAULT NULL,
  `twitter_description` text DEFAULT NULL,
  `twitter_image` varchar(255) DEFAULT NULL,
  `is_index` tinyint(1) NOT NULL DEFAULT 1,
  `is_follow` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `seo_pages`
--

INSERT INTO `seo_pages` (`id`, `page_name`, `page_url`, `meta_title`, `meta_description`, `meta_keywords`, `h1_title`, `canonical_url`, `schema_markup`, `og_title`, `og_description`, `og_image`, `twitter_title`, `twitter_description`, `twitter_image`, `is_index`, `is_follow`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Home', '/', 'HairSkinMedix | Expert Hair & Skin Care Clinic', 'HairSkinMedix offers expert hair restoration, skin rejuvenation, and aesthetic treatments in India to help you restore confidence with personalized care', 'HairSkinMedix, Hair Treatment, Skin Clinic, Dermatologist, Hair Transplant, Laser Treatment, Skin Rejuvenation, Acne Care', 'Hair & Skin Care Experts in India', 'https://hairskinmedix.com/', '{\"@context\":\"https://schema.org\",\"@type\":\"MedicalBusiness\",\"name\":\"HairSkinMedix\",\"url\":\"https://hairskinmedix.com\",\"logo\":\"https://hairskinmedix.com/hsm-logo.png\",\"sameAs\":[\"https://www.facebook.com/HairSkinMedix\",\"https://www.instagram.com/hairskinmedix/\"],\"description\":\"HairSkinMedix offers advanced hair and skin treatments by certified dermatologists.\"}', 'HairSkinMedix | Expert Hair & Skin Care Clinic', 'Get premium hair restoration and skin rejuvenation treatments at HairSkinMedix — India’s trusted aesthetic clinic.', 'seo_og_images/hairskinmedix-logo-20251105213022.png', 'HairSkinMedix | Expert Hair & Skin Care Clinic', 'Experience the best in hair and skin care with HairSkinMedix.', 'seo_twitter_images/hairskinmedix-logo-20251105213022.png', 1, 1, 1, '2025-11-05 14:35:02', '2025-11-08 19:45:16'),
(2, 'About Us', '/about', 'About HairSkinMedix | Expert Dermatologists for Hair & Skin Treatments', 'Learn about HairSkinMedix — India’s leading clinic for hair transplant, skin rejuvenation, and laser treatments. Meet our expert dermatologists and discover our mission to bring confidence through beauty.', 'About HairSkinMedix, HairSkinMedix Doctors, Dermatologist Clinic, Hair Transplant Experts, Skin Specialists, Laser Treatment Center, Aesthetic Clinic India', 'About HairSkinMedix', 'https://hairskinmedix.com/about', '{\"@context\":\"https://schema.org\",\"@type\":\"MedicalBusiness\",\"name\":\"HairSkinMedix\",\"url\":\"https://hairskinmedix.com/about\",\"founder\":\"Dr. [Your Doctor’s Name]\",\"foundingDate\":\"2020\",\"description\":\"HairSkinMedix is dedicated to providing advanced dermatology and trichology services across India.\",\"sameAs\":[\"https://www.facebook.com/HairSkinMedix\",\"https://www.instagram.com/hairskinmedix/\"]}', 'About HairSkinMedix | India’s Trusted Hair & Skin Experts', 'Discover the story behind HairSkinMedix — a trusted name in dermatology and cosmetic care.', 'seo_og_images/hairskinmedix-logo-20251106112512.png', 'About HairSkinMedix | India’s Trusted Hair & Skin Experts', 'Learn about the HairSkinMedix team, values, and commitment to quality care.', 'seo_twitter_images/hairskinmedix-logo-20251106112512.png', 1, 1, 1, '2025-11-05 14:35:52', '2025-11-07 03:27:14'),
(3, 'Contact Us', '/contact-us', 'Contact HairSkinMedix | Book Your Hair & Skin Consultation Today', 'Get in touch with HairSkinMedix for expert consultation on hair transplant, skin rejuvenation, and cosmetic treatments. Call or visit our clinic to book your appointment today.', 'Contact HairSkinMedix, HairSkinMedix Clinic Contact, Book Hair Consultation, Skin Treatment Appointment, Hair Transplant Clinic India, HairSkinMedix Phone Number, HairSkinMedix Address', 'Contact HairSkinMedix', 'https://hairskinmedix.com/contact-us', '{\"@context\":\"https://schema.org\",\"@type\":\"ContactPage\",\"name\":\"HairSkinMedix Contact\",\"url\":\"https://hairskinmedix.com/contact-us\",\"contactPoint\":{\"@type\":\"ContactPoint\",\"telephone\":\"+91-XXXXXXXXXX\",\"contactType\":\"Customer Service\",\"areaServed\":\"IN\",\"availableLanguage\":[\"English\",\"Hindi\"]}}', 'Contact HairSkinMedix | Hair & Skin Experts', 'Reach out to HairSkinMedix for appointments, queries, and expert skincare guidance.', 'seo_og_images/hairskinmedix-logo-20251106112537.png', 'Contact HairSkinMedix | Book Appointment', 'Book a consultation or talk to our experts for personalized hair and skin treatments.', 'seo_twitter_images/hairskinmedix-logo-20251106112537.png', 1, 1, 1, '2025-11-05 14:37:45', '2025-11-07 03:27:17'),
(4, 'Privacy Policy', '/privacy-policy', 'Privacy Policy | HairSkinMedix', 'Read the HairSkinMedix Privacy Policy to understand how we collect, use, and protect your personal information when you visit our website or book a treatment.', 'HairSkinMedix Privacy Policy, Data Protection, Personal Information Policy, Website Privacy, HairSkinMedix Data Usage, HairSkinMedix Security Policy', 'Privacy Policy', 'https://hairskinmedix.com/privacy-policy', '{\"@context\":\"https://schema.org\",\"@type\":\"WebPage\",\"name\":\"Privacy Policy\",\"description\":\"Learn how HairSkinMedix protects and manages your personal data in compliance with applicable privacy laws.\",\"url\":\"https://hairskinmedix.com/privacy-policy\"}', 'HairSkinMedix Privacy Policy', 'We value your privacy. Learn how HairSkinMedix safeguards your personal data and ensures confidentiality in all interactions.', 'seo_og_images/hairskinmedix-logo-20251106112556.png', 'Privacy Policy | HairSkinMedix', 'Find out how we handle your personal data responsibly at HairSkinMedix.', 'seo_twitter_images/hairskinmedix-logo-20251106112556.png', 1, 1, 1, '2025-11-05 14:38:39', '2025-11-07 03:27:19'),
(5, 'Terms & Conditions', '/terms-condition', 'Terms & Conditions | HairSkinMedix', 'Read the Terms & Conditions for using HairSkinMedix’s website, services, and treatments. Understand your rights, obligations, and our service policies.', 'HairSkinMedix Terms and Conditions, Website Terms, Treatment Policy, HairSkinMedix Legal Terms, HairSkinMedix Service Conditions', 'Terms & Conditions', 'https://hairskinmedix.com/terms-conditions', '{\"@context\":\"https://schema.org\",\"@type\":\"WebPage\",\"name\":\"Terms & Conditions\",\"description\":\"View HairSkinMedix’s terms and conditions for website use, appointments, and treatment services.\",\"url\":\"https://hairskinmedix.com/terms-conditions\"}', 'HairSkinMedix Terms & Conditions', 'Review the terms and conditions governing your use of HairSkinMedix’s services and website.', 'seo_og_images/hairskinmedix-logo-20251106112613.png', 'Terms & Conditions | HairSkinMedix', 'Read HairSkinMedix’s service and website terms carefully before proceeding.', 'seo_twitter_images/hairskinmedix-logo-20251106112613.png', 1, 1, 1, '2025-11-05 14:39:39', '2025-11-07 03:27:24'),
(6, 'Before & After', '/before-after', 'Before & After Results | HairSkinMedix', 'Explore real Before & After results of hair restoration, skin rejuvenation, and cosmetic treatments at HairSkinMedix. Witness visible transformations from our advanced procedures.', 'HairSkinMedix Before and After, Hair Transplant Results, Skin Treatment Results, Hair Restoration Gallery, HairSkinMedix Transformations', 'Before & After Results', 'https://hairskinmedix.com/before-after', '{\"@context\":\"https://schema.org\",\"@type\":\"CollectionPage\",\"name\":\"Before & After\",\"description\":\"Before & After photos of HairSkinMedix’s hair and skin treatments showcasing real client transformations.\",\"url\":\"https://hairskinmedix.com/before-after\"}', 'Before & After Transformations | HairSkinMedix', 'See real patient transformations with HairSkinMedix’s advanced hair and skin treatments.', 'seo_og_images/hairskinmedix-logo-20251106112633.png', 'Before & After | HairSkinMedix', 'Explore visible results achieved by HairSkinMedix clients through our proven hair and skin treatments.', 'seo_twitter_images/hairskinmedix-logo-20251106112633.png', 1, 1, 1, '2025-11-05 14:40:24', '2025-11-07 13:37:03');

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

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

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

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

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('dRgogxfyK9wIIIQhCTKTZOiFuDABMtJC6XXcJiT4', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZUNZZFpic1hxRUl4VTU0bUFKYkR6WjJGV1VvdjZ0Y1RhZVlmWHhYZiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTA6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9zeXN0ZW1hZG1pbi9tYXN0ZXItcmF0ZS1jYXJkIjtzOjU6InJvdXRlIjtzOjE3OiJtYXN0ZXItcmF0ZS5pbmRleCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1782372657);

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

--
-- Table structure for table `vendors`
--

CREATE TABLE `vendors` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `vendor_name` varchar(150) NOT NULL,
  `vendor_type` enum('APMC Trader','Commission Agent','e-NAM Trader','FPO','Private Aggregator') NOT NULL,
  `business_name` varchar(200) DEFAULT NULL,
  `contact_person` varchar(150) DEFAULT NULL,
  `registration_authority` enum('State APMC','e-NAM','Registrar of Co-operatives','Other') DEFAULT NULL,
  `license_number` varchar(100) DEFAULT NULL,
  `license_issue_date` date DEFAULT NULL,
  `license_expiry_date` date DEFAULT NULL,
  `gst_number` varchar(15) DEFAULT NULL,
  `pan_number` varchar(10) DEFAULT NULL,
  `crops_handled` text DEFAULT NULL,
  `market_type` enum('APMC Mandi','e-NAM','Private Market','Export') DEFAULT NULL,
  `status` enum('pending','approved','rejected','comment') DEFAULT 'pending',
  `is_verified` tinyint(1) DEFAULT 0,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `rejected_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendors`
--

INSERT INTO `vendors` (`id`, `user_id`, `vendor_name`, `vendor_type`, `business_name`, `contact_person`, `registration_authority`, `license_number`, `license_issue_date`, `license_expiry_date`, `gst_number`, `pan_number`, `crops_handled`, `market_type`, `status`, `is_verified`, `approved_by`, `rejected_by`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 14, 'rohit bansiwala', 'APMC Trader', 'whizzact', '9898989898', 'State APMC', '89348984', '2025-10-12', '2025-10-12', '828492894823', '8749829849', '\"rice, wheat, dal\"', 'APMC Mandi', 'pending', 1, NULL, NULL, 14, NULL, NULL, '2026-01-19 12:18:12', '2026-06-17 14:39:39', NULL),
(2, 15, 'rohit bansiwala', 'APMC Trader', 'whizzact', '9898989898', 'State APMC', '89348984', '2025-10-12', '2025-10-12', '828492894823', '8749829849', '\"[\\\"2\\\",\\\"3\\\",\\\"4\\\"]\"', 'APMC Mandi', 'pending', 1, NULL, NULL, 15, NULL, NULL, '2026-06-17 14:04:09', '2026-06-17 14:39:32', NULL);

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

--
-- Table structure for table `vendor_rate_cards`
--

CREATE TABLE `vendor_rate_cards` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vendor_id` bigint(20) UNSIGNED NOT NULL,
  `crop_id` bigint(20) UNSIGNED NOT NULL,
  `measure_unit_id` bigint(20) UNSIGNED NOT NULL,
  `min_rate` decimal(10,2) NOT NULL,
  `max_rate` decimal(10,2) NOT NULL,
  `effective_date` date NOT NULL,
  `display_on_marketplace` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendor_rate_cards`
--

INSERT INTO `vendor_rate_cards` (`id`, `vendor_id`, `crop_id`, `measure_unit_id`, `min_rate`, `max_rate`, `effective_date`, `display_on_marketplace`, `created_at`, `updated_at`, `deleted_at`) VALUES
(3, 1, 6, 1, 9000.00, 9600.00, '2026-01-30', 1, '2026-01-19 12:37:43', '2026-01-19 12:37:43', NULL),
(7, 1, 6, 1, 8800.00, 9300.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(8, 1, 6, 1, 9000.00, 9600.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(9, 1, 6, 1, 9200.00, 9800.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(10, 1, 6, 1, 9500.00, 10200.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(11, 1, 8, 1, 7200.00, 7700.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(12, 1, 8, 1, 7400.00, 8000.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(13, 1, 8, 1, 7600.00, 8200.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(14, 1, 8, 1, 7900.00, 8500.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(15, 1, 9, 1, 10500.00, 11200.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(16, 1, 9, 1, 10800.00, 11500.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(17, 1, 9, 1, 11000.00, 11800.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(18, 1, 9, 1, 11300.00, 12100.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(19, 1, 9, 1, 11600.00, 12400.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(20, 1, 10, 1, 6400.00, 6900.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(21, 1, 10, 1, 6600.00, 7200.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(22, 1, 10, 1, 6800.00, 7500.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL),
(23, 1, 10, 1, 7100.00, 7800.00, '2026-01-30', 1, '2026-01-23 16:10:36', '2026-01-23 16:10:36', NULL);

--
-- Indexes for dumped tables
--

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

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

--
-- Indexes for table `crops`
--
ALTER TABLE `crops`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `fk_crops_category` (`crop_category_id`),
  ADD KEY `fk_crops_unit` (`default_measure_unit_id`);

--
-- Indexes for table `crop_categories`
--
ALTER TABLE `crop_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `fk_categories_parent` (`parent_id`);

--
-- Indexes for table `documents`
--
ALTER TABLE `documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_docs_user` (`user_id`),
  ADD KEY `fk_docs_type` (`document_type_id`);

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

--
-- Indexes for table `enquiry`
--
ALTER TABLE `enquiry`
  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 `farmers`
--
ALTER TABLE `farmers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_farmers_user` (`user_id`);

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

--
-- Indexes for table `interested_farmers`
--
ALTER TABLE `interested_farmers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_interest_farmer` (`farmer_id`),
  ADD KEY `fk_interest_rate` (`vendor_rate_card_id`),
  ADD KEY `fk_interest_unit` (`measure_unit_id`);

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

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

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

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

--
-- Indexes for table `measure_units`
--
ALTER TABLE `measure_units`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unit_name` (`unit_name`);

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

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

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

--
-- Indexes for table `seo_pages`
--
ALTER TABLE `seo_pages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_page_url` (`page_url`);

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

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

--
-- Indexes for table `vendor_rate_cards`
--
ALTER TABLE `vendor_rate_cards`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_rate_vendor` (`vendor_id`),
  ADD KEY `fk_rate_crop` (`crop_id`),
  ADD KEY `fk_rate_unit` (`measure_unit_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `enquiry`
--
ALTER TABLE `enquiry`
  MODIFY `id` bigint(20) 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 `farmers`
--
ALTER TABLE `farmers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `farmers_crop`
--
ALTER TABLE `farmers_crop`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  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=4;

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

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

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

--
-- Constraints for dumped tables
--

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

--
-- Constraints for table `crops`
--
ALTER TABLE `crops`
  ADD CONSTRAINT `fk_crops_category` FOREIGN KEY (`crop_category_id`) REFERENCES `crop_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_crops_unit` FOREIGN KEY (`default_measure_unit_id`) REFERENCES `measure_units` (`id`) ON DELETE SET NULL;

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

--
-- Constraints for table `documents`
--
ALTER TABLE `documents`
  ADD CONSTRAINT `fk_docs_type` FOREIGN KEY (`document_type_id`) REFERENCES `document_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_docs_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `interested_farmers`
--
ALTER TABLE `interested_farmers`
  ADD CONSTRAINT `fk_interest_farmer` FOREIGN KEY (`farmer_id`) REFERENCES `farmers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_interest_rate` FOREIGN KEY (`vendor_rate_card_id`) REFERENCES `vendor_rate_cards` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_interest_unit` FOREIGN KEY (`measure_unit_id`) REFERENCES `measure_units` (`id`) ON DELETE CASCADE;

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

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

--
-- Constraints for table `vendor_rate_cards`
--
ALTER TABLE `vendor_rate_cards`
  ADD CONSTRAINT `fk_rate_crop` FOREIGN KEY (`crop_id`) REFERENCES `crops` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_rate_unit` FOREIGN KEY (`measure_unit_id`) REFERENCES `measure_units` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_rate_vendor` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE;
COMMIT;

