CREATE TABLE `purchase_order_histories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned DEFAULT NULL,
  `purchase_order_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `label` text COLLATE utf8mb4_unicode_ci,
  `details` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_histories_company_id_foreign` (`company_id`),
  KEY `purchase_order_histories_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_order_histories_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `purchase_order_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_order_histories_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_order_histories_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_order_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_order_settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_prefix` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'PO',
  `purchase_number_separator` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT '#',
  `purchase_number_digit` int DEFAULT '3',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `purchase_order_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_orders` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_order_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vendor_id` int unsigned DEFAULT NULL,
  `bank_account_id` int unsigned DEFAULT NULL,
  `address_id` bigint unsigned DEFAULT NULL,
  `currency_id` int unsigned DEFAULT NULL,
  `default_currency_id` int unsigned DEFAULT NULL,
  `exchange_rate` double(16,2) DEFAULT NULL,
  `purchase_date` date DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `expected_delivery_date` date DEFAULT NULL,
  `discount` double(16,2) NOT NULL DEFAULT '0.00',
  `sub_total` double(16,2) NOT NULL DEFAULT '0.00',
  `total` double(16,2) NOT NULL DEFAULT '0.00',
  `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent',
  `send_status` tinyint(1) DEFAULT '0',
  `purchase_status` enum('draft','open','issued','accepted','rejected','canceled','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `billed_status` enum('billed','unbilled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unbilled',
  `delivery_status` enum('delivered','delivery_failed','in_transaction','not_started') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'not_started',
  `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount',
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_orders_company_id_foreign` (`company_id`),
  KEY `purchase_orders_vendor_id_foreign` (`vendor_id`),
  KEY `purchase_orders_bank_account_id_foreign` (`bank_account_id`),
  KEY `purchase_orders_address_id_foreign` (`address_id`),
  KEY `purchase_orders_currency_id_foreign` (`currency_id`),
  KEY `purchase_orders_default_currency_id_foreign` (`default_currency_id`),
  KEY `purchase_orders_added_by_foreign` (`added_by`),
  KEY `purchase_orders_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `purchase_orders_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_address_id_foreign` FOREIGN KEY (`address_id`) REFERENCES `company_addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_default_currency_id_foreign` FOREIGN KEY (`default_currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_orders_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_payment_bills` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `purchase_vendor_payment_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned DEFAULT NULL,
  `purchase_bill_id` int unsigned DEFAULT NULL,
  `purchase_vendor_credits_id` int unsigned DEFAULT NULL,
  `gateway` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_paid` double(16,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_payment_bills_purchase_vendor_payment_id_foreign` (`purchase_vendor_payment_id`),
  KEY `purchase_payment_bills_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_payment_bills_purchase_bill_id_foreign` (`purchase_bill_id`),
  KEY `purchase_payment_bills_purchase_vendor_credits_id_foreign` (`purchase_vendor_credits_id`),
  CONSTRAINT `purchase_payment_bills_purchase_bill_id_foreign` FOREIGN KEY (`purchase_bill_id`) REFERENCES `purchase_bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_bills_purchase_vendor_credits_id_foreign` FOREIGN KEY (`purchase_vendor_credits_id`) REFERENCES `purchase_vendor_credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_bills_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_bills_purchase_vendor_payment_id_foreign` FOREIGN KEY (`purchase_vendor_payment_id`) REFERENCES `purchase_vendor_payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_payment_histories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned DEFAULT NULL,
  `purchase_payment_id` int unsigned DEFAULT NULL,
  `purchase_order_id` int unsigned DEFAULT NULL,
  `purchase_order` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_bill_id` int unsigned DEFAULT NULL,
  `amount` double(16,2) DEFAULT '0.00',
  `user_id` int unsigned DEFAULT NULL,
  `details` text COLLATE utf8mb4_unicode_ci,
  `label` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_payment_histories_company_id_foreign` (`company_id`),
  KEY `purchase_payment_histories_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_payment_histories_purchase_payment_id_foreign` (`purchase_payment_id`),
  KEY `purchase_payment_histories_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_payment_histories_purchase_bill_id_foreign` (`purchase_bill_id`),
  KEY `purchase_payment_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `purchase_payment_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_histories_purchase_bill_id_foreign` FOREIGN KEY (`purchase_bill_id`) REFERENCES `purchase_bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_histories_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_histories_purchase_payment_id_foreign` FOREIGN KEY (`purchase_payment_id`) REFERENCES `purchase_vendor_payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_histories_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_payment_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_product_histories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_product_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `label` text COLLATE utf8mb4_unicode_ci,
  `details` text COLLATE utf8mb4_unicode_ci,
  `type` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_product_histories_company_id_foreign` (`company_id`),
  KEY `purchase_product_histories_purchase_product_id_foreign` (`purchase_product_id`),
  KEY `purchase_product_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `purchase_product_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_product_histories_purchase_product_id_foreign` FOREIGN KEY (`purchase_product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_product_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_order_prefix` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PO',
  `purchase_order_number_separator` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#',
  `purchase_order_number_digit` int NOT NULL DEFAULT '3',
  `bill_prefix` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PO',
  `bill_number_separator` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#',
  `bill_number_digit` int NOT NULL DEFAULT '3',
  `vendor_credit_prefix` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'VC',
  `vendor_credit_number_seprator` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#',
  `vendor_credit_number_digit` int NOT NULL DEFAULT '3',
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_stock_adjustment_reasons` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_stock_adjustment_reasons_company_id_foreign` (`company_id`),
  CONSTRAINT `purchase_stock_adjustment_reasons_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_stock_adjustments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `inventory_id` int unsigned DEFAULT NULL,
  `product_id` int unsigned DEFAULT NULL,
  `reason_id` int unsigned DEFAULT NULL,
  `type` enum('quantity','value') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'quantity',
  `date` date DEFAULT NULL,
  `reference_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `net_quantity` double(16,2) DEFAULT NULL,
  `quantity_adjustment` int DEFAULT '0',
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` enum('draft','converted') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `changed_value` double(16,2) DEFAULT '0.00',
  `adjusted_value` double(16,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_stock_adjustments_company_id_foreign` (`company_id`),
  KEY `purchase_stock_adjustments_inventory_id_foreign` (`inventory_id`),
  KEY `purchase_stock_adjustments_product_id_foreign` (`product_id`),
  KEY `purchase_stock_adjustments_reason_id_foreign` (`reason_id`),
  CONSTRAINT `purchase_stock_adjustments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_stock_adjustments_inventory_id_foreign` FOREIGN KEY (`inventory_id`) REFERENCES `purchase_inventory_adjustment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_stock_adjustments_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_stock_adjustments_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `purchase_stock_adjustment_reasons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_contacts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_contacts_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_contacts_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  CONSTRAINT `purchase_vendor_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_contacts_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_credit_histories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_credit_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned DEFAULT NULL,
  `amount` int DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `label` text COLLATE utf8mb4_unicode_ci,
  `details` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_credit_histories_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_credit_histories_purchase_credit_id_foreign` (`purchase_credit_id`),
  KEY `purchase_vendor_credit_histories_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_vendor_credit_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `purchase_vendor_credit_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credit_histories_purchase_credit_id_foreign` FOREIGN KEY (`purchase_credit_id`) REFERENCES `purchase_vendor_credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credit_histories_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credit_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_credit_item_images` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `vendor_item_id` int unsigned NOT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_item_images_vendor_item_id_foreign` (`vendor_item_id`),
  CONSTRAINT `purchase_vendor_credit_item_images_vendor_item_id_foreign` FOREIGN KEY (`vendor_item_id`) REFERENCES `purchase_vendor_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_credits` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `vendor_id` int unsigned DEFAULT NULL,
  `credit_note_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_date` date DEFAULT NULL,
  `currency_id` int unsigned NOT NULL,
  `sub_total` double(16,2) NOT NULL,
  `discount` double NOT NULL DEFAULT '0',
  `discount_type` enum('percent','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent',
  `total` double(16,2) NOT NULL,
  `status` enum('open','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `hash` text COLLATE utf8mb4_unicode_ci,
  `calculate_tax` enum('after_discount','before_discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'after_discount',
  `note` text COLLATE utf8mb4_unicode_ci,
  `send_status` tinyint(1) NOT NULL DEFAULT '1',
  `product_id` int unsigned DEFAULT NULL,
  `bill_id` int unsigned DEFAULT NULL,
  `payment_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_credits_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_credits_vendor_id_foreign` (`vendor_id`),
  KEY `purchase_vendor_credits_currency_id_foreign` (`currency_id`),
  KEY `purchase_vendor_credits_product_id_foreign` (`product_id`),
  KEY `purchase_vendor_credits_bill_id_foreign` (`bill_id`),
  KEY `purchase_vendor_credits_payment_id_foreign` (`payment_id`),
  KEY `purchase_vendor_credits_added_by_foreign` (`added_by`),
  KEY `purchase_vendor_credits_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `purchase_vendor_credits_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `purchase_bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `purchase_vendor_payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_credits_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_histories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned DEFAULT NULL,
  `purchase_vendor_notes_id` int unsigned DEFAULT NULL,
  `purchase_vendor_contact_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `details` text COLLATE utf8mb4_unicode_ci,
  `label` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_histories_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_histories_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_vendor_histories_purchase_vendor_notes_id_foreign` (`purchase_vendor_notes_id`),
  KEY `purchase_vendor_histories_purchase_vendor_contact_id_foreign` (`purchase_vendor_contact_id`),
  KEY `purchase_vendor_histories_user_id_foreign` (`user_id`),
  CONSTRAINT `purchase_vendor_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_histories_purchase_vendor_contact_id_foreign` FOREIGN KEY (`purchase_vendor_contact_id`) REFERENCES `purchase_vendor_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_histories_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_histories_purchase_vendor_notes_id_foreign` FOREIGN KEY (`purchase_vendor_notes_id`) REFERENCES `purchase_vendor_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_items` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `credit_id` int unsigned DEFAULT NULL,
  `item_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_summary` text COLLATE utf8mb4_unicode_ci,
  `type` enum('item','discount','tax') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item',
  `quantity` double(16,2) NOT NULL,
  `unit_price` double(16,2) NOT NULL,
  `amount` double(16,2) NOT NULL,
  `taxes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_id` int unsigned DEFAULT NULL,
  `unit_id` bigint unsigned DEFAULT NULL,
  `hsn_sac_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_items_credit_id_foreign` (`credit_id`),
  KEY `purchase_vendor_items_product_id_foreign` (`product_id`),
  KEY `purchase_vendor_items_unit_id_foreign` (`unit_id`),
  CONSTRAINT `purchase_vendor_items_credit_id_foreign` FOREIGN KEY (`credit_id`) REFERENCES `purchase_vendor_credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `unit_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `purchase_vendor_id` int unsigned NOT NULL,
  `note_title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `note_type` tinyint(1) NOT NULL DEFAULT '0',
  `note_details` text COLLATE utf8mb4_unicode_ci,
  `ask_password` tinyint(1) NOT NULL DEFAULT '0',
  `member_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_notes_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_vendor_notes_member_id_foreign` (`member_id`),
  CONSTRAINT `purchase_vendor_notes_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_notes_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_payments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned NOT NULL,
  `purchase_vendor_id` int unsigned NOT NULL,
  `payment_date` date DEFAULT NULL,
  `vendor_credit_id` int unsigned DEFAULT NULL,
  `bank_account_id` int unsigned DEFAULT NULL,
  `received_payment` double NOT NULL,
  `status` enum('complete','pending','failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'complete',
  `excess_payment` double NOT NULL,
  `paid_on` datetime DEFAULT NULL,
  `notify_vendor` tinyint(1) DEFAULT '0',
  `internal_note` text COLLATE utf8mb4_unicode_ci,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_payments_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_payments_purchase_vendor_id_foreign` (`purchase_vendor_id`),
  KEY `purchase_vendor_payments_bank_account_id_foreign` (`bank_account_id`),
  KEY `purchase_vendor_payments_added_by_foreign` (`added_by`),
  KEY `purchase_vendor_payments_last_updated_by_foreign` (`last_updated_by`),
  KEY `purchase_vendor_credits_id_foreign` (`vendor_credit_id`),
  KEY `purchase_vendor_payments_paid_on_index` (`paid_on`),
  CONSTRAINT `purchase_vendor_payments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_payments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_payments_purchase_vendor_id_foreign` FOREIGN KEY (`purchase_vendor_id`) REFERENCES `purchase_vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendor_user_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `vendor_note_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendor_user_notes_company_id_foreign` (`company_id`),
  KEY `purchase_vendor_user_notes_user_id_foreign` (`user_id`),
  KEY `purchase_vendor_user_notes_vendor_note_id_foreign` (`vendor_note_id`),
  CONSTRAINT `purchase_vendor_user_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_user_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendor_user_notes_vendor_note_id_foreign` FOREIGN KEY (`vendor_note_id`) REFERENCES `purchase_vendor_notes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purchase_vendors` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `primary_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` int unsigned DEFAULT NULL,
  `opening_balance` double DEFAULT NULL,
  `billing_address` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_address` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_vendors_currency_id_foreign` (`currency_id`),
  KEY `purchase_vendors_added_by_foreign` (`added_by`),
  KEY `purchase_vendors_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `purchase_vendors_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendors_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `purchase_vendors_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purpose_consent` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purpose_consent_leads` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `deal_id` bigint unsigned DEFAULT NULL,
  `purpose_consent_id` int unsigned NOT NULL,
  `status` enum('agree','disagree') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree',
  `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by_id` int unsigned DEFAULT NULL,
  `additional_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purpose_consent_leads_purpose_consent_id_foreign` (`purpose_consent_id`),
  KEY `purpose_consent_leads_updated_by_id_foreign` (`updated_by_id`),
  KEY `purpose_consent_leads_deal_id_foreign` (`deal_id`),
  CONSTRAINT `purpose_consent_leads_deal_id_foreign` FOREIGN KEY (`deal_id`) REFERENCES `deals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purpose_consent_leads_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purpose_consent_leads_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `purpose_consent_users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int unsigned NOT NULL,
  `purpose_consent_id` int unsigned NOT NULL,
  `status` enum('agree','disagree') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'agree',
  `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by_id` int unsigned NOT NULL,
  `additional_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purpose_consent_users_client_id_foreign` (`client_id`),
  KEY `purpose_consent_users_purpose_consent_id_foreign` (`purpose_consent_id`),
  KEY `purpose_consent_users_updated_by_id_foreign` (`updated_by_id`),
  CONSTRAINT `purpose_consent_users_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purpose_consent_users_purpose_consent_id_foreign` FOREIGN KEY (`purpose_consent_id`) REFERENCES `purpose_consent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purpose_consent_users_updated_by_id_foreign` FOREIGN KEY (`updated_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `push_subscriptions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `endpoint` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `public_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `auth_token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `push_subscriptions_endpoint_company_id_unique` (`endpoint`,`company_id`),
  KEY `push_subscriptions_company_id_foreign` (`company_id`),
  KEY `push_subscriptions_user_id_index` (`user_id`),
  CONSTRAINT `push_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `push_subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `qr_code_data` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `data` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
  `logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '200',
  `margin` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `foreground_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#000000',
  `background_color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff',
  `form_data` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qr_code_data_company_id_foreign` (`company_id`),
  CONSTRAINT `qr_code_data_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `qr_code_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `quotations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `business_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `sub_total` double(30,2) NOT NULL,
  `total` double(30,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotations_company_id_foreign` (`company_id`),
  CONSTRAINT `quotations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `quotation_items` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `quotation_id` int unsigned NOT NULL,
  `item_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int NOT NULL,
  `unit_price` int NOT NULL,
  `amount` double(30,2) NOT NULL,
  `hsn_sac_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotation_items_quotation_id_foreign` (`quotation_id`),
  CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_applicant_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `recruit_job_application_id` int unsigned NOT NULL,
  `note_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_applicant_notes_user_id_foreign` (`user_id`),
  KEY `recruit_applicant_notes_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  CONSTRAINT `recruit_applicant_notes_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_applicant_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_application_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_application_id` int unsigned NOT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_application_files_added_by_foreign` (`added_by`),
  KEY `recruit_application_files_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_application_files_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  CONSTRAINT `recruit_application_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_application_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_application_files_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_application_skills` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_application_id` int unsigned NOT NULL,
  `recruit_skill_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_application_skills_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_application_skills_recruit_skill_id_foreign` (`recruit_skill_id`),
  CONSTRAINT `recruit_application_skills_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_application_skills_recruit_skill_id_foreign` FOREIGN KEY (`recruit_skill_id`) REFERENCES `recruit_skills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_application_status_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_application_status_categories_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_application_status_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_application_status` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `position` int NOT NULL,
  `recruit_application_status_category_id` bigint unsigned DEFAULT NULL,
  `action` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ras_recruit_application_status_category_id_foreign` (`recruit_application_status_category_id`),
  KEY `recruit_application_status_company_id_foreign` (`company_id`),
  CONSTRAINT `ras_recruit_application_status_category_id_foreign` FOREIGN KEY (`recruit_application_status_category_id`) REFERENCES `recruit_application_status_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_application_status_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_candidate_database` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `recruit_job_id` bigint unsigned NOT NULL,
  `location_id` bigint unsigned NOT NULL,
  `Job_applied_on` date NOT NULL,
  `skills` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_application_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_candidate_database_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_candidate_database_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_candidate_follow_ups` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `remark` longtext COLLATE utf8mb4_unicode_ci,
  `next_follow_up_date` datetime DEFAULT NULL,
  `send_reminder` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no',
  `remind_time` text COLLATE utf8mb4_unicode_ci,
  `remind_type` enum('minute','hour','day') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'incomplete',
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_candidate_follow_ups_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_candidate_follow_ups_added_by_foreign` (`added_by`),
  KEY `recruit_candidate_follow_ups_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `recruit_candidate_follow_ups_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_candidate_follow_ups_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_candidate_follow_ups_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;





CREATE TABLE `recruit_email_notification_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `setting_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `send_email` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_email_notification_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_email_notification_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_footer_links` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_footer_links_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_footer_links_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_global_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_schedules` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned NOT NULL,
  `interview_type` enum('in person','video','phone') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in person',
  `schedule_date` datetime DEFAULT NULL,
  `status` enum('rejected','hired','pending','canceled','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `user_accept_status` enum('accept','refuse','waiting') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting',
  `meeting_id` int DEFAULT NULL,
  `video_type` enum('zoom','other') COLLATE utf8mb4_unicode_ci DEFAULT 'other',
  `remind_type_all` enum('day','hour','minute') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notify_c` tinyint(1) NOT NULL DEFAULT '0',
  `remind_time_all` int DEFAULT NULL,
  `send_reminder_all` tinyint(1) NOT NULL DEFAULT '0',
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `other_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recruit_interview_stage_id` int unsigned DEFAULT NULL,
  `parent_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_schedules_parent_id_foreign` (`parent_id`),
  KEY `recruit_interview_schedules_added_by_foreign` (`added_by`),
  KEY `recruit_interview_schedules_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_interview_schedules_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_interview_schedules_recruit_interview_stage_id_foreign` (`recruit_interview_stage_id`),
  KEY `recruit_interview_schedules_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_interview_schedules_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_schedules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_schedules_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_schedules_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_schedules_recruit_interview_stage_id_foreign` FOREIGN KEY (`recruit_interview_stage_id`) REFERENCES `recruit_interview_stages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_schedules_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_comments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_interview_schedule_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `comment` text COLLATE utf8mb4_unicode_ci,
  `candidate_comment` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_comments_user_id_foreign` (`user_id`),
  KEY `recruit_interview_comments_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  CONSTRAINT `recruit_interview_comments_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_employees` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_interview_schedule_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `user_accept_status` enum('accept','refuse','waiting') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_employees_user_id_foreign` (`user_id`),
  KEY `rie_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  CONSTRAINT `recruit_interview_employees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rie_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_evaluations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `recruit_recommendation_status_id` int unsigned DEFAULT NULL,
  `recruit_interview_schedule_id` int unsigned DEFAULT NULL,
  `recruit_interview_stage_id` int unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `submitted_by` int unsigned DEFAULT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_evaluations_submitted_by_foreign` (`submitted_by`),
  KEY `rie_recruit_recommendation_status_id_foreign` (`recruit_recommendation_status_id`),
  KEY `riev_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  KEY `rie_recruit_interview_stage_id_foreign` (`recruit_interview_stage_id`),
  KEY `rie_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_interview_evaluations_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_interview_evaluations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_evaluations_submitted_by_foreign` FOREIGN KEY (`submitted_by`) REFERENCES `users` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `rie_recruit_interview_stage_id_foreign` FOREIGN KEY (`recruit_interview_stage_id`) REFERENCES `recruit_interview_stages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rie_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rie_recruit_recommendation_status_id_foreign` FOREIGN KEY (`recruit_recommendation_status_id`) REFERENCES `recruit_recommendation_statuses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `riev_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `recruit_interview_schedule_id` int unsigned NOT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_files_user_id_foreign` (`user_id`),
  KEY `recruit_interview_files_added_by_foreign` (`added_by`),
  KEY `recruit_interview_files_last_updated_by_foreign` (`last_updated_by`),
  KEY `rif_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  CONSTRAINT `recruit_interview_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rif_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_histories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `recruit_interview_schedule_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `recruit_interview_file_id` int unsigned DEFAULT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_histories_user_id_foreign` (`user_id`),
  KEY `rih_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  KEY `recruit_interview_histories_recruit_interview_file_id_foreign` (`recruit_interview_file_id`),
  CONSTRAINT `recruit_interview_histories_recruit_interview_file_id_foreign` FOREIGN KEY (`recruit_interview_file_id`) REFERENCES `recruit_interview_files` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_interview_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rih_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_interview_stages` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_interview_stages_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_interview_stages_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_addresses` (
  `recruit_job_id` bigint unsigned NOT NULL,
  `company_address_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  KEY `recruit_job_addresses_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_addresses_company_address_id_foreign` (`company_address_id`),
  CONSTRAINT `recruit_job_addresses_company_address_id_foreign` FOREIGN KEY (`company_address_id`) REFERENCES `company_addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_addresses_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_alerts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `recruit_work_experience_id` bigint unsigned DEFAULT NULL,
  `recruit_job_type_id` bigint unsigned DEFAULT NULL,
  `recruit_job_category_id` int unsigned NOT NULL,
  `location_id` bigint unsigned DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_alerts_company_id_foreign` (`company_id`),
  KEY `recruit_job_alerts_recruit_work_experience_id_foreign` (`recruit_work_experience_id`),
  KEY `recruit_job_alerts_recruit_job_type_id_foreign` (`recruit_job_type_id`),
  KEY `recruit_job_alerts_recruit_job_category_id_foreign` (`recruit_job_category_id`),
  KEY `recruit_job_alerts_location_id_foreign` (`location_id`),
  CONSTRAINT `recruit_job_alerts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_alerts_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `company_addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_alerts_recruit_job_category_id_foreign` FOREIGN KEY (`recruit_job_category_id`) REFERENCES `recruit_job_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_alerts_recruit_job_type_id_foreign` FOREIGN KEY (`recruit_job_type_id`) REFERENCES `recruit_job_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_alerts_recruit_work_experience_id_foreign` FOREIGN KEY (`recruit_work_experience_id`) REFERENCES `recruit_work_experiences` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `recruit_job_id` bigint unsigned NOT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dropbox_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_files_user_id_foreign` (`user_id`),
  KEY `recruit_job_files_added_by_foreign` (`added_by`),
  KEY `recruit_job_files_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_job_files_recruit_job_id_foreign` (`recruit_job_id`),
  CONSTRAINT `recruit_job_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_files_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_applications` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_experience` enum('fresher','0-1','1-2','2-3','3-4','4-5','5-6','6-7','7-8','8-9','9-10','10-11','11-12','12-13','13-14','over-15') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_location` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_ctc` double DEFAULT NULL,
  `currenct_ctc_rate` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expected_ctc` double DEFAULT NULL,
  `expected_ctc_rate` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notice_period` enum('15','30','45','60','75','90','over-90') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resume` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `column_priority` int DEFAULT NULL,
  `remark` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rejection_remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_letter` mediumtext COLLATE utf8mb4_unicode_ci,
  `job_type` enum('part time','full time','internship') COLLATE utf8mb4_unicode_ci DEFAULT 'full time',
  `recruit_job_id` bigint unsigned NOT NULL,
  `recruit_application_status_id` int unsigned DEFAULT NULL,
  `location_id` bigint unsigned NOT NULL,
  `application_sources` enum('careerWebsite','addedByUser') COLLATE utf8mb4_unicode_ci NOT NULL,
  `application_source_id` int unsigned DEFAULT NULL,
  `recruit_job_file_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_applications_location_id_foreign` (`location_id`),
  KEY `recruit_job_applications_added_by_foreign` (`added_by`),
  KEY `recruit_job_applications_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_job_applications_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_applications_recruit_application_status_id_foreign` (`recruit_application_status_id`),
  KEY `recruit_job_applications_application_source_id_foreign` (`application_source_id`),
  KEY `recruit_job_applications_recruit_job_file_id_foreign` (`recruit_job_file_id`),
  KEY `recruit_job_applications_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_job_applications_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_application_source_id_foreign` FOREIGN KEY (`application_source_id`) REFERENCES `application_sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `company_addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_recruit_application_status_id_foreign` FOREIGN KEY (`recruit_application_status_id`) REFERENCES `recruit_application_status` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_recruit_job_file_id_foreign` FOREIGN KEY (`recruit_job_file_id`) REFERENCES `recruit_job_files` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_applications_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_categories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `category_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_categories_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_job_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_offer_letter` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `recruit_job_id` bigint unsigned DEFAULT NULL,
  `employee_id` int unsigned DEFAULT NULL,
  `job_expire` date NOT NULL,
  `expected_joining_date` date NOT NULL,
  `comp_amount` double DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pay_according` enum('hour','day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL,
  `sign_require` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `add_structure` int NOT NULL DEFAULT '0',
  `sign_image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `decline_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hash` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `offer_accept_at` timestamp NULL DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_offer_letter_added_by_foreign` (`added_by`),
  KEY `recruit_job_offer_letter_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_job_offer_letter_employee_id_foreign` (`employee_id`),
  KEY `recruit_job_offer_letter_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_job_offer_letter_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_offer_letter_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_job_offer_letter_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_letter_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_letter_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_letter_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_letter_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_letter_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_custom_answers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_offer_letter_id` int unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `recruit_job_id` bigint unsigned NOT NULL,
  `recruit_job_question_id` int unsigned NOT NULL,
  `answer` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_custom_answers_recruit_job_offer_letter_id_foreign` (`recruit_job_offer_letter_id`),
  KEY `recruit_job_custom_answers_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_job_custom_answers_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_custom_answers_recruit_job_question_id_foreign` (`recruit_job_question_id`),
  CONSTRAINT `recruit_job_custom_answers_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_custom_answers_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_custom_answers_recruit_job_offer_letter_id_foreign` FOREIGN KEY (`recruit_job_offer_letter_id`) REFERENCES `recruit_job_offer_letter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_custom_answers_recruit_job_question_id_foreign` FOREIGN KEY (`recruit_job_question_id`) REFERENCES `recruit_custom_questions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_histories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_id` bigint unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `recruit_job_offer_letter_id` int unsigned DEFAULT NULL,
  `recruit_interview_schedule_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_histories_user_id_foreign` (`user_id`),
  KEY `recruit_job_histories_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_histories_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_job_histories_recruit_job_offer_letter_id_foreign` (`recruit_job_offer_letter_id`),
  KEY `recruit_job_histories_recruit_interview_schedule_id_foreign` (`recruit_interview_schedule_id`),
  CONSTRAINT `recruit_job_histories_recruit_interview_schedule_id_foreign` FOREIGN KEY (`recruit_interview_schedule_id`) REFERENCES `recruit_interview_schedules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_histories_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_histories_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_histories_recruit_job_offer_letter_id_foreign` FOREIGN KEY (`recruit_job_offer_letter_id`) REFERENCES `recruit_job_offer_letter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_offer_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_offer_letter_id` int unsigned NOT NULL,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hashname` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_offer_files_added_by_foreign` (`added_by`),
  KEY `recruit_job_offer_files_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_job_offer_files_recruit_job_offer_letter_id_foreign` (`recruit_job_offer_letter_id`),
  CONSTRAINT `recruit_job_offer_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_files_recruit_job_offer_letter_id_foreign` FOREIGN KEY (`recruit_job_offer_letter_id`) REFERENCES `recruit_job_offer_letter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_offer_questions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_custom_question_id` int unsigned NOT NULL,
  `recruit_job_offer_letter_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_offer_questions_recruit_custom_question_id_foreign` (`recruit_custom_question_id`),
  KEY `recruit_job_offer_questions_recruit_job_offer_letter_id_foreign` (`recruit_job_offer_letter_id`),
  CONSTRAINT `recruit_job_offer_questions_recruit_custom_question_id_foreign` FOREIGN KEY (`recruit_custom_question_id`) REFERENCES `recruit_custom_questions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_offer_questions_recruit_job_offer_letter_id_foreign` FOREIGN KEY (`recruit_job_offer_letter_id`) REFERENCES `recruit_job_offer_letter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_questions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_custom_question_id` int unsigned NOT NULL,
  `recruit_job_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_questions_recruit_custom_question_id_foreign` (`recruit_custom_question_id`),
  KEY `recruit_job_questions_recruit_job_id_foreign` (`recruit_job_id`),
  CONSTRAINT `recruit_job_questions_recruit_custom_question_id_foreign` FOREIGN KEY (`recruit_custom_question_id`) REFERENCES `recruit_custom_questions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_questions_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_skills` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `recruit_job_id` bigint unsigned NOT NULL,
  `recruit_skill_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_skills_recruit_job_id_foreign` (`recruit_job_id`),
  KEY `recruit_job_skills_recruit_skill_id_foreign` (`recruit_skill_id`),
  CONSTRAINT `recruit_job_skills_recruit_job_id_foreign` FOREIGN KEY (`recruit_job_id`) REFERENCES `recruit_jobs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_skills_recruit_skill_id_foreign` FOREIGN KEY (`recruit_skill_id`) REFERENCES `recruit_skills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_sub_categories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `recruit_job_category_id` int unsigned NOT NULL,
  `sub_category_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_sub_categories_company_id_foreign` (`company_id`),
  KEY `recruit_job_sub_categories_recruit_job_category_id_foreign` (`recruit_job_category_id`),
  CONSTRAINT `recruit_job_sub_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_job_sub_categories_recruit_job_category_id_foreign` FOREIGN KEY (`recruit_job_category_id`) REFERENCES `recruit_job_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_job_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `job_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_job_types_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_job_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_jobboard_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `recruit_application_status_id` int unsigned NOT NULL,
  `collapsed` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_jobboard_settings_user_id_foreign` (`user_id`),
  KEY `recruit_jobboard_settings_recruit_application_status_id_foreign` (`recruit_application_status_id`),
  CONSTRAINT `recruit_jobboard_settings_recruit_application_status_id_foreign` FOREIGN KEY (`recruit_application_status_id`) REFERENCES `recruit_application_status` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `title` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recruit_job_type_id` bigint unsigned DEFAULT NULL,
  `job_description` longtext COLLATE utf8mb4_unicode_ci,
  `total_positions` int NOT NULL,
  `remaining_openings` int NOT NULL,
  `department_id` int unsigned DEFAULT NULL,
  `recruiter_id` int NOT NULL,
  `job_type` enum('part time','full time') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'full time',
  `start_date` datetime NOT NULL,
  `end_date` datetime DEFAULT NULL,
  `status` enum('open','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `currency_id` int unsigned DEFAULT NULL,
  `recruit_job_category_id` int unsigned DEFAULT NULL,
  `recruit_job_sub_category_id` int unsigned DEFAULT NULL,
  `remote_job` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no',
  `disclose_salary` enum('yes','no') COLLATE utf8mb4_unicode_ci DEFAULT 'no',
  `meta_details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_photo_require` tinyint(1) NOT NULL DEFAULT '0',
  `is_resume_require` tinyint(1) NOT NULL DEFAULT '0',
  `is_dob_require` tinyint(1) NOT NULL DEFAULT '0',
  `is_gender_require` tinyint(1) NOT NULL DEFAULT '0',
  `recruit_work_experience_id` bigint unsigned DEFAULT NULL,
  `pay_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_amount` double NOT NULL,
  `end_amount` double DEFAULT NULL,
  `pay_according` enum('hour','day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_jobs_added_by_foreign` (`added_by`),
  KEY `recruit_jobs_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_jobs_currency_id_foreign` (`currency_id`),
  KEY `recruit_jobs_company_id_foreign` (`company_id`),
  KEY `recruit_jobs_recruit_work_experience_id_foreign` (`recruit_work_experience_id`),
  KEY `recruit_jobs_department_id_foreign` (`department_id`),
  KEY `recruit_jobs_recruit_job_category_id_foreign` (`recruit_job_category_id`),
  KEY `recruit_jobs_recruit_job_sub_category_id_foreign` (`recruit_job_sub_category_id`),
  KEY `recruit_jobs_recruit_job_type_id_foreign` (`recruit_job_type_id`),
  CONSTRAINT `recruit_jobs_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_recruit_job_category_id_foreign` FOREIGN KEY (`recruit_job_category_id`) REFERENCES `recruit_job_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_recruit_job_sub_category_id_foreign` FOREIGN KEY (`recruit_job_sub_category_id`) REFERENCES `recruit_job_sub_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_recruit_job_type_id_foreign` FOREIGN KEY (`recruit_job_type_id`) REFERENCES `recruit_job_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_jobs_recruit_work_experience_id_foreign` FOREIGN KEY (`recruit_work_experience_id`) REFERENCES `recruit_work_experiences` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_recommendation_statuses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_recommendation_statuses_added_by_foreign` (`added_by`),
  KEY `recruit_recommendation_statuses_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruit_recommendation_statuses_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_recommendation_statuses_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruit_recommendation_statuses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_recommendation_statuses_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_salary_structures` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `recruit_job_application_id` int unsigned DEFAULT NULL,
  `recruit_job_offer_letter_id` int unsigned DEFAULT NULL,
  `salary_json` text COLLATE utf8mb4_unicode_ci,
  `annual_salary` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `basic_salary` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `basic_value_type` enum('fixed','ctc_percent') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `fixed_allowance` double NOT NULL DEFAULT '0',
  `date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_salary_structures_company_id_foreign` (`company_id`),
  KEY `recruit_salary_structures_recruit_job_application_id_foreign` (`recruit_job_application_id`),
  KEY `recruit_salary_structures_recruit_job_offer_letter_id_foreign` (`recruit_job_offer_letter_id`),
  CONSTRAINT `recruit_salary_structures_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_salary_structures_recruit_job_application_id_foreign` FOREIGN KEY (`recruit_job_application_id`) REFERENCES `recruit_job_applications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_salary_structures_recruit_job_offer_letter_id_foreign` FOREIGN KEY (`recruit_job_offer_letter_id`) REFERENCES `recruit_job_offer_letter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_selected_salary_components` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `rss_id` int unsigned DEFAULT NULL,
  `salary_component_id` int unsigned DEFAULT NULL,
  `component_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `component_type` enum('earning','deduction') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `component_value` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_type` enum('fixed','percent','basic_percent','variable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'variable',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_selected_salary_components_company_id_foreign` (`company_id`),
  KEY `recruit_selected_salary_components_rss_id_foreign` (`rss_id`),
  CONSTRAINT `recruit_selected_salary_components_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruit_selected_salary_components_rss_id_foreign` FOREIGN KEY (`rss_id`) REFERENCES `recruit_salary_structures` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `about` longtext COLLATE utf8mb4_unicode_ci,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'bg-image',
  `background_image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `background_color` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_setting` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `form_settings` longtext COLLATE utf8mb4_unicode_ci,
  `legal_term` longtext COLLATE utf8mb4_unicode_ci,
  `logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `favicon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `career_site` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `offer_letter_reminder` int NOT NULL,
  `job_alert_status` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `application_restriction` int NOT NULL DEFAULT '180',
  `google_recaptcha_status` enum('active','deactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deactive',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_skills` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_skills_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruit_work_experiences` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `work_experience` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruit_work_experiences_company_id_foreign` (`company_id`),
  CONSTRAINT `recruit_work_experiences_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `recruiters` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled',
  `added_by` int unsigned NOT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruiters_user_id_foreign` (`user_id`),
  KEY `recruiters_added_by_foreign` (`added_by`),
  KEY `recruiters_last_updated_by_foreign` (`last_updated_by`),
  KEY `recruiters_company_id_foreign` (`company_id`),
  CONSTRAINT `recruiters_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruiters_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recruiters_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `recruiters_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `removal_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `status` enum('pending','approved','rejected') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `removal_requests_company_id_foreign` (`company_id`),
  KEY `removal_requests_user_id_foreign` (`user_id`),
  CONSTRAINT `removal_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `removal_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `removal_requests_lead` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `lead_id` int unsigned DEFAULT NULL,
  `status` enum('pending','approved','rejected') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `removal_requests_lead_company_id_foreign` (`company_id`),
  KEY `removal_requests_lead_lead_id_foreign` (`lead_id`),
  CONSTRAINT `removal_requests_lead_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `removal_requests_lead_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `rest_api_application_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `app_key` int NOT NULL,
  `app_secret` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `authorized_employee_id` int unsigned DEFAULT NULL,
  `status` enum('enabled','disabled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rest_api_application_settings_app_key_unique` (`app_key`),
  KEY `rest_api_application_settings_authorized_employee_id_foreign` (`authorized_employee_id`),
  CONSTRAINT `rest_api_application_settings_authorized_employee_id_foreign` FOREIGN KEY (`authorized_employee_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `rest_api_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `fcm_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rest_api_settings_added_by_foreign` (`added_by`),
  KEY `rest_api_settings_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `rest_api_settings_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `rest_api_settings_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_company_id_unique` (`name`,`company_id`),
  KEY `roles_company_id_foreign` (`company_id`),
  CONSTRAINT `roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `role_user` (
  `user_id` int unsigned NOT NULL,
  `role_id` int unsigned NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`),
  KEY `role_user_role_id_foreign` (`role_id`),
  CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_components` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `component_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `component_type` enum('earning','deduction') COLLATE utf8mb4_unicode_ci NOT NULL,
  `component_value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value_type` enum('fixed','percent','basic_percent','variable') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `weekly_value` double NOT NULL DEFAULT '0',
  `biweekly_value` double NOT NULL DEFAULT '0',
  `semimonthly_value` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `salary_components_company_id_foreign` (`company_id`),
  CONSTRAINT `salary_components_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_groups` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `group_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_groups_company_id_foreign` (`company_id`),
  CONSTRAINT `salary_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_group_components` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `salary_group_id` bigint unsigned NOT NULL,
  `salary_component_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_group_components_salary_group_id_foreign` (`salary_group_id`),
  KEY `salary_group_components_salary_component_id_foreign` (`salary_component_id`),
  KEY `salary_group_components_company_id_foreign` (`company_id`),
  CONSTRAINT `salary_group_components_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `salary_group_components_salary_component_id_foreign` FOREIGN KEY (`salary_component_id`) REFERENCES `salary_components` (`id`) ON DELETE CASCADE,
  CONSTRAINT `salary_group_components_salary_group_id_foreign` FOREIGN KEY (`salary_group_id`) REFERENCES `salary_groups` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_payment_methods` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `default` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_payment_methods_company_id_foreign` (`company_id`),
  CONSTRAINT `salary_payment_methods_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_slips` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `currency_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `salary_group_id` bigint unsigned DEFAULT NULL,
  `basic_salary` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `net_salary` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `month` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `year` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `paid_on` date DEFAULT NULL,
  `status` enum('generated','review','locked','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'generated',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `salary_json` text COLLATE utf8mb4_unicode_ci,
  `extra_json` text COLLATE utf8mb4_unicode_ci,
  `expense_claims` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `pay_days` int NOT NULL,
  `salary_payment_method_id` bigint unsigned DEFAULT NULL,
  `tds` double(16,2) NOT NULL,
  `monthly_salary` double(16,2) NOT NULL,
  `gross_salary` double(16,2) NOT NULL,
  `total_deductions` double(16,2) NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `salary_from` datetime DEFAULT NULL,
  `salary_to` datetime DEFAULT NULL,
  `payroll_cycle_id` bigint unsigned DEFAULT NULL,
  `fixed_allowance` double NOT NULL DEFAULT '0',
  `expenses_created` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `salary_slips_user_id_foreign` (`user_id`),
  KEY `salary_slips_salary_group_id_foreign` (`salary_group_id`),
  KEY `salary_slips_salary_payment_method_id_foreign` (`salary_payment_method_id`),
  KEY `salary_slips_added_by_foreign` (`added_by`),
  KEY `salary_slips_last_updated_by_foreign` (`last_updated_by`),
  KEY `salary_slips_company_id_foreign` (`company_id`),
  KEY `salary_slips_payroll_cycle_id_foreign` (`payroll_cycle_id`),
  KEY `salary_slips_currency_id_foreign` (`currency_id`),
  CONSTRAINT `salary_slips_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `salary_slips_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `salary_slips_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `salary_slips_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `salary_slips_payroll_cycle_id_foreign` FOREIGN KEY (`payroll_cycle_id`) REFERENCES `payroll_cycles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `salary_slips_salary_group_id_foreign` FOREIGN KEY (`salary_group_id`) REFERENCES `salary_groups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `salary_slips_salary_payment_method_id_foreign` FOREIGN KEY (`salary_payment_method_id`) REFERENCES `salary_payment_methods` (`id`) ON DELETE SET NULL,
  CONSTRAINT `salary_slips_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `salary_tds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `salary_from` double(16,2) NOT NULL,
  `salary_to` double(16,2) NOT NULL,
  `salary_percent` double(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_tds_company_id_foreign` (`company_id`),
  CONSTRAINT `salary_tds_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sessions` (
  `id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `payload` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `skills` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `skills_company_id_foreign` (`company_id`),
  CONSTRAINT `skills_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `slack_settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `slack_webhook` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `slack_logo` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `slack_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `slack_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sms_notification_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `setting_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `send_sms` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `msg91_flow_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sms_notification_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `sms_notification_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `socials` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `social_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `social_service` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sticky_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `note_text` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `colour` enum('blue','yellow','red','gray','purple','green') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'blue',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sticky_notes_company_id_foreign` (`company_id`),
  KEY `sticky_notes_user_id_foreign` (`user_id`),
  CONSTRAINT `sticky_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sticky_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sub_tasks` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `task_id` int unsigned NOT NULL,
  `title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `due_date` datetime DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `status` enum('incomplete','complete') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'incomplete',
  `assigned_to` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sub_tasks_task_id_foreign` (`task_id`),
  KEY `sub_tasks_assigned_to_foreign` (`assigned_to`),
  KEY `sub_tasks_added_by_foreign` (`added_by`),
  KEY `sub_tasks_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `sub_tasks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sub_tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sub_tasks_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sub_tasks_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `sub_task_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `sub_task_id` int unsigned NOT NULL,
  `filename` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dropbox_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sub_task_files_user_id_foreign` (`user_id`),
  KEY `sub_task_files_sub_task_id_foreign` (`sub_task_id`),
  CONSTRAINT `sub_task_files_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sub_task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `subscription_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `subscription_id` bigint unsigned NOT NULL,
  `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stripe_product` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stripe_price` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscription_items_subscription_id_stripe_price_unique` (`subscription_id`,`stripe_price`),
  UNIQUE KEY `subscription_items_stripe_id_unique` (`stripe_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `subscriptions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stripe_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stripe_price` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int DEFAULT NULL,
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscriptions_stripe_id_unique` (`stripe_id`),
  KEY `subscriptions_company_id_foreign` (`company_id`),
  KEY `subscriptions_user_id_stripe_status_index` (`user_id`,`stripe_status`),
  CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_category` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `category_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_category_company_id_foreign` (`company_id`),
  KEY `task_category_added_by_foreign` (`added_by`),
  KEY `task_category_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `task_category_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_category_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_category_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_comments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `comment` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned NOT NULL,
  `task_id` int unsigned NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_comments_user_id_foreign` (`user_id`),
  KEY `task_comments_task_id_foreign` (`task_id`),
  KEY `task_comments_added_by_foreign` (`added_by`),
  KEY `task_comments_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `task_comments_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_comments_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_comments_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_comment_emoji` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `comment_id` int unsigned DEFAULT NULL,
  `emoji_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_comment_emoji_user_id_foreign` (`user_id`),
  KEY `task_comment_emoji_comment_id_foreign` (`comment_id`),
  CONSTRAINT `task_comment_emoji_comment_id_foreign` FOREIGN KEY (`comment_id`) REFERENCES `task_comments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_comment_emoji_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `task_id` int unsigned NOT NULL,
  `filename` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dropbox_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_files_user_id_foreign` (`user_id`),
  KEY `task_files_task_id_foreign` (`task_id`),
  KEY `task_files_added_by_foreign` (`added_by`),
  KEY `task_files_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `task_files_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_files_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_files_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_history` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_id` int unsigned NOT NULL,
  `sub_task_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `board_column_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_history_task_id_foreign` (`task_id`),
  KEY `task_history_sub_task_id_foreign` (`sub_task_id`),
  KEY `task_history_user_id_foreign` (`user_id`),
  KEY `task_history_board_column_id_foreign` (`board_column_id`),
  CONSTRAINT `task_history_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_history_sub_task_id_foreign` FOREIGN KEY (`sub_task_id`) REFERENCES `sub_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_history_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_history_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_label_list` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `project_id` int unsigned DEFAULT NULL,
  `label_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_label_list_company_id_foreign` (`company_id`),
  KEY `task_label_list_project_id_foreign` (`project_id`),
  CONSTRAINT `task_label_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_label_list_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_labels` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `label_id` int unsigned NOT NULL,
  `task_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_labels_label_id_foreign` (`label_id`),
  KEY `task_tags_task_id_foreign` (`task_id`),
  CONSTRAINT `task_labels_label_id_foreign` FOREIGN KEY (`label_id`) REFERENCES `task_label_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_tags_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `task_id` int unsigned NOT NULL,
  `user_id` int DEFAULT NULL,
  `note` longtext COLLATE utf8mb4_unicode_ci,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_notes_task_id_foreign` (`task_id`),
  KEY `task_notes_added_by_foreign` (`added_by`),
  KEY `task_notes_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `task_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `task_notes_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `task_category` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `project` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `start_date` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `due_date` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `assigned_to` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `assigned_by` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `description` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `label` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `status` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `priority` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `make_private` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `time_estimate` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `hours_logged` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `custom_fields` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `copy_task_link` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `files` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `sub_task` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `comments` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `time_logs` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `notes` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `history` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'yes',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `task_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `task_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_users_task_id_foreign` (`task_id`),
  KEY `task_users_user_id_foreign` (`user_id`),
  CONSTRAINT `task_users_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `taskboard_columns` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `column_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `label_color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `taskboard_columns_column_name_company_id_unique` (`column_name`,`company_id`),
  KEY `taskboard_columns_company_id_foreign` (`company_id`),
  CONSTRAINT `taskboard_columns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `taxes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `tax_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate_percent` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `taxes_company_id_foreign` (`company_id`),
  CONSTRAINT `taxes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `teams` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `team_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `teams_company_id_foreign` (`company_id`),
  KEY `teams_added_by_foreign` (`added_by`),
  KEY `teams_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `teams_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `teams_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `teams_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `theme_settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `panel` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `header_color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sidebar_color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sidebar_text_color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `link_color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff',
  `user_css` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `sidebar_theme` enum('dark','light') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dark',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `theme_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `theme_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_activities` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `assigned_to` int unsigned DEFAULT NULL,
  `channel_id` int unsigned DEFAULT NULL,
  `group_id` int unsigned DEFAULT NULL,
  `type_id` int unsigned DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `priority` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'create',
  `content` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_activities_ticket_id_foreign` (`ticket_id`),
  KEY `ticket_activities_user_id_foreign` (`user_id`),
  KEY `ticket_activities_assigned_to_foreign` (`assigned_to`),
  KEY `ticket_activities_channel_id_foreign` (`channel_id`),
  KEY `ticket_activities_group_id_foreign` (`group_id`),
  KEY `ticket_activities_type_id_foreign` (`type_id`),
  CONSTRAINT `ticket_activities_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_activities_channel_id_foreign` FOREIGN KEY (`channel_id`) REFERENCES `ticket_channels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_activities_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `ticket_groups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_activities_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_activities_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `ticket_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_activities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_agent_groups` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `agent_id` int unsigned NOT NULL,
  `group_id` int unsigned DEFAULT NULL,
  `status` enum('enabled','disabled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled',
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_agent_groups_company_id_foreign` (`company_id`),
  KEY `ticket_agent_groups_agent_id_foreign` (`agent_id`),
  KEY `ticket_agent_groups_group_id_foreign` (`group_id`),
  KEY `ticket_agent_groups_added_by_foreign` (`added_by`),
  KEY `ticket_agent_groups_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `ticket_agent_groups_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `ticket_agent_groups_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_agent_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_agent_groups_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `ticket_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_agent_groups_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_channels` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `channel_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_channels_channel_name_company_id_unique` (`channel_name`,`company_id`),
  KEY `ticket_channels_company_id_foreign` (`company_id`),
  CONSTRAINT `ticket_channels_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_custom_forms` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `custom_fields_id` int unsigned DEFAULT NULL,
  `field_display_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `field_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `field_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
  `field_order` int NOT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `required` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_custom_forms_company_id_foreign` (`company_id`),
  KEY `ticket_custom_forms_custom_fields_id_foreign` (`custom_fields_id`),
  CONSTRAINT `ticket_custom_forms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_custom_forms_custom_fields_id_foreign` FOREIGN KEY (`custom_fields_id`) REFERENCES `custom_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `ticket_reply_id` int unsigned NOT NULL,
  `filename` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dropbox_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_files_user_id_foreign` (`user_id`),
  KEY `ticket_files_ticket_reply_id_foreign` (`ticket_reply_id`),
  CONSTRAINT `ticket_files_ticket_reply_id_foreign` FOREIGN KEY (`ticket_reply_id`) REFERENCES `ticket_replies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_groups` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `group_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_groups_company_id_foreign` (`company_id`),
  CONSTRAINT `ticket_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_replies` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ticket_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `imap_message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imap_message_uid` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imap_in_reply_to` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_replies_ticket_id_foreign` (`ticket_id`),
  KEY `ticket_replies_user_id_foreign` (`user_id`),
  CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_reply_templates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `reply_heading` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `reply_text` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_reply_templates_company_id_foreign` (`company_id`),
  CONSTRAINT `ticket_reply_templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_tag_list` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `tag_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_tag_list_company_id_foreign` (`company_id`),
  CONSTRAINT `ticket_tag_list_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ticket_number` bigint DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `subject` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('open','pending','resolved','closed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `priority` enum('low','medium','high','urgent') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `agent_id` int unsigned DEFAULT NULL,
  `channel_id` int unsigned DEFAULT NULL,
  `type_id` int unsigned DEFAULT NULL,
  `group_id` int unsigned DEFAULT NULL,
  `project_id` int unsigned DEFAULT NULL,
  `close_date` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `mobile` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_company_id_foreign` (`company_id`),
  KEY `tickets_user_id_foreign` (`user_id`),
  KEY `tickets_agent_id_foreign` (`agent_id`),
  KEY `tickets_channel_id_foreign` (`channel_id`),
  KEY `tickets_type_id_foreign` (`type_id`),
  KEY `tickets_country_id_foreign` (`country_id`),
  KEY `tickets_added_by_foreign` (`added_by`),
  KEY `tickets_last_updated_by_foreign` (`last_updated_by`),
  KEY `tickets_updated_at_index` (`updated_at`),
  KEY `tickets_group_id_foreign` (`group_id`),
  KEY `tickets_project_id_foreign` (`project_id`),
  CONSTRAINT `tickets_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_channel_id_foreign` FOREIGN KEY (`channel_id`) REFERENCES `ticket_channels` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `ticket_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tickets_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `ticket_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_tags` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `tag_id` int unsigned NOT NULL,
  `ticket_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_tags_company_id_foreign` (`company_id`),
  KEY `ticket_tags_tag_id_foreign` (`tag_id`),
  KEY `ticket_tags_ticket_id_foreign` (`ticket_id`),
  CONSTRAINT `ticket_tags_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_tags_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `ticket_tag_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_tags_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `ticket_types` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_types_type_company_id_unique` (`type`,`company_id`),
  KEY `ticket_types_company_id_foreign` (`company_id`),
  CONSTRAINT `ticket_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `translate_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `google_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `unit_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `unit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `default` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `unit_types_company_id_foreign` (`company_id`),
  CONSTRAINT `unit_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `universal_bundle_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `universal_module_installs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `module_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `universal_search` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `searchable_id` int NOT NULL,
  `module_type` enum('ticket','invoice','notice','proposal','task','creditNote','client','employee','project','estimate','lead') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `route_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `universal_search_company_id_foreign` (`company_id`),
  CONSTRAINT `universal_search_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=153 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_activities` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `activity` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_activities_company_id_foreign` (`company_id`),
  KEY `user_activities_user_id_foreign` (`user_id`),
  KEY `user_activities_created_at_index` (`created_at`),
  CONSTRAINT `user_activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_activities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_invitations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `invitation_type` enum('email','link') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'email',
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invitation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `email_restriction` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_invitations_company_id_foreign` (`company_id`),
  KEY `user_invitations_user_id_foreign` (`user_id`),
  CONSTRAINT `user_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_leadboard_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `pipeline_stage_id` int unsigned DEFAULT NULL,
  `collapsed` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_leadboard_settings_company_id_foreign` (`company_id`),
  KEY `user_leadboard_settings_user_id_foreign` (`user_id`),
  KEY `user_leadboard_settings_pipeline_stage_id_foreign` (`pipeline_stage_id`),
  CONSTRAINT `user_leadboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_leadboard_settings_pipeline_stage_id_foreign` FOREIGN KEY (`pipeline_stage_id`) REFERENCES `pipeline_stages` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `user_leadboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `permission_id` int unsigned NOT NULL,
  `permission_type_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_permissions_user_id_foreign` (`user_id`),
  KEY `user_permissions_permission_id_foreign` (`permission_id`),
  KEY `user_permissions_permission_type_id_foreign` (`permission_type_id`),
  CONSTRAINT `user_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_permissions_permission_type_id_foreign` FOREIGN KEY (`permission_type_id`) REFERENCES `permission_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_permissions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10249 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_taskboard_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `board_column_id` int unsigned NOT NULL,
  `collapsed` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_taskboard_settings_company_id_foreign` (`company_id`),
  KEY `user_taskboard_settings_user_id_foreign` (`user_id`),
  KEY `user_taskboard_settings_board_column_id_foreign` (`board_column_id`),
  CONSTRAINT `user_taskboard_settings_board_column_id_foreign` FOREIGN KEY (`board_column_id`) REFERENCES `taskboard_columns` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_taskboard_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_taskboard_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `user_zoom_meeting` (
  `user_id` int unsigned NOT NULL,
  `zoom_meeting_id` bigint unsigned NOT NULL,
  KEY `user_zoom_meeting_user_id_foreign` (`user_id`),
  KEY `user_zoom_meeting_zoom_meeting_id_foreign` (`zoom_meeting_id`),
  CONSTRAINT `user_zoom_meeting_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_zoom_meeting_zoom_meeting_id_foreign` FOREIGN KEY (`zoom_meeting_id`) REFERENCES `zoom_meetings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `users_chat` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_one` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `from` int unsigned DEFAULT NULL,
  `to` int unsigned DEFAULT NULL,
  `message_seen` enum('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `notification_sent` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `users_chat_company_id_foreign` (`company_id`),
  KEY `users_chat_user_one_foreign` (`user_one`),
  KEY `users_chat_user_id_foreign` (`user_id`),
  KEY `users_chat_from_foreign` (`from`),
  KEY `users_chat_to_foreign` (`to`),
  CONSTRAINT `users_chat_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_to_foreign` FOREIGN KEY (`to`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_user_one_foreign` FOREIGN KEY (`user_one`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `users_chat_files` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `users_chat_id` int unsigned NOT NULL,
  `filename` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `google_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashname` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_link_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `users_chat_files_company_id_foreign` (`company_id`),
  KEY `users_chat_files_user_id_foreign` (`user_id`),
  KEY `users_chat_files_users_chat_id_foreign` (`users_chat_id`),
  CONSTRAINT `users_chat_files_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `users_chat_files_users_chat_id_foreign` FOREIGN KEY (`users_chat_id`) REFERENCES `users_chat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `visa_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `country_id` int unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `visa_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `issue_date` date NOT NULL,
  `expiry_date` date NOT NULL,
  `file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `visa_details_company_id_foreign` (`company_id`),
  KEY `visa_details_user_id_foreign` (`user_id`),
  KEY `visa_details_added_by_foreign` (`added_by`),
  KEY `visa_details_country_id_foreign` (`country_id`),
  CONSTRAINT `visa_details_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `visa_details_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `visa_details_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `visa_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `webhooks_global_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `webhooks_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `webhook_for` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` tinyint(1) DEFAULT NULL,
  `url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_format` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `run_debug` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhooks_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `webhooks_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `webhooks_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned NOT NULL,
  `webhooks_setting_id` bigint unsigned NOT NULL,
  `method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `webhook_for` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `raw_content` text COLLATE utf8mb4_unicode_ci,
  `headers` text COLLATE utf8mb4_unicode_ci,
  `response` text COLLATE utf8mb4_unicode_ci,
  `response_code` int DEFAULT '200',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhooks_logs_webhooks_setting_id_foreign` (`webhooks_setting_id`),
  KEY `webhooks_logs_company_id_foreign` (`company_id`),
  CONSTRAINT `webhooks_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `webhooks_logs_webhooks_setting_id_foreign` FOREIGN KEY (`webhooks_setting_id`) REFERENCES `webhooks_settings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `webhooks_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `webhooks_setting_id` bigint unsigned DEFAULT NULL,
  `headers_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `headers_value` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_type` enum('headers','body') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'headers',
  `body_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `body_value` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhooks_requests_company_id_foreign` (`company_id`),
  KEY `webhooks_requests_webhooks_setting_id_foreign` (`webhooks_setting_id`),
  CONSTRAINT `webhooks_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `webhooks_requests_webhooks_setting_id_foreign` FOREIGN KEY (`webhooks_setting_id`) REFERENCES `webhooks_settings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `zoom_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `zoom_categories_company_id_foreign` (`company_id`),
  CONSTRAINT `zoom_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `zoom_global_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `license_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supported_until` timestamp NULL DEFAULT NULL,
  `purchased_on` timestamp NULL DEFAULT NULL,
  `notify_update` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `zoom_meetings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `meeting_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned NOT NULL,
  `meeting_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8mb4_unicode_ci,
  `start_date_time` datetime NOT NULL,
  `end_date_time` datetime NOT NULL,
  `repeat` tinyint(1) NOT NULL DEFAULT '0',
  `repeat_every` int DEFAULT NULL,
  `repeat_cycles` int DEFAULT NULL,
  `repeat_type` enum('day','week','month','year') COLLATE utf8mb4_unicode_ci NOT NULL,
  `send_reminder` tinyint(1) NOT NULL DEFAULT '0',
  `remind_time` int DEFAULT NULL,
  `remind_type` enum('day','hour','minute') COLLATE utf8mb4_unicode_ci NOT NULL,
  `host_video` tinyint(1) NOT NULL DEFAULT '0',
  `participant_video` tinyint(1) NOT NULL DEFAULT '0',
  `start_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `join_link` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('waiting','live','canceled','finished') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting',
  `project_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_meeting_id` bigint unsigned DEFAULT NULL,
  `occurrence_id` bigint DEFAULT NULL,
  `occurrence_order` int DEFAULT NULL,
  `category_id` bigint unsigned DEFAULT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `zoom_meetings_created_by_foreign` (`created_by`),
  KEY `zoom_meetings_project_id_foreign` (`project_id`),
  KEY `zoom_meetings_source_meeting_id_foreign` (`source_meeting_id`),
  KEY `zoom_meetings_category_id_foreign` (`category_id`),
  KEY `zoom_meetings_added_by_foreign` (`added_by`),
  KEY `zoom_meetings_last_updated_by_foreign` (`last_updated_by`),
  KEY `zoom_meetings_company_id_foreign` (`company_id`),
  CONSTRAINT `zoom_meetings_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `zoom_categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meetings_source_meeting_id_foreign` FOREIGN KEY (`source_meeting_id`) REFERENCES `zoom_meetings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `zoom_meeting_notes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `zoom_meeting_id` bigint unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` int unsigned DEFAULT NULL,
  `last_updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `zoom_meeting_notes_company_id_foreign` (`company_id`),
  KEY `zoom_meeting_notes_zoom_meeting_id_foreign` (`zoom_meeting_id`),
  KEY `zoom_meeting_notes_user_id_foreign` (`user_id`),
  KEY `zoom_meeting_added_by_foreign` (`added_by`),
  KEY `zoom_meeting_last_updated_by_foreign` (`last_updated_by`),
  CONSTRAINT `zoom_meeting_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `zoom_meeting_notes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meeting_notes_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `zoom_meeting_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `zoom_meeting_notes_zoom_meeting_id_foreign` FOREIGN KEY (`zoom_meeting_id`) REFERENCES `zoom_meetings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


CREATE TABLE `zoom_notification_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `setting_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `send_email` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `send_slack` enum('yes','no') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'no',
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `zoom_notification_settings_company_id_foreign` (`company_id`),
  CONSTRAINT `zoom_notification_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




INSERT INTO `application_sources` (`id`, `application_source`, `created_at`, `updated_at`) VALUES 
	(1,'Linkedin','2024-02-13 01:13:43','2024-02-13 01:13:43'),
	(2,'Facebook','2024-02-13 01:13:43','2024-02-13 01:13:43'),
	(3,'Instagram','2024-02-13 01:13:43','2024-02-13 01:13:43'),
	(4,'Twitter','2024-02-13 01:13:43','2024-02-13 01:13:43'),
	(5,'Other','2024-02-13 01:13:43','2024-02-13 01:13:43');


INSERT INTO `appreciations` (`id`, `company_id`, `award_id`, `award_to`, `award_date`, `image`, `summary`, `added_by`, `created_at`, `updated_at`) VALUES 
	(1,1,16,21,'2024-01-03',NULL,NULL,18,NULL,NULL),
	(2,1,3,1,'2024-01-03',NULL,NULL,15,NULL,NULL),
	(3,1,5,15,'2024-01-03',NULL,NULL,14,NULL,NULL),
	(4,1,10,2,'2024-01-03',NULL,NULL,17,NULL,NULL),
	(5,1,2,1,'2024-01-03',NULL,NULL,22,NULL,NULL),
	(6,1,12,17,'2024-01-03',NULL,NULL,16,NULL,NULL),
	(7,1,13,17,'2024-01-03',NULL,NULL,23,NULL,NULL),
	(8,1,11,16,'2024-01-03',NULL,NULL,19,NULL,NULL),
	(9,1,5,21,'2024-01-03',NULL,NULL,14,NULL,NULL),
	(10,1,11,16,'2024-01-03',NULL,NULL,2,NULL,NULL);




INSERT INTO `asset_settings` (`id`, `purchase_code`, `supported_until`, `purchased_on`, `license_type`, `notify_update`, `created_at`, `updated_at`) VALUES 
	(1,NULL,NULL,NULL,NULL,1,'2024-02-13 01:13:40','2024-02-13 01:13:40');






INSERT INTO `attendance_settings` (`id`, `company_id`, `auto_clock_in`, `auto_clock_in_location`, `office_start_time`, `office_end_time`, `halfday_mark_time`, `late_mark_duration`, `clockin_in_day`, `employee_clock_in_out`, `office_open_days`, `ip_address`, `radius`, `radius_check`, `ip_check`, `alert_after`, `alert_after_status`, `save_current_location`, `default_employee_shift`, `week_start_from`, `allow_shift_change`, `show_clock_in_button`, `created_at`, `updated_at`, `monthly_report`, `monthly_report_roles`) VALUES 
	(1,1,'no','office','09:00:00','18:00:00',NULL,20,1,'yes','[1,2,3,4,5]',NULL,NULL,'no','no',NULL,0,0,2,'1',1,'no','2024-02-13 01:13:57','2024-02-13 01:13:57',0,NULL);


INSERT INTO `company_addresses` (`id`, `company_id`, `country_id`, `address`, `is_default`, `tax_number`, `tax_name`, `location`, `created_at`, `updated_at`, `latitude`, `longitude`) VALUES 
	(1,1,NULL,'Your Company address here',1,NULL,NULL,'Worksuite','2024-02-13 01:13:57','2024-02-13 01:13:57',NULL,NULL);


INSERT INTO `attendances` (`id`, `company_id`, `user_id`, `location_id`, `clock_in_time`, `clock_out_time`, `clock_in_ip`, `clock_out_ip`, `working_from`, `late`, `half_day`, `added_by`, `last_updated_by`, `latitude`, `longitude`, `shift_start_time`, `shift_end_time`, `employee_shift_id`, `created_at`, `updated_at`, `work_from_type`, `overwrite_attendance`) VALUES 
	(1,1,1,NULL,'2024-02-11 10:00:00','2024-02-11 13:00:00','18.174.67.221','18.174.67.221','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-09 05:49:15',NULL,'other','no'),
	(2,1,2,NULL,'2024-02-08 12:15:00','2024-02-08 17:15:00','165.14.154.140','165.14.154.140','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-01-31 22:18:58',NULL,'other','no'),
	(3,1,14,NULL,'2024-01-14 10:00:00','2024-01-14 15:00:00','125.36.221.183','125.36.221.183','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-01-30 08:28:33',NULL,'other','no'),
	(4,1,15,NULL,'2024-01-26 11:00:00','2024-01-26 15:00:00','2.196.246.61','2.196.246.61','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-05 22:39:37',NULL,'other','no'),
	(5,1,16,NULL,'2024-01-23 10:00:00','2024-01-23 19:00:00','54.115.24.168','54.115.24.168','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-12 10:46:34',NULL,'other','no'),
	(6,1,17,NULL,'2024-02-08 13:00:00','2024-02-08 19:00:00','205.9.207.160','205.9.207.160','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-11 19:44:07',NULL,'other','no'),
	(7,1,18,NULL,'2024-02-01 11:00:00','2024-02-01 16:00:00','232.17.214.6','232.17.214.6','office','no','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-03 12:58:49',NULL,'other','no'),
	(8,1,19,NULL,'2024-02-06 12:00:00','2024-02-06 13:00:00','142.40.251.146','142.40.251.146','office','no','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-01 17:59:24',NULL,'other','no'),
	(9,1,20,NULL,'2024-01-26 12:00:00','2024-01-26 14:00:00','17.103.241.225','17.103.241.225','office','no','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-01-07 11:00:14',NULL,'other','no'),
	(10,1,21,NULL,'2024-01-21 12:00:00','2024-01-21 14:00:00','71.192.135.95','71.192.135.95','office','no','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-04 22:25:07',NULL,'other','no'),
	(11,1,22,NULL,'2024-01-22 09:00:00','2024-01-22 10:00:00','149.55.173.127','149.55.173.127','office','no','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-08 22:31:14',NULL,'other','no'),
	(12,1,23,NULL,'2024-02-11 12:00:00','2024-02-11 13:00:00','44.69.158.165','44.69.158.165','office','yes','no',1,NULL,NULL,NULL,NULL,NULL,NULL,'2024-01-16 22:16:44',NULL,'other','no');


INSERT INTO `award_icons` (`id`, `title`, `icon`, `created_at`, `updated_at`) VALUES 
	(1,'Trophy','trophy','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(2,'Thumbs Up','hand-thumbs-up','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(3,'Award','award','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(4,'Book','book','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(5,'Gift','gift','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(6,'Watch','watch','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(7,'Cup','cup-hot','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(8,'Puzzle','puzzle','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(9,'Plane','airplane','2024-02-13 01:13:56','2024-02-13 01:13:56'),
	(10,'Money','piggy-bank','2024-02-13 01:13:56','2024-02-13 01:13:56');


INSERT INTO `awards` (`id`, `company_id`, `title`, `award_icon_id`, `summary`, `status`, `color_code`, `created_at`, `updated_at`) VALUES 
	(1,1,'Best Team Player',8,NULL,'active','#282E33',NULL,NULL),
	(2,1,'Most Innovative Project',4,NULL,'active','#3DADDD',NULL,NULL),
	(3,1,'Best Technical Solution',6,NULL,'active','#495E67',NULL,NULL),
	(4,1,'Best Customer Service',8,NULL,'active','#3DADDD',NULL,NULL),
	(5,1,'Employee of the Month',3,NULL,'active','#FF3838',NULL,NULL),
	(6,1,'Best Mentor',5,NULL,'active','#387B1C',NULL,NULL),
	(7,1,'Top Sales Performer',9,NULL,'active','#3DADDD',NULL,NULL),
	(8,1,'Best Project Manager',6,NULL,'active','#282E33',NULL,NULL),
	(9,1,'Top Code Contributor',2,NULL,'active','#387B1C',NULL,NULL),
	(10,1,'Most Improved Employee',7,NULL,'active','#282E33',NULL,NULL),
	(11,1,'Best New Hire',5,NULL,'active','#FF3838',NULL,NULL),
	(12,1,'Best Presentation',8,NULL,'active','#FF3838',NULL,NULL),
	(13,1,'Best Quality Control',6,NULL,'active','#3DADDD',NULL,NULL),
	(14,1,'Best Technical Writer',10,NULL,'active','#FF3838',NULL,NULL),
	(15,1,'Most Valuable Employee',7,NULL,'active','#282E33',NULL,NULL),
	(16,1,'Employee of the month',2,NULL,'active','#495E67',NULL,NULL),
	(17,1,'Star Performer Award',4,NULL,'active','#3DADDD',NULL,NULL);


INSERT INTO `bank_accounts` (`id`, `company_id`, `type`, `bank_name`, `account_name`, `account_number`, `account_type`, `currency_id`, `contact_number`, `opening_balance`, `bank_logo`, `status`, `added_by`, `last_updated_by`, `bank_balance`, `created_at`, `updated_at`) VALUES 
	(1,1,'bank','Primary Account','Boyle, Harris and Bruen','438961404586','current',1,'1-585-212-8877',12278.00,NULL,1,NULL,NULL,170485.00,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(2,1,'bank','Secondary Account','Kuvalis, Schmidt and Cole','80087316093814','current',1,'1-580-563-0096',55729.00,NULL,1,NULL,NULL,300118.00,'2024-02-13 01:13:59','2024-02-13 01:13:59');


INSERT INTO `bank_transactions` (`id`, `company_id`, `bank_account_id`, `payment_id`, `invoice_id`, `expense_id`, `amount`, `type`, `added_by`, `last_updated_by`, `memo`, `transaction_relation`, `transaction_related_to`, `title`, `transaction_date`, `bank_balance`, `created_at`, `updated_at`, `purchase_payment_id`) VALUES 
	(1,1,1,NULL,NULL,NULL,12278.00,'Cr',NULL,NULL,NULL,'bank',NULL,'bank-account-created','2024-02-13',12278.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(2,1,2,NULL,NULL,NULL,55729.00,'Cr',NULL,NULL,NULL,'bank',NULL,'bank-account-created','2024-02-13',55729.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(3,1,1,1,1,NULL,17848.00,'Cr',NULL,NULL,NULL,'payment','1','payment-credited','2024-02-03',30126.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(4,1,2,2,2,NULL,34367.00,'Cr',NULL,NULL,NULL,'payment','2','payment-credited','2024-02-05',90096.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(5,1,1,3,3,NULL,11460.00,'Cr',NULL,NULL,NULL,'payment','3','payment-credited','2024-02-12',41586.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(6,1,2,4,4,NULL,63004.00,'Cr',NULL,NULL,NULL,'payment','4','payment-credited','2024-02-02',153100.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(7,1,2,5,5,NULL,25906.00,'Cr',NULL,NULL,NULL,'payment','5','payment-credited','2024-02-03',179006.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(8,1,1,6,6,NULL,33852.00,'Cr',NULL,NULL,NULL,'payment','6','payment-credited','2024-02-05',75438.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(9,1,1,7,7,NULL,18926.00,'Cr',NULL,NULL,NULL,'payment','7','payment-credited','2024-02-04',94364.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(10,1,2,8,9,NULL,28384.00,'Cr',NULL,NULL,NULL,'payment','8','payment-credited','2024-02-03',207390.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(11,1,1,9,10,NULL,23847.00,'Cr',NULL,NULL,NULL,'payment','9','payment-credited','2024-02-10',118211.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(12,1,1,10,11,NULL,28033.00,'Cr',NULL,NULL,NULL,'payment','10','payment-credited','2024-02-01',146244.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(13,1,1,11,12,NULL,24241.00,'Cr',NULL,NULL,NULL,'payment','11','payment-credited','2024-02-08',170485.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(14,1,2,12,13,NULL,41356.00,'Cr',NULL,NULL,NULL,'payment','12','payment-credited','2024-02-02',248746.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(15,1,2,13,15,NULL,26120.00,'Cr',NULL,NULL,NULL,'payment','13','payment-credited','2024-02-08',274866.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(16,1,2,14,17,NULL,25252.00,'Cr',NULL,NULL,NULL,'payment','14','payment-credited','2024-02-06',300118.00,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL);










INSERT INTO `client_details` (`id`, `company_id`, `user_id`, `company_name`, `address`, `shipping_address`, `postal_code`, `state`, `city`, `office`, `website`, `note`, `linkedin`, `facebook`, `twitter`, `skype`, `tax_name`, `gst_number`, `category_id`, `sub_category_id`, `added_by`, `last_updated_by`, `company_logo`, `created_at`, `updated_at`, `quickbooks_client_id`, `electronic_address`, `electronic_address_scheme`) VALUES 
	(1,1,3,'Koepp Ltd','4555 Rempel Square Apt. 955\nWest Mandy, IL 58185',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57',NULL,NULL,NULL),
	(2,1,4,'Kirlin-Larkin','92087 Anderson Meadow\nDevanburgh, PA 85983-6791',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(3,1,5,'Bartoletti-McGlynn','88022 Emily Squares\nPort Unique, RI 62328',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(4,1,6,'Feest LLC','115 Breitenberg Isle\nStrosinbury, NH 72290-1934',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(5,1,7,'Schneider Group','6363 Strosin Village\nSouth Sydnee, OH 82179-3587',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(6,1,8,'Hackett, Hoppe and Collins','6098 Price Pike Apt. 986\nEast Carletonbury, VT 67727',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(7,1,9,'Oberbrunner-Schneider','64874 Sarah Island Suite 883\nNorth Reidberg, SD 76602-7593',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(8,1,10,'Shields, Daniel and Haley','4464 Simonis Trace\nWest Lavern, NY 51458',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(9,1,11,'Huels-Sanford','54156 Joyce Mountain Apt. 877\nFeeneyberg, TN 57803-4800',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(10,1,12,'Ondricka Group','5259 Maci Motorway Apt. 278\nHamillstad, KS 62225-8535',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL),
	(11,1,13,'O\'Conner PLC','455 Becker Junctions Apt. 625\nDaytonview, KY 52255-9718',NULL,NULL,NULL,NULL,NULL,'https://worksuite.biz',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:58','2024-02-13 01:13:58',NULL,NULL,NULL);


















INSERT INTO `contract_types` (`id`, `company_id`, `name`, `created_at`, `updated_at`) VALUES 
	(1,1,'Employment contract',NULL,NULL),
	(2,1,'Service contract',NULL,NULL),
	(3,1,'Construction contract',NULL,NULL),
	(4,1,'Sales contract',NULL,NULL),
	(5,1,'Lease contract',NULL,NULL),
	(6,1,'Purchase agreement',NULL,NULL),
	(7,1,'Partnership agreement',NULL,NULL),
	(8,1,'Non-disclosure agreement',NULL,NULL),
	(9,1,'Non-compete agreement',NULL,NULL),
	(10,1,'Joint venture agreement',NULL,NULL),
	(11,1,'Franchise agreement',NULL,NULL),
	(12,1,'Loan agreement',NULL,NULL),
	(13,1,'License agreement',NULL,NULL),
	(14,1,'Consulting agreement',NULL,NULL),
	(15,1,'Distribution agreement',NULL,NULL),
	(16,1,'Supply agreement',NULL,NULL),
	(17,1,'Indemnification agreement',NULL,NULL),
	(18,1,'Guarantee agreement',NULL,NULL),
	(19,1,'Insurance contract',NULL,NULL),
	(20,1,'Agency agreement',NULL,NULL),
	(21,1,'Master service agreement',NULL,NULL),
	(22,1,'Subcontractor agreement',NULL,NULL),
	(23,1,'Operating agreement',NULL,NULL),
	(24,1,'Shareholders agreement',NULL,NULL),
	(25,1,'Employee handbook',NULL,NULL),
	(26,1,'Independent contractor agreement',NULL,NULL),
	(27,1,'Subscription agreement',NULL,NULL),
	(28,1,'Software license agreement',NULL,NULL),
	(29,1,'Terms of use',NULL,NULL),
	(30,1,'Privacy policy',NULL,NULL),
	(31,1,'End-user license agreement',NULL,NULL),
	(32,1,'Service level agreement',NULL,NULL),
	(33,1,'Maintenance agreement',NULL,NULL),
	(34,1,'Support agreement',NULL,NULL),
	(35,1,'Professional services agreement',NULL,NULL),
	(36,1,'Statement of work',NULL,NULL),
	(37,1,'Memorandum of understanding',NULL,NULL),
	(38,1,'Letter of intent',NULL,NULL),
	(39,1,'Memorandum of agreement',NULL,NULL);








INSERT INTO `countries` (`id`, `iso`, `name`, `nicename`, `iso3`, `numcode`, `phonecode`) VALUES 
	(1,'AF','AFGHANISTAN','Afghanistan','AFG',4,93),
	(2,'AL','ALBANIA','Albania','ALB',8,355),
	(3,'DZ','ALGERIA','Algeria','DZA',12,213),
	(4,'AS','AMERICAN SAMOA','American Samoa','ASM',16,1684),
	(5,'AD','ANDORRA','Andorra','AND',20,376),
	(6,'AO','ANGOLA','Angola','AGO',24,244),
	(7,'AI','ANGUILLA','Anguilla','AIA',660,1264),
	(8,'AQ','ANTARCTICA','Antarctica',NULL,NULL,0),
	(9,'AG','ANTIGUA AND BARBUDA','Antigua and Barbuda','ATG',28,1268),
	(10,'AR','ARGENTINA','Argentina','ARG',32,54),
	(11,'AM','ARMENIA','Armenia','ARM',51,374),
	(12,'AW','ARUBA','Aruba','ABW',533,297),
	(13,'AU','AUSTRALIA','Australia','AUS',36,61),
	(14,'AT','AUSTRIA','Austria','AUT',40,43),
	(15,'AZ','AZERBAIJAN','Azerbaijan','AZE',31,994),
	(16,'BS','BAHAMAS','Bahamas','BHS',44,1242),
	(17,'BH','BAHRAIN','Bahrain','BHR',48,973),
	(18,'BD','BANGLADESH','Bangladesh','BGD',50,880),
	(19,'BB','BARBADOS','Barbados','BRB',52,1246),
	(20,'BY','BELARUS','Belarus','BLR',112,375),
	(21,'BE','BELGIUM','Belgium','BEL',56,32),
	(22,'BZ','BELIZE','Belize','BLZ',84,501),
	(23,'BJ','BENIN','Benin','BEN',204,229),
	(24,'BM','BERMUDA','Bermuda','BMU',60,1441),
	(25,'BT','BHUTAN','Bhutan','BTN',64,975),
	(26,'BO','BOLIVIA','Bolivia','BOL',68,591),
	(27,'BA','BOSNIA AND HERZEGOVINA','Bosnia and Herzegovina','BIH',70,387),
	(28,'BW','BOTSWANA','Botswana','BWA',72,267),
	(29,'BV','BOUVET ISLAND','Bouvet Island',NULL,NULL,0),
	(30,'BR','BRAZIL','Brazil','BRA',76,55),
	(31,'IO','BRITISH INDIAN OCEAN TERRITORY','British Indian Ocean Territory',NULL,NULL,246),
	(32,'BN','BRUNEI DARUSSALAM','Brunei Darussalam','BRN',96,673),
	(33,'BG','BULGARIA','Bulgaria','BGR',100,359),
	(34,'BF','BURKINA FASO','Burkina Faso','BFA',854,226),
	(35,'BI','BURUNDI','Burundi','BDI',108,257),
	(36,'KH','CAMBODIA','Cambodia','KHM',116,855),
	(37,'CM','CAMEROON','Cameroon','CMR',120,237),
	(38,'CA','CANADA','Canada','CAN',124,1),
	(39,'CV','CAPE VERDE','Cape Verde','CPV',132,238),
	(40,'KY','CAYMAN ISLANDS','Cayman Islands','CYM',136,1345),
	(41,'CF','CENTRAL AFRICAN REPUBLIC','Central African Republic','CAF',140,236),
	(42,'TD','CHAD','Chad','TCD',148,235),
	(43,'CL','CHILE','Chile','CHL',152,56),
	(44,'CN','CHINA','China','CHN',156,86),
	(45,'CX','CHRISTMAS ISLAND','Christmas Island',NULL,NULL,61),
	(46,'CC','COCOS (KEELING) ISLANDS','Cocos (Keeling) Islands',NULL,NULL,672),
	(47,'CO','COLOMBIA','Colombia','COL',170,57),
	(48,'KM','COMOROS','Comoros','COM',174,269),
	(49,'CG','CONGO','Congo','COG',178,242),
	(50,'CD','CONGO, THE DEMOCRATIC REPUBLIC OF THE','Congo, the Democratic Republic of the','COD',180,242),
	(51,'CK','COOK ISLANDS','Cook Islands','COK',184,682),
	(52,'CR','COSTA RICA','Costa Rica','CRI',188,506),
	(53,'CI','COTE D\'IVOIRE','Cote D\'Ivoire','CIV',384,225),
	(54,'HR','CROATIA','Croatia','HRV',191,385),
	(55,'CU','CUBA','Cuba','CUB',192,53),
	(56,'CY','CYPRUS','Cyprus','CYP',196,357),
	(57,'CZ','CZECH REPUBLIC','Czech Republic','CZE',203,420),
	(58,'DK','DENMARK','Denmark','DNK',208,45),
	(59,'DJ','DJIBOUTI','Djibouti','DJI',262,253),
	(60,'DM','DOMINICA','Dominica','DMA',212,1767),
	(61,'DO','DOMINICAN REPUBLIC','Dominican Republic','DOM',214,1809),
	(62,'EC','ECUADOR','Ecuador','ECU',218,593),
	(63,'EG','EGYPT','Egypt','EGY',818,20),
	(64,'SV','EL SALVADOR','El Salvador','SLV',222,503),
	(65,'GQ','EQUATORIAL GUINEA','Equatorial Guinea','GNQ',226,240),
	(66,'ER','ERITREA','Eritrea','ERI',232,291),
	(67,'EE','ESTONIA','Estonia','EST',233,372),
	(68,'ET','ETHIOPIA','Ethiopia','ETH',231,251),
	(69,'FK','FALKLAND ISLANDS (MALVINAS)','Falkland Islands (Malvinas)','FLK',238,500),
	(70,'FO','FAROE ISLANDS','Faroe Islands','FRO',234,298),
	(71,'FJ','FIJI','Fiji','FJI',242,679),
	(72,'FI','FINLAND','Finland','FIN',246,358),
	(73,'FR','FRANCE','France','FRA',250,33),
	(74,'GF','FRENCH GUIANA','French Guiana','GUF',254,594),
	(75,'PF','FRENCH POLYNESIA','French Polynesia','PYF',258,689),
	(76,'TF','FRENCH SOUTHERN TERRITORIES','French Southern Territories',NULL,NULL,0),
	(77,'GA','GABON','Gabon','GAB',266,241),
	(78,'GM','GAMBIA','Gambia','GMB',270,220),
	(79,'GE','GEORGIA','Georgia','GEO',268,995),
	(80,'DE','GERMANY','Germany','DEU',276,49),
	(81,'GH','GHANA','Ghana','GHA',288,233),
	(82,'GI','GIBRALTAR','Gibraltar','GIB',292,350),
	(83,'GR','GREECE','Greece','GRC',300,30),
	(84,'GL','GREENLAND','Greenland','GRL',304,299),
	(85,'GD','GRENADA','Grenada','GRD',308,1473),
	(86,'GP','GUADELOUPE','Guadeloupe','GLP',312,590),
	(87,'GU','GUAM','Guam','GUM',316,1671),
	(88,'GT','GUATEMALA','Guatemala','GTM',320,502),
	(89,'GN','GUINEA','Guinea','GIN',324,224),
	(90,'GW','GUINEA-BISSAU','Guinea-Bissau','GNB',624,245),
	(91,'GY','GUYANA','Guyana','GUY',328,592),
	(92,'HT','HAITI','Haiti','HTI',332,509),
	(93,'HM','HEARD ISLAND AND MCDONALD ISLANDS','Heard Island and Mcdonald Islands',NULL,NULL,0),
	(94,'VA','HOLY SEE (VATICAN CITY STATE)','Holy See (Vatican City State)','VAT',336,39),
	(95,'HN','HONDURAS','Honduras','HND',340,504),
	(96,'HK','HONG KONG','Hong Kong','HKG',344,852),
	(97,'HU','HUNGARY','Hungary','HUN',348,36),
	(98,'IS','ICELAND','Iceland','ISL',352,354),
	(99,'IN','INDIA','India','IND',356,91),
	(100,'ID','INDONESIA','Indonesia','IDN',360,62),
	(101,'IR','IRAN, ISLAMIC REPUBLIC OF','Iran, Islamic Republic of','IRN',364,98),
	(102,'IQ','IRAQ','Iraq','IRQ',368,964),
	(103,'IE','IRELAND','Ireland','IRL',372,353),
	(104,'IL','ISRAEL','Israel','ISR',376,972),
	(105,'IT','ITALY','Italy','ITA',380,39),
	(106,'JM','JAMAICA','Jamaica','JAM',388,1876),
	(107,'JP','JAPAN','Japan','JPN',392,81),
	(108,'JO','JORDAN','Jordan','JOR',400,962),
	(109,'KZ','KAZAKHSTAN','Kazakhstan','KAZ',398,7),
	(110,'KE','KENYA','Kenya','KEN',404,254),
	(111,'KI','KIRIBATI','Kiribati','KIR',296,686),
	(112,'KP','KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF','Korea, Democratic People\'s Republic of','PRK',408,850),
	(113,'KR','KOREA, REPUBLIC OF','Korea, Republic of','KOR',410,82),
	(114,'KW','KUWAIT','Kuwait','KWT',414,965),
	(115,'KG','KYRGYZSTAN','Kyrgyzstan','KGZ',417,996),
	(116,'LA','LAO PEOPLE\'S DEMOCRATIC REPUBLIC','Lao People\'s Democratic Republic','LAO',418,856),
	(117,'LV','LATVIA','Latvia','LVA',428,371),
	(118,'LB','LEBANON','Lebanon','LBN',422,961),
	(119,'LS','LESOTHO','Lesotho','LSO',426,266),
	(120,'LR','LIBERIA','Liberia','LBR',430,231),
	(121,'LY','LIBYAN ARAB JAMAHIRIYA','Libyan Arab Jamahiriya','LBY',434,218),
	(122,'LI','LIECHTENSTEIN','Liechtenstein','LIE',438,423),
	(123,'LT','LITHUANIA','Lithuania','LTU',440,370),
	(124,'LU','LUXEMBOURG','Luxembourg','LUX',442,352),
	(125,'MO','MACAO','Macao','MAC',446,853),
	(126,'MK','MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF','Macedonia, the Former Yugoslav Republic of','MKD',807,389),
	(127,'MG','MADAGASCAR','Madagascar','MDG',450,261),
	(128,'MW','MALAWI','Malawi','MWI',454,265),
	(129,'MY','MALAYSIA','Malaysia','MYS',458,60),
	(130,'MV','MALDIVES','Maldives','MDV',462,960),
	(131,'ML','MALI','Mali','MLI',466,223),
	(132,'MT','MALTA','Malta','MLT',470,356),
	(133,'MH','MARSHALL ISLANDS','Marshall Islands','MHL',584,692),
	(134,'MQ','MARTINIQUE','Martinique','MTQ',474,596),
	(135,'MR','MAURITANIA','Mauritania','MRT',478,222),
	(136,'MU','MAURITIUS','Mauritius','MUS',480,230),
	(137,'YT','MAYOTTE','Mayotte',NULL,NULL,269),
	(138,'MX','MEXICO','Mexico','MEX',484,52),
	(139,'FM','MICRONESIA, FEDERATED STATES OF','Micronesia, Federated States of','FSM',583,691),
	(140,'MD','MOLDOVA, REPUBLIC OF','Moldova, Republic of','MDA',498,373),
	(141,'MC','MONACO','Monaco','MCO',492,377),
	(142,'MN','MONGOLIA','Mongolia','MNG',496,976),
	(143,'MS','MONTSERRAT','Montserrat','MSR',500,1664),
	(144,'MA','MOROCCO','Morocco','MAR',504,212),
	(145,'MZ','MOZAMBIQUE','Mozambique','MOZ',508,258),
	(146,'MM','MYANMAR','Myanmar','MMR',104,95),
	(147,'NA','NAMIBIA','Namibia','NAM',516,264),
	(148,'NR','NAURU','Nauru','NRU',520,674),
	(149,'NP','NEPAL','Nepal','NPL',524,977),
	(150,'NL','NETHERLANDS','Netherlands','NLD',528,31),
	(151,'AN','NETHERLANDS ANTILLES','Netherlands Antilles','ANT',530,599),
	(152,'NC','NEW CALEDONIA','New Caledonia','NCL',540,687),
	(153,'NZ','NEW ZEALAND','New Zealand','NZL',554,64),
	(154,'NI','NICARAGUA','Nicaragua','NIC',558,505),
	(155,'NE','NIGER','Niger','NER',562,227),
	(156,'NG','NIGERIA','Nigeria','NGA',566,234),
	(157,'NU','NIUE','Niue','NIU',570,683),
	(158,'NF','NORFOLK ISLAND','Norfolk Island','NFK',574,672),
	(159,'MP','NORTHERN MARIANA ISLANDS','Northern Mariana Islands','MNP',580,1670),
	(160,'NO','NORWAY','Norway','NOR',578,47),
	(161,'OM','OMAN','Oman','OMN',512,968),
	(162,'PK','PAKISTAN','Pakistan','PAK',586,92),
	(163,'PW','PALAU','Palau','PLW',585,680),
	(164,'PS','PALESTINIAN TERRITORY, OCCUPIED','Palestinian Territory, Occupied',NULL,NULL,970),
	(165,'PA','PANAMA','Panama','PAN',591,507),
	(166,'PG','PAPUA NEW GUINEA','Papua New Guinea','PNG',598,675),
	(167,'PY','PARAGUAY','Paraguay','PRY',600,595),
	(168,'PE','PERU','Peru','PER',604,51),
	(169,'PH','PHILIPPINES','Philippines','PHL',608,63),
	(170,'PN','PITCAIRN','Pitcairn','PCN',612,0),
	(171,'PL','POLAND','Poland','POL',616,48),
	(172,'PT','PORTUGAL','Portugal','PRT',620,351),
	(173,'PR','PUERTO RICO','Puerto Rico','PRI',630,1787),
	(174,'QA','QATAR','Qatar','QAT',634,974),
	(175,'RE','REUNION','Reunion','REU',638,262),
	(176,'RO','ROMANIA','Romania','ROM',642,40),
	(177,'RU','RUSSIAN FEDERATION','Russian Federation','RUS',643,7),
	(178,'RW','RWANDA','Rwanda','RWA',646,250),
	(179,'SH','SAINT HELENA','Saint Helena','SHN',654,290),
	(180,'KN','SAINT KITTS AND NEVIS','Saint Kitts and Nevis','KNA',659,1869),
	(181,'LC','SAINT LUCIA','Saint Lucia','LCA',662,1758),
	(182,'PM','SAINT PIERRE AND MIQUELON','Saint Pierre and Miquelon','SPM',666,508),
	(183,'VC','SAINT VINCENT AND THE GRENADINES','Saint Vincent and the Grenadines','VCT',670,1784),
	(184,'WS','SAMOA','Samoa','WSM',882,684),
	(185,'SM','SAN MARINO','San Marino','SMR',674,378),
	(186,'ST','SAO TOME AND PRINCIPE','Sao Tome and Principe','STP',678,239),
	(187,'SA','SAUDI ARABIA','Saudi Arabia','SAU',682,966),
	(188,'SN','SENEGAL','Senegal','SEN',686,221),
	(189,'CS','SERBIA AND MONTENEGRO','Serbia and Montenegro',NULL,NULL,381),
	(190,'SC','SEYCHELLES','Seychelles','SYC',690,248),
	(191,'SL','SIERRA LEONE','Sierra Leone','SLE',694,232),
	(192,'SG','SINGAPORE','Singapore','SGP',702,65),
	(193,'SK','SLOVAKIA','Slovakia','SVK',703,421),
	(194,'SI','SLOVENIA','Slovenia','SVN',705,386),
	(195,'SB','SOLOMON ISLANDS','Solomon Islands','SLB',90,677),
	(196,'SO','SOMALIA','Somalia','SOM',706,252),
	(197,'ZA','SOUTH AFRICA','South Africa','ZAF',710,27),
	(198,'GS','SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS','South Georgia and the South Sandwich Islands',NULL,NULL,0),
	(199,'ES','SPAIN','Spain','ESP',724,34),
	(200,'LK','SRI LANKA','Sri Lanka','LKA',144,94),
	(201,'SD','SUDAN','Sudan','SDN',736,249),
	(202,'SR','SURINAME','Suriname','SUR',740,597),
	(203,'SJ','SVALBARD AND JAN MAYEN','Svalbard and Jan Mayen','SJM',744,47),
	(204,'SZ','SWAZILAND','Swaziland','SWZ',748,268),
	(205,'SE','SWEDEN','Sweden','SWE',752,46),
	(206,'CH','SWITZERLAND','Switzerland','CHE',756,41),
	(207,'SY','SYRIAN ARAB REPUBLIC','Syrian Arab Republic','SYR',760,963),
	(208,'TW','TAIWAN, PROVINCE OF CHINA','Taiwan, Province of China','TWN',158,886),
	(209,'TJ','TAJIKISTAN','Tajikistan','TJK',762,992),
	(210,'TZ','TANZANIA, UNITED REPUBLIC OF','Tanzania, United Republic of','TZA',834,255),
	(211,'TH','THAILAND','Thailand','THA',764,66),
	(212,'TL','TIMOR-LESTE','Timor-Leste',NULL,NULL,670),
	(213,'TG','TOGO','Togo','TGO',768,228),
	(214,'TK','TOKELAU','Tokelau','TKL',772,690),
	(215,'TO','TONGA','Tonga','TON',776,676),
	(216,'TT','TRINIDAD AND TOBAGO','Trinidad and Tobago','TTO',780,1868),
	(217,'TN','TUNISIA','Tunisia','TUN',788,216),
	(218,'TR','TURKEY','Turkey','TUR',792,90),
	(219,'TM','TURKMENISTAN','Turkmenistan','TKM',795,7370),
	(220,'TC','TURKS AND CAICOS ISLANDS','Turks and Caicos Islands','TCA',796,1649),
	(221,'TV','TUVALU','Tuvalu','TUV',798,688),
	(222,'UG','UGANDA','Uganda','UGA',800,256),
	(223,'UA','UKRAINE','Ukraine','UKR',804,380),
	(224,'AE','UNITED ARAB EMIRATES','United Arab Emirates','ARE',784,971),
	(225,'GB','UNITED KINGDOM','United Kingdom','GBR',826,44),
	(226,'US','UNITED STATES','United States','USA',840,1),
	(227,'UM','UNITED STATES MINOR OUTLYING ISLANDS','United States Minor Outlying Islands',NULL,NULL,1),
	(228,'UY','URUGUAY','Uruguay','URY',858,598),
	(229,'UZ','UZBEKISTAN','Uzbekistan','UZB',860,998),
	(230,'VU','VANUATU','Vanuatu','VUT',548,678),
	(231,'VE','VENEZUELA','Venezuela','VEN',862,58),
	(232,'VN','VIET NAM','Viet Nam','VNM',704,84),
	(233,'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB',92,1284),
	(234,'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR',850,1340),
	(235,'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF',876,681),
	(236,'EH','WESTERN SAHARA','Western Sahara','ESH',732,212),
	(237,'YE','YEMEN','Yemen','YEM',887,967),
	(238,'ZM','ZAMBIA','Zambia','ZMB',894,260),
	(239,'ZW','ZIMBABWE','Zimbabwe','ZWE',716,263),
	(240,'RS','SERBIA','Serbia','SRB',688,381),
	(241,'AP','ASIA PACIFIC REGION','Asia / Pacific Region','0',0,0),
	(242,'ME','MONTENEGRO','Montenegro','MNE',499,382),
	(243,'AX','ALAND ISLANDS','Aland Islands','ALA',248,358),
	(244,'BQ','BONAIRE, SINT EUSTATIUS AND SABA','Bonaire, Sint Eustatius and Saba','BES',535,599),
	(245,'CW','CURACAO','Curacao','CUW',531,599),
	(246,'GG','GUERNSEY','Guernsey','GGY',831,44),
	(247,'IM','ISLE OF MAN','Isle of Man','IMN',833,44),
	(248,'JE','JERSEY','Jersey','JEY',832,44),
	(249,'XK','KOSOVO','Kosovo','---',0,381),
	(250,'BL','SAINT BARTHELEMY','Saint Barthelemy','BLM',652,590),
	(251,'MF','SAINT MARTIN','Saint Martin','MAF',663,590),
	(252,'SX','SINT MAARTEN','Sint Maarten','SXM',534,1),
	(253,'SS','SOUTH SUDAN','South Sudan','SSD',728,211);








INSERT INTO `currencies` (`id`, `company_id`, `currency_name`, `currency_symbol`, `currency_code`, `exchange_rate`, `is_cryptocurrency`, `usd_price`, `created_at`, `updated_at`, `currency_position`, `no_of_decimal`, `thousand_separator`, `decimal_separator`) VALUES 
	(1,1,'Dollars','$','USD',1,'no',NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57','left',2,',','.'),
	(2,1,'Pounds','£','GBP',1,'no',NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57','left',2,',','.'),
	(3,1,'Euros','€','EUR',1,'no',NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57','left',2,',','.'),
	(4,1,'Rupee','₹','INR',1,'no',NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57','left',2,',','.');




INSERT INTO `custom_field_groups` (`id`, `company_id`, `name`, `model`) VALUES 
	(1,1,'Client','App\\Models\\ClientDetails'),
	(2,1,'Employee','App\\Models\\EmployeeDetails'),
	(3,1,'Project','App\\Models\\Project'),
	(4,1,'Invoice','App\\Models\\Invoice'),
	(5,1,'Estimate','App\\Models\\Estimate'),
	(6,1,'Task','App\\Models\\Task'),
	(7,1,'Expense','App\\Models\\Expense'),
	(8,1,'Lead','App\\Models\\Lead'),
	(9,1,'Deal','App\\Models\\Deal'),
	(10,1,'Product','App\\Models\\Product'),
	(11,1,'Ticket','App\\Models\\Ticket'),
	(12,1,'Time Log','App\\Models\\ProjectTimeLog'),
	(13,1,'Contract','App\\Models\\Contract');








INSERT INTO `cyber_securities` (`id`, `max_retries`, `email`, `lockout_time`, `max_lockouts`, `extended_lockout_time`, `reset_retries`, `alert_after_lockouts`, `user_timeout`, `ip_check`, `ip`, `unique_session`, `created_at`, `updated_at`) VALUES 
	(1,3,NULL,2,3,1,24,2,10,0,NULL,0,'2024-02-13 01:13:55','2024-02-13 01:13:55');


INSERT INTO `cyber_security_settings` (`id`, `purchase_code`, `supported_until`, `purchased_on`, `notify_update`, `license_type`, `created_at`, `updated_at`) VALUES 
	(1,NULL,NULL,NULL,1,NULL,'2024-02-13 01:13:55','2024-02-13 01:13:55');


INSERT INTO `dashboard_widgets` (`id`, `company_id`, `widget_name`, `status`, `dashboard_type`, `created_at`, `updated_at`) VALUES 
	(1,1,'total_clients',1,'admin-dashboard',NULL,NULL),
	(2,1,'total_employees',1,'admin-dashboard',NULL,NULL),
	(3,1,'total_projects',1,'admin-dashboard',NULL,NULL),
	(4,1,'total_unpaid_invoices',1,'admin-dashboard',NULL,NULL),
	(5,1,'total_hours_logged',1,'admin-dashboard',NULL,NULL),
	(6,1,'total_pending_tasks',1,'admin-dashboard',NULL,NULL),
	(7,1,'total_today_attendance',1,'admin-dashboard',NULL,NULL),
	(8,1,'total_unresolved_tickets',1,'admin-dashboard',NULL,NULL),
	(9,1,'recent_earnings',1,'admin-dashboard',NULL,NULL),
	(10,1,'settings_leaves',1,'admin-dashboard',NULL,NULL),
	(11,1,'new_tickets',1,'admin-dashboard',NULL,NULL),
	(12,1,'overdue_tasks',1,'admin-dashboard',NULL,NULL),
	(13,1,'pending_follow_up',1,'admin-dashboard',NULL,NULL),
	(14,1,'project_activity_timeline',1,'admin-dashboard',NULL,NULL),
	(15,1,'user_activity_timeline',1,'admin-dashboard',NULL,NULL),
	(16,1,'timelogs',1,'admin-dashboard',NULL,NULL),
	(17,1,'total_clients',1,'admin-client-dashboard',NULL,NULL),
	(18,1,'total_leads',1,'admin-client-dashboard',NULL,NULL),
	(19,1,'total_lead_conversions',1,'admin-client-dashboard',NULL,NULL),
	(20,1,'total_contracts_generated',1,'admin-client-dashboard',NULL,NULL),
	(21,1,'total_contracts_signed',1,'admin-client-dashboard',NULL,NULL),
	(22,1,'client_wise_earnings',1,'admin-client-dashboard',NULL,NULL),
	(23,1,'client_wise_timelogs',1,'admin-client-dashboard',NULL,NULL),
	(24,1,'lead_vs_status',1,'admin-client-dashboard',NULL,NULL),
	(25,1,'lead_vs_source',1,'admin-client-dashboard',NULL,NULL),
	(26,1,'latest_client',1,'admin-client-dashboard',NULL,NULL),
	(27,1,'recent_login_activities',1,'admin-client-dashboard',NULL,NULL),
	(28,1,'total_deals',1,'admin-client-dashboard',NULL,NULL),
	(29,1,'total_paid_invoices',1,'admin-finance-dashboard',NULL,NULL),
	(30,1,'total_expenses',1,'admin-finance-dashboard',NULL,NULL),
	(31,1,'total_earnings',1,'admin-finance-dashboard',NULL,NULL),
	(32,1,'total_pending_amount',1,'admin-finance-dashboard',NULL,NULL),
	(33,1,'invoice_overview',1,'admin-finance-dashboard',NULL,NULL),
	(34,1,'estimate_overview',1,'admin-finance-dashboard',NULL,NULL),
	(35,1,'proposal_overview',1,'admin-finance-dashboard',NULL,NULL),
	(36,1,'earnings_by_client',1,'admin-finance-dashboard',NULL,NULL),
	(37,1,'earnings_by_projects',1,'admin-finance-dashboard',NULL,NULL),
	(38,1,'total_unpaid_invoices',1,'admin-finance-dashboard',NULL,NULL),
	(39,1,'total_leaves_approved',1,'admin-hr-dashboard',NULL,NULL),
	(40,1,'total_new_employee',1,'admin-hr-dashboard',NULL,NULL),
	(41,1,'total_employee_exits',1,'admin-hr-dashboard',NULL,NULL),
	(42,1,'average_attendance',1,'admin-hr-dashboard',NULL,NULL),
	(43,1,'department_wise_employee',1,'admin-hr-dashboard',NULL,NULL),
	(44,1,'designation_wise_employee',1,'admin-hr-dashboard',NULL,NULL),
	(45,1,'gender_wise_employee',1,'admin-hr-dashboard',NULL,NULL),
	(46,1,'role_wise_employee',1,'admin-hr-dashboard',NULL,NULL),
	(47,1,'leaves_taken',1,'admin-hr-dashboard',NULL,NULL),
	(48,1,'late_attendance_mark',1,'admin-hr-dashboard',NULL,NULL),
	(49,1,'headcount',1,'admin-hr-dashboard',NULL,NULL),
	(50,1,'joining_vs_attrition',1,'admin-hr-dashboard',NULL,NULL),
	(51,1,'birthday',1,'admin-hr-dashboard',NULL,NULL),
	(52,1,'total_today_attendance',1,'admin-hr-dashboard',NULL,NULL),
	(53,1,'total_project',1,'admin-project-dashboard',NULL,NULL),
	(54,1,'total_hours_logged',1,'admin-project-dashboard',NULL,NULL),
	(55,1,'total_overdue_project',1,'admin-project-dashboard',NULL,NULL),
	(56,1,'status_wise_project',1,'admin-project-dashboard',NULL,NULL),
	(57,1,'pending_milestone',1,'admin-project-dashboard',NULL,NULL),
	(58,1,'total_tickets',1,'admin-ticket-dashboard',NULL,NULL),
	(59,1,'total_unassigned_ticket',1,'admin-ticket-dashboard',NULL,NULL),
	(60,1,'type_wise_ticket',1,'admin-ticket-dashboard',NULL,NULL),
	(61,1,'status_wise_ticket',1,'admin-ticket-dashboard',NULL,NULL),
	(62,1,'channel_wise_ticket',1,'admin-ticket-dashboard',NULL,NULL),
	(63,1,'new_tickets',1,'admin-ticket-dashboard',NULL,NULL),
	(64,1,'profile',1,'private-dashboard',NULL,NULL),
	(65,1,'shift_schedule',1,'private-dashboard',NULL,NULL),
	(66,1,'birthday',1,'private-dashboard',NULL,NULL),
	(67,1,'notices',1,'private-dashboard',NULL,NULL),
	(68,1,'tasks',1,'private-dashboard',NULL,NULL),
	(69,1,'projects',1,'private-dashboard',NULL,NULL),
	(70,1,'my_task',1,'private-dashboard',NULL,NULL),
	(71,1,'my_calender',1,'private-dashboard',NULL,NULL),
	(72,1,'week_timelog',1,'private-dashboard',NULL,NULL),
	(73,1,'leave',1,'private-dashboard',NULL,NULL),
	(74,1,'lead',1,'private-dashboard',NULL,NULL),
	(75,1,'work_from_home',1,'private-dashboard',NULL,NULL),
	(76,1,'appreciation',1,'private-dashboard',NULL,NULL),
	(77,1,'work_anniversary',1,'private-dashboard',NULL,NULL),
	(78,1,'ticket',1,'private-dashboard',NULL,NULL),
	(79,1,'notice_period_duration',1,'private-dashboard',NULL,NULL),
	(80,1,'probation_date',1,'private-dashboard',NULL,NULL),
	(81,1,'contract_date',1,'private-dashboard',NULL,NULL),
	(82,1,'internship_date',1,'private-dashboard',NULL,NULL);


INSERT INTO `database_backup_cron_settings` (`id`, `status`, `hour_of_day`, `backup_after_days`, `delete_backup_after_days`) VALUES 
	(1,'inactive','00:00:00','0','0');








INSERT INTO `designations` (`id`, `company_id`, `name`, `parent_id`, `added_by`, `last_updated_by`, `created_at`, `updated_at`) VALUES 
	(1,1,'Trainee',NULL,NULL,NULL,NULL,NULL),
	(2,1,'Senior',NULL,NULL,NULL,NULL,NULL),
	(3,1,'Junior',NULL,NULL,NULL,NULL,NULL),
	(4,1,'Team Lead',NULL,NULL,NULL,NULL,NULL),
	(5,1,'Project Manager',NULL,NULL,NULL,NULL,NULL);




INSERT INTO `discussion_categories` (`id`, `company_id`, `order`, `name`, `color`, `created_at`, `updated_at`) VALUES 
	(1,1,1,'General','#3498DB','2024-02-13 01:13:57','2024-02-13 01:13:57');








INSERT INTO `e_invoice_company_settings` (`id`, `company_id`, `electronic_address`, `electronic_address_scheme`, `e_invoice_company_id`, `e_invoice_company_id_scheme`, `created_at`, `updated_at`) VALUES 
	(1,1,NULL,NULL,NULL,NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57');


INSERT INTO `e_invoice_settings` (`id`, `purchase_code`, `supported_until`, `purchased_on`, `license_type`, `notify_update`, `created_at`, `updated_at`) VALUES 
	(1,NULL,NULL,NULL,NULL,1,'2024-02-13 01:13:55','2024-02-13 01:13:55');


INSERT INTO `email_notification_settings` (`id`, `company_id`, `created_at`, `updated_at`, `slug`, `setting_name`, `send_email`, `send_slack`, `send_push`, `send_twilio`) VALUES 
	(1,1,NULL,NULL,'new-expenseadded-by-admin','New Expense/Added by Admin','yes','no','no','no'),
	(2,1,NULL,NULL,'new-expenseadded-by-member','New Expense/Added by Member','yes','no','no','no'),
	(3,1,NULL,NULL,'expense-status-changed','Expense Status Changed','yes','no','no','no'),
	(4,1,NULL,NULL,'new-support-ticket-request','New Support Ticket Request','yes','no','no','no'),
	(5,1,NULL,NULL,'new-leave-application','New Leave Application','yes','no','no','no'),
	(6,1,NULL,NULL,'task-completed','Task Completed','yes','no','no','no'),
	(7,1,NULL,NULL,'invoice-createupdate-notification','Invoice Create/Update Notification','yes','no','no','no'),
	(8,1,NULL,NULL,'discussion-reply','Discussion Reply','yes','no','no','no'),
	(9,1,NULL,NULL,'new-product-purchase-request','New Product Purchase Request','yes','no','no','no'),
	(10,1,NULL,NULL,'lead-notification','Lead notification','yes','no','no','no'),
	(11,1,NULL,NULL,'order-createupdate-notification','Order Create/Update Notification','no','no','no','no'),
	(12,1,NULL,NULL,'user-join-via-invitation','User Join via Invitation','no','no','no','no'),
	(13,1,NULL,NULL,'follow-up-reminder','Follow Up Reminder','no','no','no','no'),
	(14,1,NULL,NULL,'user-registrationadded-by-admin','User Registration/Added by Admin','yes','no','no','no'),
	(15,1,NULL,NULL,'employee-assign-to-project','Employee Assign to Project','yes','no','no','no'),
	(16,1,NULL,NULL,'new-notice-published','New Notice Published','no','no','no','no'),
	(17,1,NULL,NULL,'user-assign-to-task','User Assign to Task','yes','no','no','no'),
	(18,1,NULL,NULL,'birthday-notification','Birthday notification','yes','yes','no','no'),
	(19,1,NULL,NULL,'payment-notification','Payment Notification','yes','no','no','no'),
	(20,1,NULL,NULL,'appreciation-notification','Employee Appreciation','yes','no','no','no'),
	(21,1,NULL,NULL,'holiday-notification','Holiday Notification','no','no','no','no'),
	(22,1,NULL,NULL,'estimate-notification','Estimate Notification','yes','no','no','no'),
	(23,1,NULL,NULL,'event-notification','Event Notification','yes','no','no','no'),
	(24,1,NULL,NULL,'message-notification','Message Notification','yes','no','no','no'),
	(25,1,NULL,NULL,'project-mention-notification','Project Mention Notification','yes','no','no','no'),
	(26,1,NULL,NULL,'task-mention-notification','Task Mention','yes','no','no','no'),
	(27,1,NULL,NULL,'shift-assign-notification','Shift Assign Notification','yes','no','no','no');




INSERT INTO `employee_details` (`id`, `company_id`, `user_id`, `employee_id`, `address`, `hourly_rate`, `slack_username`, `department_id`, `designation_id`, `joining_date`, `last_date`, `added_by`, `last_updated_by`, `attendance_reminder`, `date_of_birth`, `calendar_view`, `about_me`, `reporting_to`, `contract_end_date`, `internship_end_date`, `employment_type`, `marriage_anniversary_date`, `marital_status`, `notice_period_end_date`, `notice_period_start_date`, `probation_end_date`, `created_at`, `updated_at`) VALUES 
	(1,1,1,'EMP-1','4580 Gerry Ranch Suite 282\nHoppetown, MS 68237',73,NULL,5,5,'2023-05-13 01:13:57',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(2,1,2,'EMP-2','8770 Grant Circle Apt. 883\nKatlynberg, GA 28727',44,NULL,2,1,'2023-05-13 01:13:57',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(3,1,14,'EMP-3','447 Strosin Neck\nEttieberg, VA 80244-5487',31,NULL,1,3,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(4,1,15,'EMP-4','82067 Gulgowski Station Apt. 164\nNorth Candace, NC 91829',48,NULL,6,2,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(5,1,16,'EMP-5','9013 Bednar Stravenue Suite 943\nRobertston, VT 93383-5667',81,NULL,1,2,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(6,1,17,'EMP-6','15240 Geraldine Circle Suite 265\nVitaburgh, FL 56377-1914',31,NULL,6,2,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(7,1,18,'EMP-7','8994 Kuphal Haven Suite 450\nLiamfort, LA 16884',92,NULL,1,3,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(8,1,19,'EMP-8','5628 Bogisich Freeway\nLornaville, IL 03903',28,NULL,5,4,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(9,1,20,'EMP-9','584 Hauck Hill Suite 398\nSouth Augustine, FL 60157',73,NULL,2,1,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(10,1,21,'EMP-10','847 Erdman Locks Suite 644\nSouth Marshallburgh, CO 51882',61,NULL,3,4,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(11,1,22,'EMP-11','4460 Schuppe Springs Apt. 110\nLake Randalville, PA 42450',85,NULL,6,3,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(12,1,23,'EMP-12','85845 Abdullah Falls\nNew Alejandrastad, VT 23668',97,NULL,3,2,'2023-05-13 01:13:59',NULL,NULL,NULL,NULL,NULL,'task,events,holiday,tickets,leaves','I am super human',NULL,NULL,NULL,NULL,NULL,'single',NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59');




INSERT INTO `employee_leave_quotas` (`id`, `user_id`, `leave_type_id`, `no_of_leaves`, `created_at`, `updated_at`) VALUES 
	(1,1,1,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(2,1,2,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(3,1,3,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(4,2,1,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(5,2,2,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(6,2,3,5,'2024-02-13 01:13:57','2024-02-13 01:13:57'),
	(7,14,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(8,14,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(9,14,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(10,15,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(11,15,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(12,15,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(13,16,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(14,16,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(15,16,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(16,17,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(17,17,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(18,17,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(19,18,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(20,18,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(21,18,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(22,19,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(23,19,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(24,19,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(25,20,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(26,20,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(27,20,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(28,21,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(29,21,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(30,21,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(31,22,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(32,22,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(33,22,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(34,23,1,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(35,23,2,5,'2024-02-13 01:13:59','2024-02-13 01:13:59'),
	(36,23,3,5,'2024-02-13 01:13:59','2024-02-13 01:13:59');








INSERT INTO `employee_shifts` (`id`, `company_id`, `shift_name`, `shift_short_code`, `color`, `office_start_time`, `office_end_time`, `halfday_mark_time`, `late_mark_duration`, `clockin_in_day`, `office_open_days`, `created_at`, `updated_at`, `early_clock_in`) VALUES 
	(1,1,'Day Off','DO','#E8EEF3','00:00:00','00:00:00',NULL,0,0,'','2024-02-13 01:13:57','2024-02-13 01:13:57',NULL),
	(2,1,'General Shift','GS','#99C7F1','09:00:00','18:00:00',NULL,20,2,'["1","2","3","4","5"]','2024-02-13 01:13:57','2024-02-13 01:13:57',NULL),
	(3,1,'Night Shift','NS','#4d4c4c','22:00:00','06:00:00','01:00:00',15,1,'["1","2","3","4","5"]','2024-02-13 01:14:00','2024-02-13 01:14:00',NULL),
	(4,1,'Day Shift','DS','#ff0000','08:00:00','17:00:00','13:30:00',15,1,'["1","2","3","4","5"]','2024-02-13 01:14:00','2024-02-13 01:14:00',NULL);


INSERT INTO `employee_shift_schedules` (`id`, `user_id`, `date`, `employee_shift_id`, `added_by`, `last_updated_by`, `shift_start_time`, `shift_end_time`, `remarks`, `file`, `created_at`, `updated_at`) VALUES 
	(1,1,'2024-02-01',2,NULL,NULL,'2024-02-01 09:00:00','2024-02-01 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(2,1,'2024-02-02',4,NULL,NULL,'2024-02-02 08:00:00','2024-02-02 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(3,1,'2024-02-03',3,NULL,NULL,'2024-02-03 22:00:00','2024-02-03 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(4,1,'2024-02-04',3,NULL,NULL,'2024-02-04 22:00:00','2024-02-04 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(5,1,'2024-02-05',2,NULL,NULL,'2024-02-05 09:00:00','2024-02-05 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(6,1,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(7,1,'2024-02-07',4,NULL,NULL,'2024-02-07 08:00:00','2024-02-07 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(8,1,'2024-02-08',4,NULL,NULL,'2024-02-08 08:00:00','2024-02-08 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(9,1,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(10,1,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(11,1,'2024-02-11',2,NULL,NULL,'2024-02-11 09:00:00','2024-02-11 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(12,1,'2024-02-12',3,NULL,NULL,'2024-02-12 22:00:00','2024-02-12 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(13,1,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(14,1,'2024-02-14',4,NULL,NULL,'2024-02-14 08:00:00','2024-02-14 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(15,1,'2024-02-15',4,NULL,NULL,'2024-02-15 08:00:00','2024-02-15 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(16,1,'2024-02-16',3,NULL,NULL,'2024-02-16 22:00:00','2024-02-16 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(17,1,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(18,1,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(19,1,'2024-02-19',2,NULL,NULL,'2024-02-19 09:00:00','2024-02-19 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(20,1,'2024-02-20',3,NULL,NULL,'2024-02-20 22:00:00','2024-02-20 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(21,2,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(22,2,'2024-02-02',3,NULL,NULL,'2024-02-02 22:00:00','2024-02-02 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(23,2,'2024-02-03',2,NULL,NULL,'2024-02-03 09:00:00','2024-02-03 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(24,2,'2024-02-04',4,NULL,NULL,'2024-02-04 08:00:00','2024-02-04 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(25,2,'2024-02-05',3,NULL,NULL,'2024-02-05 22:00:00','2024-02-05 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(26,2,'2024-02-06',2,NULL,NULL,'2024-02-06 09:00:00','2024-02-06 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(27,2,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(28,2,'2024-02-08',4,NULL,NULL,'2024-02-08 08:00:00','2024-02-08 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(29,2,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(30,2,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(31,2,'2024-02-11',3,NULL,NULL,'2024-02-11 22:00:00','2024-02-11 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(32,2,'2024-02-12',3,NULL,NULL,'2024-02-12 22:00:00','2024-02-12 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(33,2,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(34,2,'2024-02-14',4,NULL,NULL,'2024-02-14 08:00:00','2024-02-14 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(35,2,'2024-02-15',4,NULL,NULL,'2024-02-15 08:00:00','2024-02-15 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(36,2,'2024-02-16',3,NULL,NULL,'2024-02-16 22:00:00','2024-02-16 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(37,2,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(38,2,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(39,2,'2024-02-19',3,NULL,NULL,'2024-02-19 22:00:00','2024-02-19 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(40,2,'2024-02-20',4,NULL,NULL,'2024-02-20 08:00:00','2024-02-20 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(41,14,'2024-02-01',4,NULL,NULL,'2024-02-01 08:00:00','2024-02-01 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(42,14,'2024-02-02',3,NULL,NULL,'2024-02-02 22:00:00','2024-02-02 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(43,14,'2024-02-03',4,NULL,NULL,'2024-02-03 08:00:00','2024-02-03 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(44,14,'2024-02-04',2,NULL,NULL,'2024-02-04 09:00:00','2024-02-04 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(45,14,'2024-02-05',4,NULL,NULL,'2024-02-05 08:00:00','2024-02-05 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(46,14,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(47,14,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(48,14,'2024-02-08',3,NULL,NULL,'2024-02-08 22:00:00','2024-02-08 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(49,14,'2024-02-09',2,NULL,NULL,'2024-02-09 09:00:00','2024-02-09 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(50,14,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(51,14,'2024-02-11',3,NULL,NULL,'2024-02-11 22:00:00','2024-02-11 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(52,14,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(53,14,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(54,14,'2024-02-14',4,NULL,NULL,'2024-02-14 08:00:00','2024-02-14 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(55,14,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(56,14,'2024-02-16',2,NULL,NULL,'2024-02-16 09:00:00','2024-02-16 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(57,14,'2024-02-17',4,NULL,NULL,'2024-02-17 08:00:00','2024-02-17 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(58,14,'2024-02-18',3,NULL,NULL,'2024-02-18 22:00:00','2024-02-18 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(59,14,'2024-02-19',2,NULL,NULL,'2024-02-19 09:00:00','2024-02-19 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(60,14,'2024-02-20',2,NULL,NULL,'2024-02-20 09:00:00','2024-02-20 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(61,15,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(62,15,'2024-02-02',2,NULL,NULL,'2024-02-02 09:00:00','2024-02-02 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(63,15,'2024-02-03',3,NULL,NULL,'2024-02-03 22:00:00','2024-02-03 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(64,15,'2024-02-04',4,NULL,NULL,'2024-02-04 08:00:00','2024-02-04 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(65,15,'2024-02-05',2,NULL,NULL,'2024-02-05 09:00:00','2024-02-05 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(66,15,'2024-02-06',2,NULL,NULL,'2024-02-06 09:00:00','2024-02-06 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(67,15,'2024-02-07',4,NULL,NULL,'2024-02-07 08:00:00','2024-02-07 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(68,15,'2024-02-08',3,NULL,NULL,'2024-02-08 22:00:00','2024-02-08 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(69,15,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(70,15,'2024-02-10',3,NULL,NULL,'2024-02-10 22:00:00','2024-02-10 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(71,15,'2024-02-11',3,NULL,NULL,'2024-02-11 22:00:00','2024-02-11 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(72,15,'2024-02-12',3,NULL,NULL,'2024-02-12 22:00:00','2024-02-12 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(73,15,'2024-02-13',3,NULL,NULL,'2024-02-13 22:00:00','2024-02-13 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(74,15,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(75,15,'2024-02-15',3,NULL,NULL,'2024-02-15 22:00:00','2024-02-15 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(76,15,'2024-02-16',4,NULL,NULL,'2024-02-16 08:00:00','2024-02-16 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(77,15,'2024-02-17',2,NULL,NULL,'2024-02-17 09:00:00','2024-02-17 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(78,15,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(79,15,'2024-02-19',3,NULL,NULL,'2024-02-19 22:00:00','2024-02-19 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(80,15,'2024-02-20',3,NULL,NULL,'2024-02-20 22:00:00','2024-02-20 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(81,16,'2024-02-01',2,NULL,NULL,'2024-02-01 09:00:00','2024-02-01 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(82,16,'2024-02-02',2,NULL,NULL,'2024-02-02 09:00:00','2024-02-02 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(83,16,'2024-02-03',2,NULL,NULL,'2024-02-03 09:00:00','2024-02-03 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(84,16,'2024-02-04',3,NULL,NULL,'2024-02-04 22:00:00','2024-02-04 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(85,16,'2024-02-05',4,NULL,NULL,'2024-02-05 08:00:00','2024-02-05 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(86,16,'2024-02-06',4,NULL,NULL,'2024-02-06 08:00:00','2024-02-06 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(87,16,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(88,16,'2024-02-08',4,NULL,NULL,'2024-02-08 08:00:00','2024-02-08 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(89,16,'2024-02-09',3,NULL,NULL,'2024-02-09 22:00:00','2024-02-09 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(90,16,'2024-02-10',4,NULL,NULL,'2024-02-10 08:00:00','2024-02-10 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(91,16,'2024-02-11',2,NULL,NULL,'2024-02-11 09:00:00','2024-02-11 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(92,16,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(93,16,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(94,16,'2024-02-14',2,NULL,NULL,'2024-02-14 09:00:00','2024-02-14 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(95,16,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(96,16,'2024-02-16',4,NULL,NULL,'2024-02-16 08:00:00','2024-02-16 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(97,16,'2024-02-17',4,NULL,NULL,'2024-02-17 08:00:00','2024-02-17 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(98,16,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(99,16,'2024-02-19',4,NULL,NULL,'2024-02-19 08:00:00','2024-02-19 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(100,16,'2024-02-20',2,NULL,NULL,'2024-02-20 09:00:00','2024-02-20 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(101,17,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(102,17,'2024-02-02',3,NULL,NULL,'2024-02-02 22:00:00','2024-02-02 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(103,17,'2024-02-03',4,NULL,NULL,'2024-02-03 08:00:00','2024-02-03 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(104,17,'2024-02-04',4,NULL,NULL,'2024-02-04 08:00:00','2024-02-04 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(105,17,'2024-02-05',2,NULL,NULL,'2024-02-05 09:00:00','2024-02-05 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(106,17,'2024-02-06',2,NULL,NULL,'2024-02-06 09:00:00','2024-02-06 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(107,17,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(108,17,'2024-02-08',2,NULL,NULL,'2024-02-08 09:00:00','2024-02-08 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(109,17,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(110,17,'2024-02-10',4,NULL,NULL,'2024-02-10 08:00:00','2024-02-10 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(111,17,'2024-02-11',3,NULL,NULL,'2024-02-11 22:00:00','2024-02-11 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(112,17,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(113,17,'2024-02-13',3,NULL,NULL,'2024-02-13 22:00:00','2024-02-13 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(114,17,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(115,17,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(116,17,'2024-02-16',3,NULL,NULL,'2024-02-16 22:00:00','2024-02-16 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(117,17,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(118,17,'2024-02-18',3,NULL,NULL,'2024-02-18 22:00:00','2024-02-18 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(119,17,'2024-02-19',2,NULL,NULL,'2024-02-19 09:00:00','2024-02-19 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(120,17,'2024-02-20',4,NULL,NULL,'2024-02-20 08:00:00','2024-02-20 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(121,18,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(122,18,'2024-02-02',2,NULL,NULL,'2024-02-02 09:00:00','2024-02-02 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(123,18,'2024-02-03',3,NULL,NULL,'2024-02-03 22:00:00','2024-02-03 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(124,18,'2024-02-04',2,NULL,NULL,'2024-02-04 09:00:00','2024-02-04 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(125,18,'2024-02-05',4,NULL,NULL,'2024-02-05 08:00:00','2024-02-05 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(126,18,'2024-02-06',4,NULL,NULL,'2024-02-06 08:00:00','2024-02-06 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(127,18,'2024-02-07',4,NULL,NULL,'2024-02-07 08:00:00','2024-02-07 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(128,18,'2024-02-08',2,NULL,NULL,'2024-02-08 09:00:00','2024-02-08 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(129,18,'2024-02-09',2,NULL,NULL,'2024-02-09 09:00:00','2024-02-09 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(130,18,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(131,18,'2024-02-11',2,NULL,NULL,'2024-02-11 09:00:00','2024-02-11 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(132,18,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(133,18,'2024-02-13',3,NULL,NULL,'2024-02-13 22:00:00','2024-02-13 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(134,18,'2024-02-14',2,NULL,NULL,'2024-02-14 09:00:00','2024-02-14 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(135,18,'2024-02-15',3,NULL,NULL,'2024-02-15 22:00:00','2024-02-15 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(136,18,'2024-02-16',2,NULL,NULL,'2024-02-16 09:00:00','2024-02-16 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(137,18,'2024-02-17',2,NULL,NULL,'2024-02-17 09:00:00','2024-02-17 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(138,18,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(139,18,'2024-02-19',3,NULL,NULL,'2024-02-19 22:00:00','2024-02-19 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(140,18,'2024-02-20',2,NULL,NULL,'2024-02-20 09:00:00','2024-02-20 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(141,19,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(142,19,'2024-02-02',4,NULL,NULL,'2024-02-02 08:00:00','2024-02-02 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(143,19,'2024-02-03',3,NULL,NULL,'2024-02-03 22:00:00','2024-02-03 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(144,19,'2024-02-04',4,NULL,NULL,'2024-02-04 08:00:00','2024-02-04 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(145,19,'2024-02-05',4,NULL,NULL,'2024-02-05 08:00:00','2024-02-05 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(146,19,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(147,19,'2024-02-07',4,NULL,NULL,'2024-02-07 08:00:00','2024-02-07 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(148,19,'2024-02-08',2,NULL,NULL,'2024-02-08 09:00:00','2024-02-08 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(149,19,'2024-02-09',3,NULL,NULL,'2024-02-09 22:00:00','2024-02-09 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(150,19,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(151,19,'2024-02-11',4,NULL,NULL,'2024-02-11 08:00:00','2024-02-11 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(152,19,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(153,19,'2024-02-13',3,NULL,NULL,'2024-02-13 22:00:00','2024-02-13 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(154,19,'2024-02-14',2,NULL,NULL,'2024-02-14 09:00:00','2024-02-14 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(155,19,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(156,19,'2024-02-16',4,NULL,NULL,'2024-02-16 08:00:00','2024-02-16 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(157,19,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(158,19,'2024-02-18',2,NULL,NULL,'2024-02-18 09:00:00','2024-02-18 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(159,19,'2024-02-19',2,NULL,NULL,'2024-02-19 09:00:00','2024-02-19 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(160,19,'2024-02-20',2,NULL,NULL,'2024-02-20 09:00:00','2024-02-20 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(161,20,'2024-02-01',2,NULL,NULL,'2024-02-01 09:00:00','2024-02-01 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(162,20,'2024-02-02',4,NULL,NULL,'2024-02-02 08:00:00','2024-02-02 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(163,20,'2024-02-03',4,NULL,NULL,'2024-02-03 08:00:00','2024-02-03 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(164,20,'2024-02-04',3,NULL,NULL,'2024-02-04 22:00:00','2024-02-04 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(165,20,'2024-02-05',3,NULL,NULL,'2024-02-05 22:00:00','2024-02-05 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(166,20,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(167,20,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(168,20,'2024-02-08',4,NULL,NULL,'2024-02-08 08:00:00','2024-02-08 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(169,20,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(170,20,'2024-02-10',2,NULL,NULL,'2024-02-10 09:00:00','2024-02-10 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(171,20,'2024-02-11',3,NULL,NULL,'2024-02-11 22:00:00','2024-02-11 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(172,20,'2024-02-12',2,NULL,NULL,'2024-02-12 09:00:00','2024-02-12 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(173,20,'2024-02-13',4,NULL,NULL,'2024-02-13 08:00:00','2024-02-13 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(174,20,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(175,20,'2024-02-15',4,NULL,NULL,'2024-02-15 08:00:00','2024-02-15 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(176,20,'2024-02-16',2,NULL,NULL,'2024-02-16 09:00:00','2024-02-16 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(177,20,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(178,20,'2024-02-18',4,NULL,NULL,'2024-02-18 08:00:00','2024-02-18 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(179,20,'2024-02-19',4,NULL,NULL,'2024-02-19 08:00:00','2024-02-19 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(180,20,'2024-02-20',4,NULL,NULL,'2024-02-20 08:00:00','2024-02-20 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(181,21,'2024-02-01',3,NULL,NULL,'2024-02-01 22:00:00','2024-02-01 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(182,21,'2024-02-02',3,NULL,NULL,'2024-02-02 22:00:00','2024-02-02 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(183,21,'2024-02-03',2,NULL,NULL,'2024-02-03 09:00:00','2024-02-03 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(184,21,'2024-02-04',2,NULL,NULL,'2024-02-04 09:00:00','2024-02-04 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(185,21,'2024-02-05',2,NULL,NULL,'2024-02-05 09:00:00','2024-02-05 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(186,21,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(187,21,'2024-02-07',4,NULL,NULL,'2024-02-07 08:00:00','2024-02-07 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(188,21,'2024-02-08',3,NULL,NULL,'2024-02-08 22:00:00','2024-02-08 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(189,21,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(190,21,'2024-02-10',4,NULL,NULL,'2024-02-10 08:00:00','2024-02-10 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(191,21,'2024-02-11',2,NULL,NULL,'2024-02-11 09:00:00','2024-02-11 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(192,21,'2024-02-12',2,NULL,NULL,'2024-02-12 09:00:00','2024-02-12 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(193,21,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(194,21,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(195,21,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(196,21,'2024-02-16',3,NULL,NULL,'2024-02-16 22:00:00','2024-02-16 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(197,21,'2024-02-17',4,NULL,NULL,'2024-02-17 08:00:00','2024-02-17 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(198,21,'2024-02-18',3,NULL,NULL,'2024-02-18 22:00:00','2024-02-18 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(199,21,'2024-02-19',2,NULL,NULL,'2024-02-19 09:00:00','2024-02-19 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(200,21,'2024-02-20',2,NULL,NULL,'2024-02-20 09:00:00','2024-02-20 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(201,22,'2024-02-01',4,NULL,NULL,'2024-02-01 08:00:00','2024-02-01 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(202,22,'2024-02-02',4,NULL,NULL,'2024-02-02 08:00:00','2024-02-02 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(203,22,'2024-02-03',4,NULL,NULL,'2024-02-03 08:00:00','2024-02-03 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(204,22,'2024-02-04',2,NULL,NULL,'2024-02-04 09:00:00','2024-02-04 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(205,22,'2024-02-05',3,NULL,NULL,'2024-02-05 22:00:00','2024-02-05 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(206,22,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(207,22,'2024-02-07',3,NULL,NULL,'2024-02-07 22:00:00','2024-02-07 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(208,22,'2024-02-08',2,NULL,NULL,'2024-02-08 09:00:00','2024-02-08 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(209,22,'2024-02-09',3,NULL,NULL,'2024-02-09 22:00:00','2024-02-09 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(210,22,'2024-02-10',4,NULL,NULL,'2024-02-10 08:00:00','2024-02-10 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(211,22,'2024-02-11',4,NULL,NULL,'2024-02-11 08:00:00','2024-02-11 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(212,22,'2024-02-12',4,NULL,NULL,'2024-02-12 08:00:00','2024-02-12 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(213,22,'2024-02-13',3,NULL,NULL,'2024-02-13 22:00:00','2024-02-13 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(214,22,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(215,22,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(216,22,'2024-02-16',3,NULL,NULL,'2024-02-16 22:00:00','2024-02-16 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(217,22,'2024-02-17',2,NULL,NULL,'2024-02-17 09:00:00','2024-02-17 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(218,22,'2024-02-18',3,NULL,NULL,'2024-02-18 22:00:00','2024-02-18 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(219,22,'2024-02-19',4,NULL,NULL,'2024-02-19 08:00:00','2024-02-19 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(220,22,'2024-02-20',3,NULL,NULL,'2024-02-20 22:00:00','2024-02-20 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(221,23,'2024-02-01',4,NULL,NULL,'2024-02-01 08:00:00','2024-02-01 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(222,23,'2024-02-02',3,NULL,NULL,'2024-02-02 22:00:00','2024-02-02 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(223,23,'2024-02-03',4,NULL,NULL,'2024-02-03 08:00:00','2024-02-03 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(224,23,'2024-02-04',2,NULL,NULL,'2024-02-04 09:00:00','2024-02-04 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(225,23,'2024-02-05',4,NULL,NULL,'2024-02-05 08:00:00','2024-02-05 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(226,23,'2024-02-06',3,NULL,NULL,'2024-02-06 22:00:00','2024-02-06 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(227,23,'2024-02-07',2,NULL,NULL,'2024-02-07 09:00:00','2024-02-07 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(228,23,'2024-02-08',4,NULL,NULL,'2024-02-08 08:00:00','2024-02-08 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(229,23,'2024-02-09',4,NULL,NULL,'2024-02-09 08:00:00','2024-02-09 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(230,23,'2024-02-10',3,NULL,NULL,'2024-02-10 22:00:00','2024-02-10 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(231,23,'2024-02-11',4,NULL,NULL,'2024-02-11 08:00:00','2024-02-11 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(232,23,'2024-02-12',2,NULL,NULL,'2024-02-12 09:00:00','2024-02-12 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(233,23,'2024-02-13',2,NULL,NULL,'2024-02-13 09:00:00','2024-02-13 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(234,23,'2024-02-14',3,NULL,NULL,'2024-02-14 22:00:00','2024-02-14 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(235,23,'2024-02-15',2,NULL,NULL,'2024-02-15 09:00:00','2024-02-15 18:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(236,23,'2024-02-16',4,NULL,NULL,'2024-02-16 08:00:00','2024-02-16 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(237,23,'2024-02-17',3,NULL,NULL,'2024-02-17 22:00:00','2024-02-17 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(238,23,'2024-02-18',3,NULL,NULL,'2024-02-18 22:00:00','2024-02-18 06:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(239,23,'2024-02-19',4,NULL,NULL,'2024-02-19 08:00:00','2024-02-19 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(240,23,'2024-02-20',4,NULL,NULL,'2024-02-20 08:00:00','2024-02-20 17:00:00',NULL,'','2024-02-13 01:14:00','2024-02-13 01:14:00');










INSERT INTO `estimate_items` (`id`, `estimate_id`, `item_name`, `item_summary`, `type`, `quantity`, `unit_price`, `amount`, `taxes`, `hsn_sac_code`, `created_at`, `updated_at`, `unit_id`, `product_id`) VALUES 
	(1,1,'item 1',NULL,'item',1.00,500.00,500.00,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',1,NULL),
	(2,1,'item 2',NULL,'item',1.00,700.00,700.00,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',1,NULL),
	(3,2,'item 3',NULL,'item',2.00,1200.00,2400.00,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',1,NULL),
	(4,2,'item 4',NULL,'item',1.00,1700.00,1700.00,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',1,NULL);










INSERT INTO `events` (`id`, `parent_id`, `company_id`, `event_name`, `label_color`, `where`, `description`, `start_date_time`, `end_date_time`, `repeat`, `repeat_every`, `repeat_cycles`, `repeat_type`, `send_reminder`, `remind_time`, `remind_type`, `event_link`, `added_by`, `last_updated_by`, `event_id`, `created_at`, `updated_at`) VALUES 
	(1,NULL,1,'Soluta itaque vitae.','#800080','9281 Arnoldo Stravenue Suite 035\nKubmouth, IL 28517-3377','Ad numquam ipsum culpa a omnis voluptas. Nemo eligendi cumque aperiam voluptates sed. Suscipit animi dolorum accusantium nisi deleniti. Et suscipit velit possimus sint dolores iure veniam.','2024-01-14 03:49:09','2024-01-14 03:49:09','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(2,NULL,1,'Dicta ratione.','#800080','72090 Lockman Parkway Suite 067\nWest Braden, WI 68053-4085','Magni fuga minus eligendi repudiandae non atque perspiciatis laborum. Qui quis autem nostrum est aperiam eius. Ut mollitia ex et harum sapiente minus dolores. Consequatur enim veniam dignissimos sapiente saepe consectetur.','2024-02-11 22:13:05','2024-02-11 22:13:05','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(3,NULL,1,'Quis nemo rem aut.','#000000','865 Marley Glen Suite 597\nBatzburgh, RI 43248','Nihil tenetur beatae numquam dolorem nostrum velit et. Nam rerum aut debitis odio minima molestiae corrupti. Nihil laborum tenetur consequuntur libero. Consectetur sed impedit eaque adipisci.','2024-02-07 07:15:14','2024-02-07 07:15:14','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(4,NULL,1,'Consequuntur labore.','#000000','1368 Jones Forge\nGeraldineland, GA 59290-3171','Cupiditate sint officia voluptatem dolorem perferendis velit id. Quia fugit rerum distinctio ipsam aperiam voluptas at. Corporis alias qui aliquam aut. Voluptas optio molestiae saepe occaecati error at. Expedita pariatur itaque quaerat enim vitae.','2024-01-15 23:05:11','2024-01-15 23:05:11','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(5,NULL,1,'Qui repudiandae nam.','#800080','91014 Waters Ports\nLake Jonathonborough, ID 09684','Aliquam harum voluptatem in perferendis possimus. Molestiae eos cumque rem vitae culpa dolor exercitationem consequuntur. Accusantium id id natus totam. Officiis deleniti consequatur at eos hic rerum provident.','2024-01-27 06:51:45','2024-01-27 06:51:45','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(6,NULL,1,'Pariatur molestiae.','#1d82f5','29069 Hagenes Road Apt. 645\nSouth Jacquesland, MD 95204','Qui id totam ut similique animi excepturi iste. Cumque voluptate at sunt. Placeat laborum voluptas voluptas odio dignissimos soluta esse.','2024-01-13 12:06:21','2024-01-13 12:06:21','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(7,NULL,1,'Voluptas maiores.','#0000A0','1077 Doyle Pine Apt. 922\nEast Samaraton, TN 81244-7966','Doloremque iste cum magni corporis qui. Provident rem odit quo velit quod occaecati iure.','2024-02-11 04:16:52','2024-02-11 04:16:52','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(8,NULL,1,'Odio voluptate est.','#800080','4087 Abbigail Plains\nNew Zetta, HI 18402','Debitis sint velit sapiente aut qui. Sunt eveniet animi placeat sit laudantium est necessitatibus. Molestias id placeat eligendi ipsa. Aspernatur ducimus laborum error aut dolorem ducimus.','2024-01-28 19:26:55','2024-01-28 19:26:55','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(9,NULL,1,'Ullam molestiae et.','#0000A0','45007 Broderick Port\nMabellehaven, GA 86082-4940','Cum doloribus omnis at cum necessitatibus. Nihil labore voluptatum velit sequi quo ut. Accusamus cumque magni nam laborum saepe. Qui et similique necessitatibus.','2024-02-07 10:13:17','2024-02-07 10:13:17','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(10,NULL,1,'Sit rerum.','#008000','8001 Prohaska Bypass Suite 765\nLewisview, IN 53792-6582','Inventore aspernatur suscipit porro excepturi nihil beatae fugiat. Autem aut eius nobis doloremque eum libero sit ut. Culpa quidem eligendi vero sunt dignissimos odit ut. Nobis nihil nihil enim architecto sunt eligendi hic.','2024-01-14 12:43:00','2024-01-14 12:43:00','no',NULL,NULL,'day','no',NULL,'day',NULL,NULL,NULL,NULL,'2024-02-13 01:14:00','2024-02-13 01:14:00');


INSERT INTO `event_attendees` (`id`, `company_id`, `user_id`, `event_id`, `created_at`, `updated_at`) VALUES 
	(1,1,16,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(2,1,2,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(3,1,20,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(4,1,1,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(5,1,21,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(6,1,15,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(7,1,14,1,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(8,1,23,2,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(9,1,2,2,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(10,1,20,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(11,1,14,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(12,1,18,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(13,1,21,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(14,1,1,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(15,1,19,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(16,1,22,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(17,1,16,3,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(18,1,16,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(19,1,23,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(20,1,1,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(21,1,18,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(22,1,17,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(23,1,15,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(24,1,2,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(25,1,21,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(26,1,22,4,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(27,1,17,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(28,1,15,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(29,1,21,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(30,1,18,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(31,1,19,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(32,1,16,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(33,1,14,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(34,1,23,5,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(35,1,22,6,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(36,1,17,6,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(37,1,21,7,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(38,1,15,7,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(39,1,14,7,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(40,1,22,7,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(41,1,15,8,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(42,1,22,8,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(43,1,20,9,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(44,1,15,9,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(45,1,15,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(46,1,19,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(47,1,21,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(48,1,1,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(49,1,2,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(50,1,20,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(51,1,18,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(52,1,22,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(53,1,23,10,'2024-02-13 01:14:00','2024-02-13 01:14:00'),
	(54,1,17,10,'2024-02-13 01:14:00','2024-02-13 01:14:00');






INSERT INTO `expenses` (`id`, `company_id`, `item_name`, `purchase_date`, `purchase_from`, `price`, `currency_id`, `default_currency_id`, `exchange_rate`, `project_id`, `bill`, `user_id`, `status`, `can_claim`, `category_id`, `expenses_recurring_id`, `created_by`, `description`, `added_by`, `last_updated_by`, `approver_id`, `created_at`, `updated_at`, `bank_account_id`) VALUES 
	(1,1,'Quasi rerum aut.','2024-01-16','Indiana',651.00,2,NULL,1,NULL,NULL,22,'pending',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(2,1,'Nisi molestias sed.','2024-01-30','Texas',395.00,2,NULL,1,NULL,NULL,22,'pending',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(3,1,'Voluptate eum.','2024-01-17','New Mexico',405.00,2,NULL,1,NULL,NULL,22,'pending',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(4,1,'Est eum ratione.','2024-02-09','New Hampshire',309.00,2,NULL,1,NULL,NULL,22,'rejected',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(5,1,'Neque fuga sit.','2024-01-20','Massachusetts',920.00,2,NULL,1,NULL,NULL,22,'rejected',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(6,1,'Eius ab nisi.','2024-01-24','New Hampshire',428.00,2,NULL,1,NULL,NULL,22,'pending',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(7,1,'Expedita fugit.','2024-01-14','Idaho',298.00,2,NULL,1,NULL,NULL,22,'approved',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(8,1,'Reiciendis vel.','2024-02-08','North Carolina',193.00,2,NULL,1,NULL,NULL,22,'approved',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(9,1,'Et voluptas natus.','2024-01-24','Hawaii',563.00,2,NULL,1,NULL,NULL,22,'pending',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL),
	(10,1,'Commodi et.','2024-01-24','Rhode Island',983.00,2,NULL,1,NULL,NULL,22,'approved',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-02-13 01:13:59','2024-02-13 01:13:59',NULL);


