/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `activity_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `activity_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `user_device_id` bigint unsigned DEFAULT NULL,
  `activity_loggable_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activity_loggable_id` bigint unsigned DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `route` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activity_logs_activity_loggable_type_activity_loggable_id_index` (`activity_loggable_type`,`activity_loggable_id`),
  KEY `activity_logs_user_device_id_foreign` (`user_device_id`),
  KEY `activity_logs_user_id_created_at_index` (`user_id`,`created_at`),
  CONSTRAINT `activity_logs_user_device_id_foreign` FOREIGN KEY (`user_device_id`) REFERENCES `user_devices` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `activity_logs_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `approval_steps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `approval_steps` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `request_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_id` bigint unsigned NOT NULL,
  `step_order` int NOT NULL DEFAULT '0',
  `approver_id` bigint unsigned DEFAULT NULL,
  `approver_role` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `acted_at` datetime DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `approval_steps_approver_id_foreign` (`approver_id`),
  KEY `approval_steps_request_type_request_id_index` (`request_type`,`request_id`),
  CONSTRAINT `approval_steps_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attachments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `attachmentable_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachmentable_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attachments_attachmentable_type_attachmentable_id_index` (`attachmentable_type`,`attachmentable_id`),
  KEY `attachments_user_id_foreign` (`user_id`),
  CONSTRAINT `attachments_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attendance_corrections`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_corrections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `attendance_id` bigint unsigned DEFAULT NULL,
  `requested_date` date NOT NULL,
  `requested_check_in` datetime DEFAULT NULL,
  `requested_check_out` datetime DEFAULT NULL,
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_corrections_employee_id_foreign` (`employee_id`),
  KEY `attendance_corrections_attendance_id_foreign` (`attendance_id`),
  KEY `attendance_corrections_reason_id_foreign` (`reason_id`),
  KEY `attendance_corrections_approved_by_foreign` (`reviewed_by`),
  KEY `attendance_corrections_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `attendance_corrections_approved_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_corrections_attendance_id_foreign` FOREIGN KEY (`attendance_id`) REFERENCES `daily_attendances` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_corrections_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_corrections_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_corrections_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attendance_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `recorded_at` datetime NOT NULL,
  `qr_token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `latitude` decimal(10,7) NOT NULL DEFAULT '0.0000000',
  `longitude` decimal(10,7) NOT NULL DEFAULT '0.0000000',
  `distance_from_company` decimal(10,2) NOT NULL DEFAULT '0.00',
  `device_identifier` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `daily_attendance_id` int NOT NULL DEFAULT '0',
  `ip_address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_logs_employee_id_foreign` (`employee_id`),
  CONSTRAINT `attendance_logs_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attendance_qr_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_qr_challenges` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `token_hash` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `challenge_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expires_at` timestamp NOT NULL,
  `used_at` timestamp NULL DEFAULT NULL,
  `revoked_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attendance_qr_challenges_token_hash_unique` (`token_hash`),
  UNIQUE KEY `attendance_qr_challenges_challenge_id_unique` (`challenge_id`),
  KEY `attendance_qr_challenges_user_id_foreign` (`user_id`),
  KEY `attendance_qr_challenges_employee_id_expires_at_index` (`employee_id`,`expires_at`),
  CONSTRAINT `attendance_qr_challenges_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_qr_challenges_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attendance_signing_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_signing_challenges` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `challenge_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `device_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `challenge` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expires_at` timestamp NOT NULL,
  `used_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attendance_signing_challenges_challenge_id_unique` (`challenge_id`),
  KEY `attendance_signing_challenges_user_id_foreign` (`user_id`),
  KEY `attendance_signing_challenges_device_id_foreign` (`device_id`),
  KEY `attendance_signing_challenges_employee_id_foreign` (`employee_id`),
  KEY `attendance_signing_challenges_expires_at_index` (`expires_at`),
  CONSTRAINT `attendance_signing_challenges_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_signing_challenges_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_signing_challenges_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `branch_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `branch_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branch_settings_branch_id_key_unique` (`branch_id`,`key`),
  CONSTRAINT `branch_settings_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `branches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `branches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `radius` int unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` int 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` bigint NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache_locks` (
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` bigint NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_locks_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cities` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `country_id` bigint unsigned NOT NULL,
  `latitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_id` tinyint NOT NULL DEFAULT '1',
  `active` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cities_country_id_foreign` (`country_id`),
  CONSTRAINT `cities_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `compensatory_day_swap_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `compensatory_day_swap_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned NOT NULL,
  `original_date` date NOT NULL,
  `replacement_date` date NOT NULL,
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `compensatory_day_swap_requests_reason_id_foreign` (`reason_id`),
  KEY `compensatory_day_swap_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `compensatory_day_swap_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  KEY `day_swap_requests_employee_status_original_index` (`employee_id`,`status`,`original_date`),
  KEY `day_swap_requests_employee_status_replacement_index` (`employee_id`,`status`,`replacement_date`),
  CONSTRAINT `compensatory_day_swap_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `compensatory_day_swap_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `compensatory_day_swap_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `compensatory_day_swap_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `countries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `countries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` mediumtext COLLATE utf8mb4_unicode_ci,
  `order_id` tinyint NOT NULL DEFAULT '1',
  `active` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `credentials`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `credentials` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `device_id` bigint unsigned DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `credential_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `public_key` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `sign_counter` int unsigned NOT NULL DEFAULT '0',
  `metadata` json DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `credentials_credential_id_unique` (`credential_id`),
  KEY `credentials_user_id_index` (`user_id`),
  KEY `credentials_device_id_index` (`device_id`),
  KEY `credentials_user_id_state_index` (`user_id`,`state`),
  KEY `credentials_device_id_state_index` (`device_id`,`state`),
  KEY `credentials_type_index` (`type`),
  KEY `credentials_state_index` (`state`),
  CONSTRAINT `credentials_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE SET NULL,
  CONSTRAINT `credentials_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `daily_attendance_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `daily_attendance_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `daily_attendance_id` bigint unsigned NOT NULL,
  `requestable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requestable_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `daily_attendance_requests_unique` (`daily_attendance_id`,`requestable_type`,`requestable_id`),
  KEY `daily_attendance_requests_requestable_type_requestable_id_index` (`requestable_type`,`requestable_id`),
  CONSTRAINT `daily_attendance_requests_daily_attendance_id_foreign` FOREIGN KEY (`daily_attendance_id`) REFERENCES `daily_attendances` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `daily_attendances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `daily_attendances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `attendance_date` date NOT NULL,
  `check_in` datetime DEFAULT NULL,
  `check_out` datetime DEFAULT NULL,
  `scheduled_work_minutes` int NOT NULL DEFAULT '0',
  `scheduled_break_minutes` int NOT NULL DEFAULT '0',
  `latest_check_in` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expected_check_out` datetime DEFAULT NULL,
  `break_minutes` int NOT NULL DEFAULT '0',
  `worked_minutes` int NOT NULL DEFAULT '0',
  `late_minutes` int NOT NULL DEFAULT '0',
  `early_leave_minutes` int NOT NULL DEFAULT '0',
  `overtime_minutes` int NOT NULL DEFAULT '0',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `work_location` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_overwrited` tinyint(1) NOT NULL DEFAULT '0',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_employee_daily_attendance` (`employee_id`,`attendance_date`),
  KEY `daily_attendances_branch_id_foreign` (`branch_id`),
  CONSTRAINT `daily_attendances_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `daily_attendances_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `departments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `manager_id` bigint unsigned DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `departments_manager_id_foreign` (`manager_id`),
  CONSTRAINT `departments_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `devices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `imei` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `installation_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credential_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credential_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `device_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `expires_at` timestamp NULL DEFAULT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `token` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_seen_at` timestamp NULL DEFAULT NULL,
  `public_key` text COLLATE utf8mb4_unicode_ci COMMENT 'ECDSA P-256 public key in PEM format for device-bound authentication',
  `attestation_metadata` json DEFAULT NULL,
  `device_metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `devices_imei_unique` (`imei`),
  KEY `devices_reviewed_by_foreign` (`reviewed_by`),
  KEY `devices_state_index` (`state`),
  KEY `devices_installation_id_index` (`installation_id`),
  KEY `devices_credential_id_index` (`credential_id`),
  KEY `devices_platform_index` (`platform`),
  KEY `devices_expires_at_index` (`expires_at`),
  KEY `devices_rejection_reason_id_foreign` (`rejection_reason_id`),
  KEY `devices_user_id_state_index` (`user_id`,`state`),
  KEY `devices_credential_type_index` (`credential_type`),
  CONSTRAINT `devices_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `devices_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `devices_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `employee_histories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_histories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `event_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `event_date` date NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_histories_employee_id_foreign` (`employee_id`),
  CONSTRAINT `employee_histories_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `employee_work_schedules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_work_schedules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `schedule_id` bigint unsigned DEFAULT NULL,
  `effective_from` date NOT NULL,
  `effective_to` date DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_work_schedules_employee_id_foreign` (`employee_id`),
  KEY `employee_work_schedules_schedule_id_foreign` (`schedule_id`),
  CONSTRAINT `employee_work_schedules_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employee_work_schedules_schedule_id_foreign` FOREIGN KEY (`schedule_id`) REFERENCES `work_schedules` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `employees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employees` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'full_time',
  `religion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `national_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hire_date` date NOT NULL,
  `termination_date` date DEFAULT NULL,
  `job_title_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `department_id` bigint unsigned DEFAULT NULL,
  `team_id` bigint unsigned DEFAULT NULL,
  `manager_id` bigint unsigned DEFAULT NULL,
  `work_location` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `schedule_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default',
  `has_special_needs` tinyint(1) NOT NULL DEFAULT '0',
  `always_approve_requests` tinyint(1) NOT NULL DEFAULT '0',
  `monthly_required_minutes` int unsigned DEFAULT NULL,
  `basic_salary` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `employees_code_unique` (`code`),
  KEY `employees_job_title_id_foreign` (`job_title_id`),
  KEY `employees_manager_id_foreign` (`manager_id`),
  KEY `employees_user_id_foreign` (`user_id`),
  KEY `employees_type_index` (`type`),
  KEY `employees_department_id_foreign` (`department_id`),
  KEY `employees_team_id_foreign` (`team_id`),
  KEY `employees_branch_id_foreign` (`branch_id`),
  KEY `employees_schedule_type_index` (`schedule_type`),
  CONSTRAINT `employees_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employees_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employees_job_title_id_foreign` FOREIGN KEY (`job_title_id`) REFERENCES `job_titles` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employees_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employees_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employees_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `field_visit_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `field_visit_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned NOT NULL,
  `visit_date` date NOT NULL,
  `location_lat` decimal(10,7) DEFAULT NULL,
  `location_lng` decimal(10,7) DEFAULT NULL,
  `location_radius` int unsigned DEFAULT NULL COMMENT 'metres; null = use company default',
  `expected_minutes` smallint unsigned NOT NULL COMMENT 'expected duration incl. travel time',
  `reason_id` bigint unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `check_in_at` datetime DEFAULT NULL COMMENT 'arrival at the visit site',
  `check_in_company_at` datetime DEFAULT NULL COMMENT 'stamped on company check-in after the visit',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `field_visit_requests_reason_id_foreign` (`reason_id`),
  KEY `field_visit_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `field_visit_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  KEY `field_visit_requests_employee_id_visit_date_index` (`employee_id`,`visit_date`),
  CONSTRAINT `field_visit_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `field_visit_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `field_visit_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `field_visit_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `holiday_request_days`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `holiday_request_days` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `holiday_request_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `is_paid` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `holiday_request_days_holiday_request_id_foreign` (`holiday_request_id`),
  CONSTRAINT `holiday_request_days_holiday_request_id_foreign` FOREIGN KEY (`holiday_request_id`) REFERENCES `holiday_requests` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `holiday_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `holiday_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'regular',
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `holiday_requests_employee_id_foreign` (`employee_id`),
  KEY `holiday_requests_reason_id_foreign` (`reason_id`),
  KEY `holiday_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `holiday_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `holiday_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `holiday_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `holiday_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `holiday_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `holidays`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `holidays` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_start` date NOT NULL,
  `date_end` date DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `holy_days`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `holy_days` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_start` date NOT NULL,
  `date_end` date NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `increase_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `increase_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `current_salary` decimal(10,2) NOT NULL DEFAULT '0.00',
  `requested_salary` decimal(10,2) NOT NULL DEFAULT '0.00',
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime NOT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `increase_requests_employee_id_foreign` (`employee_id`),
  KEY `increase_requests_reason_id_foreign` (`reason_id`),
  KEY `increase_requests_approved_by_foreign` (`reviewed_by`),
  KEY `increase_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `increase_requests_approved_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `increase_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `increase_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `increase_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `job_titles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `job_titles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `login_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `login_challenges` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `device_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `challenge` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Hex-encoded 32-byte cryptographically random challenge',
  `expires_at` timestamp NOT NULL COMMENT 'Short-lived challenge TTL (default 5 minutes)',
  `used_at` timestamp NULL DEFAULT NULL COMMENT 'Marks challenge as consumed after successful verification',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `challenge_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `login_challenges_challenge_unique` (`challenge`),
  UNIQUE KEY `login_challenges_challenge_id_unique` (`challenge_id`),
  KEY `login_challenges_device_user_index` (`device_id`,`user_id`),
  KEY `login_challenges_expires_at_index` (`expires_at`),
  KEY `login_challenges_used_at_index` (`used_at`),
  KEY `login_challenges_user_id_foreign` (`user_id`),
  CONSTRAINT `login_challenges_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `login_challenges_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `user_device_id` bigint unsigned DEFAULT NULL,
  `loggable_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loggable_id` bigint unsigned DEFAULT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_old` mediumtext COLLATE utf8mb4_unicode_ci,
  `value` mediumtext COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `logs_loggable_type_loggable_id_index` (`loggable_type`,`loggable_id`),
  KEY `logs_user_device_id_foreign` (`user_device_id`),
  KEY `logs_user_id_created_at_index` (`user_id`,`created_at`),
  CONSTRAINT `logs_user_device_id_foreign` FOREIGN KEY (`user_device_id`) REFERENCES `user_devices` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `logs_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ltm_translations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ltm_translations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `status` int NOT NULL DEFAULT '0',
  `locale` varchar(191) COLLATE utf8mb4_bin NOT NULL,
  `group` varchar(191) COLLATE utf8mb4_bin NOT NULL,
  `key` text COLLATE utf8mb4_bin NOT NULL,
  `value` text COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `metas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `metas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `metaable_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metaable_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  `group` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `metas_metaable_type_metaable_id_index` (`metaable_type`,`metaable_id`),
  KEY `metas_user_id_foreign` (`user_id`),
  CONSTRAINT `metas_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notifications` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_id` bigint unsigned NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `overtime_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `overtime_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `overtime_date` date NOT NULL,
  `from_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `minutes` int NOT NULL DEFAULT '0',
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime NOT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `overtime_requests_employee_id_foreign` (`employee_id`),
  KEY `overtime_requests_reason_id_foreign` (`reason_id`),
  KEY `overtime_requests_approved_by_foreign` (`reviewed_by`),
  KEY `overtime_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `overtime_requests_approved_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `overtime_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `overtime_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `overtime_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_resets` (
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payroll_adjustments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_adjustments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `days_count` decimal(10,2) NOT NULL DEFAULT '0.00',
  `reason` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `effective_date` date NOT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_adjustments_employee_id_foreign` (`employee_id`),
  KEY `payroll_adjustments_created_by_foreign` (`created_by`),
  KEY `payroll_adjustments_reviewed_by_foreign` (`reviewed_by`),
  KEY `payroll_adjustments_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `payroll_adjustments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `payroll_adjustments_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `payroll_adjustments_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `payroll_adjustments_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payroll_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `payroll_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `quantity` decimal(8,2) DEFAULT NULL,
  `unit` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rate` decimal(8,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_items_payroll_id_foreign` (`payroll_id`),
  CONSTRAINT `payroll_items_payroll_id_foreign` FOREIGN KEY (`payroll_id`) REFERENCES `payrolls` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payrolls`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payrolls` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `month` int NOT NULL DEFAULT '0',
  `year` int NOT NULL DEFAULT '0',
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `basic_salary` decimal(10,2) NOT NULL DEFAULT '0.00',
  `present_days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `absent_days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `holiday_days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `paid_holiday_days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `unpaid_leave_days` decimal(10,2) NOT NULL DEFAULT '0.00',
  `scheduled_minutes` int NOT NULL DEFAULT '0',
  `worked_minutes` int NOT NULL DEFAULT '0',
  `early_leave_minutes` int NOT NULL DEFAULT '0',
  `total_late_minutes` int NOT NULL DEFAULT '0',
  `late_days` int NOT NULL DEFAULT '0',
  `total_overtime_minutes` int NOT NULL DEFAULT '0',
  `permission_minutes` int NOT NULL DEFAULT '0',
  `morning_permission_minutes` int NOT NULL DEFAULT '0',
  `evening_permission_minutes` int NOT NULL DEFAULT '0',
  `hours_per_day` decimal(5,2) NOT NULL DEFAULT '8.00',
  `total_additions` decimal(10,2) NOT NULL DEFAULT '0.00',
  `total_deductions` decimal(10,2) NOT NULL DEFAULT '0.00',
  `net_salary` decimal(10,2) NOT NULL DEFAULT '0.00',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `finalized_at` timestamp NULL DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payrolls_employee_period_unique` (`employee_id`,`year`,`month`),
  CONSTRAINT `payrolls_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permission_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permission_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `permission_date` date NOT NULL,
  `from_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `minutes` int NOT NULL DEFAULT '0',
  `period` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime NOT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `permission_requests_employee_id_foreign` (`employee_id`),
  KEY `permission_requests_reason_id_foreign` (`reason_id`),
  KEY `permission_requests_approved_by_foreign` (`reviewed_by`),
  KEY `permission_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `permission_requests_approved_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `permission_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `permission_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `permission_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permission_role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permission_role` (
  `permission_id` bigint unsigned NOT NULL,
  `role_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `permission_role_role_id_foreign` (`role_id`),
  CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permission_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permission_user` (
  `permission_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `user_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`user_id`,`permission_id`,`user_type`),
  KEY `permission_user_permission_id_foreign` (`permission_id`),
  CONSTRAINT `permission_user_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_unique` (`name`),
  KEY `permissions_description_index` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `personal_access_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `personal_access_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `device_id` bigint unsigned DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`),
  KEY `personal_access_tokens_device_id_index` (`device_id`),
  CONSTRAINT `personal_access_tokens_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `devices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `projects` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deadline` date DEFAULT NULL,
  `progress` tinyint unsigned NOT NULL DEFAULT '0',
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `owner_id` bigint unsigned DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `projects_owner_id_foreign` (`owner_id`),
  KEY `projects_created_by_foreign` (`created_by`),
  CONSTRAINT `projects_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `projects_owner_id_foreign` FOREIGN KEY (`owner_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `pulse_aggregates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pulse_aggregates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bucket` int unsigned NOT NULL,
  `period` mediumint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `key_hash` binary(16) GENERATED ALWAYS AS (unhex(md5(`key`))) VIRTUAL,
  `aggregate` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` decimal(20,2) NOT NULL,
  `count` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pulse_aggregates_bucket_period_type_aggregate_key_hash_unique` (`bucket`,`period`,`type`,`aggregate`,`key_hash`),
  KEY `pulse_aggregates_period_bucket_index` (`period`,`bucket`),
  KEY `pulse_aggregates_type_index` (`type`),
  KEY `pulse_aggregates_period_type_aggregate_bucket_index` (`period`,`type`,`aggregate`,`bucket`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `pulse_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pulse_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `timestamp` int unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `key_hash` binary(16) GENERATED ALWAYS AS (unhex(md5(`key`))) VIRTUAL,
  `value` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pulse_entries_timestamp_index` (`timestamp`),
  KEY `pulse_entries_type_index` (`type`),
  KEY `pulse_entries_key_hash_index` (`key_hash`),
  KEY `pulse_entries_timestamp_type_key_hash_value_index` (`timestamp`,`type`,`key_hash`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `pulse_values`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pulse_values` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `timestamp` int unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `key_hash` binary(16) GENERATED ALWAYS AS (unhex(md5(`key`))) VIRTUAL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pulse_values_type_key_hash_unique` (`type`,`key_hash`),
  KEY `pulse_values_timestamp_index` (`timestamp`),
  KEY `pulse_values_type_index` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `reasons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reasons` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `reject_reasons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reject_reasons` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `reminder_employees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reminder_employees` (
  `reminder_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`reminder_id`,`employee_id`),
  KEY `reminder_employees_employee_id_foreign` (`employee_id`),
  CONSTRAINT `reminder_employees_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `reminder_employees_reminder_id_foreign` FOREIGN KEY (`reminder_id`) REFERENCES `reminders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `reminder_recipients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reminder_recipients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reminder_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `remind_at` datetime NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `dismissed_at` timestamp NULL DEFAULT NULL,
  `notified_at` timestamp NULL DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `reminder_recipients_occurrence_unique` (`reminder_id`,`employee_id`,`remind_at`),
  KEY `reminder_recipients_employee_date_index` (`employee_id`,`remind_at`),
  KEY `reminder_recipients_due_notification_index` (`notified_at`,`remind_at`),
  CONSTRAINT `reminder_recipients_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `reminder_recipients_reminder_id_foreign` FOREIGN KEY (`reminder_id`) REFERENCES `reminders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `reminders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reminders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_by` bigint unsigned DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remind_at` datetime NOT NULL,
  `repeat_rule` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
  `repeat_until` date DEFAULT NULL,
  `audience` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `reminders_created_by_foreign` (`created_by`),
  KEY `reminders_department_id_foreign` (`department_id`),
  KEY `reminders_employee_id_foreign` (`employee_id`),
  KEY `reminders_remind_at_index` (`remind_at`),
  KEY `reminders_category_index` (`category`),
  CONSTRAINT `reminders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `reminders_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `reminders_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `remote_request_assignment_employee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `remote_request_assignment_employee` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `assignment_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `assignment_employee_unique` (`assignment_id`,`employee_id`),
  KEY `remote_request_assignment_employee_employee_id_foreign` (`employee_id`),
  CONSTRAINT `remote_request_assignment_employee_assignment_id_foreign` FOREIGN KEY (`assignment_id`) REFERENCES `remote_request_assignments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `remote_request_assignment_employee_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `remote_request_assignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `remote_request_assignments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `assigned_by` bigint unsigned DEFAULT NULL,
  `everyone` tinyint(1) NOT NULL DEFAULT '0',
  `dates` json NOT NULL,
  `start_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_count` int unsigned NOT NULL DEFAULT '0',
  `skipped` json DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `remote_request_assignments_assigned_by_foreign` (`assigned_by`),
  CONSTRAINT `remote_request_assignments_assigned_by_foreign` FOREIGN KEY (`assigned_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `remote_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `remote_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `assignment_id` bigint unsigned DEFAULT NULL,
  `remote_date` date NOT NULL,
  `count_as_overtime` tinyint(1) NOT NULL DEFAULT '0',
  `start_time` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `end_time` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime NOT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `remote_requests_employee_id_foreign` (`employee_id`),
  KEY `remote_requests_reason_id_foreign` (`reason_id`),
  KEY `remote_requests_approved_by_foreign` (`reviewed_by`),
  KEY `remote_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  KEY `remote_requests_assignment_id_foreign` (`assignment_id`),
  CONSTRAINT `remote_requests_approved_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `remote_requests_assignment_id_foreign` FOREIGN KEY (`assignment_id`) REFERENCES `remote_request_assignments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `remote_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `remote_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `remote_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `role_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `role_user` (
  `role_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `user_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`,`user_type`),
  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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `can_login_web` tinyint(1) NOT NULL DEFAULT '1',
  `can_login_mobile` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `schedule_change_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `schedule_change_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned DEFAULT NULL,
  `schedule_days` json DEFAULT NULL,
  `effective_from` date DEFAULT NULL,
  `reason_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `rejection_reason_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `schedule_change_requests_employee_id_foreign` (`employee_id`),
  KEY `schedule_change_requests_reason_id_foreign` (`reason_id`),
  KEY `schedule_change_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `schedule_change_requests_rejection_reason_id_foreign` (`rejection_reason_id`),
  CONSTRAINT `schedule_change_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `schedule_change_requests_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `schedule_change_requests_rejection_reason_id_foreign` FOREIGN KEY (`rejection_reason_id`) REFERENCES `reject_reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `schedule_change_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `setting_approvable_request_steps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `setting_approvable_request_steps` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `request_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `step_order` smallint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `setting_approvable_request_steps_request_type_role_type_unique` (`request_type`,`role_type`),
  UNIQUE KEY `setting_approvable_request_steps_request_type_step_order_unique` (`request_type`,`step_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `group` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  `locale` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `autoload` tinyint NOT NULL DEFAULT '0',
  `parent_id` int 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `smses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `smses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sender_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_assignees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_assignees` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `task_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_assignees_task_id_foreign` (`task_id`),
  KEY `task_assignees_employee_id_foreign` (`employee_id`),
  CONSTRAINT `task_assignees_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_assignees_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_attachments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `task_id` bigint unsigned DEFAULT NULL,
  `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_size` bigint NOT NULL DEFAULT '0',
  `uploaded_by` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_attachments_task_id_foreign` (`task_id`),
  KEY `task_attachments_uploaded_by_foreign` (`uploaded_by`),
  CONSTRAINT `task_attachments_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_attachments_uploaded_by_foreign` FOREIGN KEY (`uploaded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_comments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `task_id` bigint unsigned DEFAULT NULL,
  `author_id` bigint unsigned DEFAULT NULL,
  `body` text COLLATE utf8mb4_unicode_ci,
  `is_system` tinyint(1) NOT NULL DEFAULT '0',
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_comments_task_id_foreign` (`task_id`),
  KEY `task_comments_author_id_foreign` (`author_id`),
  CONSTRAINT `task_comments_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_comments_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_folder_employee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_folder_employee` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_folder_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `task_folder_employee_task_folder_id_employee_id_unique` (`task_folder_id`,`employee_id`),
  KEY `task_folder_employee_employee_id_foreign` (`employee_id`),
  CONSTRAINT `task_folder_employee_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `task_folder_employee_task_folder_id_foreign` FOREIGN KEY (`task_folder_id`) REFERENCES `task_folders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_folder_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_folder_user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_folder_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `task_folder_user_task_folder_id_user_id_unique` (`task_folder_id`,`user_id`),
  KEY `task_folder_user_user_id_foreign` (`user_id`),
  CONSTRAINT `task_folder_user_task_folder_id_foreign` FOREIGN KEY (`task_folder_id`) REFERENCES `task_folders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `task_folder_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_folders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_folders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` bigint unsigned DEFAULT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_folders_project_id_foreign` (`project_id`),
  KEY `task_folders_parent_id_foreign` (`parent_id`),
  CONSTRAINT `task_folders_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `task_folders` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_folders_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_statuses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_folder_id` bigint unsigned NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#9CA3AF',
  `is_completed` tinyint(1) NOT NULL DEFAULT '0',
  `order_id` tinyint NOT NULL DEFAULT '0',
  `active` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_statuses_task_folder_id_order_id_index` (`task_folder_id`,`order_id`),
  CONSTRAINT `task_statuses_task_folder_id_foreign` FOREIGN KEY (`task_folder_id`) REFERENCES `task_folders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_time_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_time_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `returned_at` datetime DEFAULT NULL,
  `stopped_at` datetime NOT NULL,
  `feedback` text COLLATE utf8mb4_unicode_ci,
  `minutes` int NOT NULL DEFAULT '0',
  `reason_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_time_entries_task_id_foreign` (`task_id`),
  KEY `task_time_entries_employee_id_foreign` (`employee_id`),
  KEY `task_time_entries_reason_id_foreign` (`reason_id`),
  KEY `task_time_entries_user_id_foreign` (`user_id`),
  CONSTRAINT `task_time_entries_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_time_entries_reason_id_foreign` FOREIGN KEY (`reason_id`) REFERENCES `reasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_time_entries_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `task_time_entries_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `task_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `task_user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `task_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `task_user_task_id_user_id_unique` (`task_id`,`user_id`),
  KEY `task_user_user_id_foreign` (`user_id`),
  CONSTRAINT `task_user_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE,
  CONSTRAINT `task_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tasks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` bigint unsigned DEFAULT NULL,
  `folder_id` bigint unsigned DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `priority` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `task_status_id` bigint unsigned DEFAULT NULL,
  `is_completed` tinyint NOT NULL DEFAULT '0',
  `due_date` datetime NOT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `estimated_minutes` int NOT NULL DEFAULT '0',
  `time_tracked_minutes` int NOT NULL DEFAULT '0',
  `assignee_id` bigint unsigned DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tasks_project_id_foreign` (`project_id`),
  KEY `tasks_folder_id_foreign` (`folder_id`),
  KEY `tasks_assignee_id_foreign` (`assignee_id`),
  KEY `tasks_created_by_foreign` (`created_by`),
  KEY `tasks_task_status_id_foreign` (`task_status_id`),
  CONSTRAINT `tasks_assignee_id_foreign` FOREIGN KEY (`assignee_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_folder_id_foreign` FOREIGN KEY (`folder_id`) REFERENCES `task_folders` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_task_status_id_foreign` FOREIGN KEY (`task_status_id`) REFERENCES `task_statuses` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teams` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_id` bigint unsigned NOT NULL,
  `manager_id` bigint unsigned DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `teams_department_id_foreign` (`department_id`),
  KEY `teams_manager_id_foreign` (`manager_id`),
  CONSTRAINT `teams_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `teams_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `user_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_codes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name_first` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name_last` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code_expire` timestamp NULL 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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `user_devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_devices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip_range` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `platform` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `browser` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_desktop` tinyint NOT NULL DEFAULT '1',
  `is_phone` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_devices_lookup_index` (`user_id`,`platform`,`browser`,`ip_range`),
  CONSTRAINT `user_devices_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;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `user_invitations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_invitations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `invited_at` timestamp NULL DEFAULT NULL,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_invitations_user_id_unique` (`user_id`),
  UNIQUE KEY `user_invitations_code_unique` (`code`),
  CONSTRAINT `user_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `full_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee',
  `image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_active` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code_expire` timestamp NULL DEFAULT NULL,
  `sms_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sms_code_expire` datetime DEFAULT NULL,
  `birth_date` date DEFAULT NULL,
  `gender` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `locale` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en',
  `theme` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'light',
  `active` tinyint NOT NULL DEFAULT '1',
  `is_notify` tinyint NOT NULL DEFAULT '1',
  `is_admin` tinyint NOT NULL DEFAULT '0',
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `users_type_index` (`type`),
  KEY `users_active_index` (`active`),
  KEY `users_email_index` (`email`),
  KEY `users_phone_index` (`phone`),
  KEY `users_deleted_at_index` (`deleted_at`),
  KEY `users_created_at_index` (`created_at`),
  FULLTEXT KEY `users_search_fulltext` (`full_name`,`email`,`phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `work_schedule_days`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_schedule_days` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `schedule_id` bigint unsigned DEFAULT NULL,
  `day_of_week` int NOT NULL DEFAULT '0',
  `work_location` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_time` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latest_start_time` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `flexible_start` tinyint(1) NOT NULL DEFAULT '0',
  `required_work_minutes` int NOT NULL DEFAULT '0',
  `break_minutes` int NOT NULL DEFAULT '0',
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `work_schedule_days_schedule_id_foreign` (`schedule_id`),
  CONSTRAINT `work_schedule_days_schedule_id_foreign` FOREIGN KEY (`schedule_id`) REFERENCES `work_schedules` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `work_schedules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_schedules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `order_id` tinyint 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;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'2014_04_02_193005_create_translations_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2014_10_12_000000_create_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2014_10_12_100000_create_password_resets_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2019_02_12_143247_create_settings_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2019_08_19_000000_create_failed_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2019_12_14_000001_create_personal_access_tokens_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2020_07_12_000000_create_user_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2020_07_13_000000_create_activity_logs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2020_07_13_000000_create_logs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2020_07_17_000000_create_metas_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2021_02_12_134737_create_attachments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2021_11_02_105102_create_smses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2022_05_09_000000_create_countries_and_cities_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2022_05_15_143247_create_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2022_11_13_080008_create_laratrust_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2022_11_13_110033_create_notifications_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2023_06_07_000001_create_pulse_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2024_02_12_000000_create_user_codes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2026_02_04_141228_add_relations_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2026_02_24_152615_create_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2026_08_23_000000_add_lookup_indexes_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2026_08_26_000000_add_user_device_to_log_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2026_09_08_162619_create_departments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2026_09_08_171131_create_holy_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2026_09_15_000001_add_invitation_columns_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2026_09_15_000002_add_approval_columns_to_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2026_09_15_000003_drop_status_reason_from_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2026_09_15_112411_create_job_titles_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (29,'2026_09_15_112427_create_holidays_types_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (30,'2026_09_15_112436_create_reasons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (31,'2026_09_15_112449_create_reject_reasons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (32,'2026_09_15_112449_create_work_schedules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (33,'2026_09_15_112450_create_holidays_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (34,'2026_09_15_112518_create_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (35,'2026_09_15_112519_create_projects_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (36,'2026_09_15_112520_add_user_id_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (37,'2026_09_15_112528_create_task_folders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (38,'2026_09_15_112641_create_tasks_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (39,'2026_09_15_112705_create_department_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (40,'2026_09_15_112712_create_work_schedule_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (41,'2026_09_15_112719_create_employee_work_schedules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (42,'2026_09_15_112725_create_attendance_logs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (43,'2026_09_15_112735_create_permission_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (44,'2026_09_15_112744_create_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (45,'2026_09_15_112750_create_overtime_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (46,'2026_09_15_112757_create_remote_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (47,'2026_09_15_112805_create_attendance_corrections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (48,'2026_09_15_112812_create_holiday_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (49,'2026_09_15_112813_create_holiday_request_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (50,'2026_09_15_112819_create_increase_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (51,'2026_09_15_112828_create_payrolls_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (52,'2026_09_15_112834_create_payroll_items_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (53,'2026_09_15_112841_create_payroll_adjustments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (54,'2026_09_15_112847_create_approval_steps_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (55,'2026_09_15_112856_create_reminders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (56,'2026_09_15_112902_create_holiday_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (57,'2026_09_15_112929_create_employee_histories_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (58,'2026_09_15_112935_create_task_assignees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (59,'2026_09_15_112941_create_task_comments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (60,'2026_09_15_112947_create_task_time_entries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (61,'2026_09_15_112954_create_task_attachments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (62,'2026_09_15_120000_add_dates_and_progress_to_projects_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (63,'2026_09_15_120100_add_dates_to_tasks_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (64,'2026_09_15_120200_create_task_user_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (65,'2026_09_15_120300_create_task_folder_user_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (66,'2026_09_15_130000_add_parent_id_to_task_folders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (67,'2026_09_16_000001_add_unique_index_to_devices_imei',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (68,'2026_09_16_000002_make_check_out_nullable_on_daily_attendances',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (69,'2026_09_16_120000_adjust_task_time_entries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (70,'2026_09_16_120600_add_is_completed_to_tasks_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (71,'2026_09_16_122401_create_cache_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (72,'2026_09_16_130000_add_feedback_to_task_time_entries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (73,'2026_09_16_140000_change_due_date_to_datetime_on_tasks_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (74,'2026_09_16_150000_create_task_folder_employee_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (75,'2026_09_20_014852_drop_first_last_name_from_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (76,'2026_09_20_024224_drop_description_from_job_titles_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (77,'2026_09_21_143744_add_note_to_holiday_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (78,'2026_09_21_143752_add_note_to_permission_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (79,'2026_09_21_143802_add_note_to_overtime_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (80,'2026_09_21_143810_add_note_to_remote_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (81,'2026_09_21_143915_add_note_to_attendance_corrections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (82,'2026_09_22_010145_add_public_key_to_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (83,'2026_09_22_010146_create_login_challenges_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (84,'2026_09_23_104528_modify_remote_requests_table_remove_name_add_count_as_overtime',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (85,'2026_09_23_111048_remove_name_from_increase_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (86,'2026_09_23_112735_add_note_to_increase_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (87,'2026_09_23_113357_rename_approved_to_reviewed_in_permission_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (88,'2026_09_23_113406_rename_approved_to_reviewed_in_overtime_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (89,'2026_09_23_113407_rename_approved_to_reviewed_in_remote_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (90,'2026_09_23_113408_rename_approved_to_reviewed_in_increase_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (91,'2026_09_23_113511_rename_approved_to_reviewed_in_increase_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (92,'2026_09_23_120842_create_schedule_change_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (93,'2026_09_23_153046_create_employee_invitations_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (94,'2026_09_23_153437_create_device_registration_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (95,'2026_09_23_153500_add_registration_fields_to_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (96,'2026_09_23_161419_create_credentials_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (97,'2026_09_23_165228_add_device_id_to_personal_access_tokens_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (98,'2026_09_23_191634_merge_device_registration_fields_to_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (99,'2026_09_23_191738_drop_device_registration_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (100,'2026_10_06_180021_add_missing_challenge_id_to_login_challenges_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (101,'2026_10_08_124829_replace_invitation_token_hash_with_invitation_code_on_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (102,'2026_10_08_154647_create_daily_attendance_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (103,'2026_10_08_154648_make_approved_at_nullable_on_attendance_corrections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (104,'2026_10_08_160946_create_attendance_qr_challenges_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (105,'2026_10_08_160947_create_attendance_signing_challenges_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (106,'2026_10_08_160948_add_unique_employee_date_to_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (107,'2026_10_08_160949_widen_coordinates_on_attendance_logs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (108,'2026_10_10_104928_drop_name_qr_token_status_from_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (109,'2026_10_10_112200_consolidate_user_name_and_drop_unused_columns_from_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (110,'2026_10_10_233144_create_user_invitations_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (111,'2026_10_10_235425_rename_employee_invitations_permissions_to_user_invitations',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (112,'2026_10_11_101651_replace_rejection_reason_with_rejection_reason_id_on_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (113,'2026_10_11_102959_drop_status_from_devices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (114,'2026_10_11_111519_drop_name_from_request_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (115,'2026_10_11_223929_drop_description_from_work_schedules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (116,'2026_10_11_224623_drop_name_from_work_schedule_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (117,'2026_10_12_003615_add_work_location_and_monthly_required_minutes_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (118,'2026_10_12_003616_add_work_location_to_work_schedule_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (119,'2026_10_12_003618_make_effective_to_nullable_on_employee_work_schedules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (120,'2026_10_12_004216_make_shift_columns_nullable_on_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (121,'2026_10_12_113445_convert_task_folder_names_to_plain_text',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (122,'2026_10_12_140129_make_work_location_nullable_on_employees_and_work_schedule_days',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (123,'2026_10_12_151016_create_compensatory_day_swap_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (124,'2026_10_12_193928_convert_reason_types_to_snake_case',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (125,'2026_10_12_204601_drop_name_and_permission_request_id_from_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (126,'2026_10_12_205546_drop_name_from_attendance_logs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (127,'2026_10_12_211159_drop_required_work_minutes_from_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (128,'2026_10_13_075020_make_check_in_nullable_and_rename_statuses_on_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (129,'2026_10_13_080000_create_task_statuses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (130,'2026_10_15_115448_move_task_status_to_folder_statuses',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (131,'2026_10_15_133910_replace_holidays_type_id_with_type_on_holiday_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (132,'2026_10_15_145319_rename_holidays_limit_per_year_setting',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (133,'2026_10_15_161013_add_flexible_start_to_work_schedule_days_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (134,'2026_10_17_140438_replace_monthly_permission_settings_with_period_hours',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (135,'2026_10_17_141304_make_end_time_nullable_on_remote_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (136,'2026_10_17_143152_add_permission_max_minutes_per_request_setting',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (137,'2026_10_18_115701_move_api_permissions_to_route_names',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (138,'2026_10_18_122239_add_request_review_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (139,'2026_10_18_145144_add_device_management_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (140,'2026_10_18_153027_add_admin_module_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (141,'2026_10_18_160705_remove_attendance_and_balance_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (142,'2026_10_19_144059_drop_create_and_edit_from_paired_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (143,'2026_10_19_230433_split_combined_permissions_into_single_rows',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (144,'2026_10_20_010840_restructure_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (145,'2026_10_20_014039_convert_user_types_to_the_user_type_enum',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (146,'2026_10_20_102752_add_address_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (147,'2026_10_20_103714_add_first_name_and_last_name_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (148,'2026_10_20_104108_make_ended_at_nullable_on_department_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (149,'2026_10_21_160237_drop_employee_invitations_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (150,'2026_10_21_233351_grant_daily_attendance_permissions_to_the_employee_role',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (151,'2026_10_24_093328_convert_enum_columns_to_strings',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (152,'2026_10_24_120000_drop_name_notes_order_id_from_employee_work_schedules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (153,'2026_10_25_115351_add_login_platforms_to_roles_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (154,'2026_10_25_121814_add_manager_id_to_departments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (155,'2026_10_26_000000_add_payroll_engine_columns_to_payrolls_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (156,'2026_10_26_000100_add_payroll_action_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (157,'2026_10_26_194628_add_report_section_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (158,'2026_10_26_212317_add_has_special_needs_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (159,'2026_10_26_212319_add_email_to_departments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (160,'2026_10_27_044048_add_dashboard_card_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (161,'2026_10_27_045224_remove_department_employees_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (162,'2026_10_27_062106_replace_holiday_date_with_date_range_on_holidays_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (163,'2026_10_27_063145_drop_holiday_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (164,'2026_10_27_073443_remove_unused_user_invitations_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (165,'2026_10_27_155640_prepare_approval_steps_for_request_reviews',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (166,'2026_10_27_163003_backfill_approval_steps_for_existing_requests',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (167,'2026_10_27_164212_grant_request_review_permissions_to_the_employee_role',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (168,'2026_10_28_042641_add_manager_role',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (169,'2026_10_28_074642_drop_active_and_order_id_from_payrolls_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (170,'2026_10_28_074644_remove_payrolls_status_permission',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (171,'2026_10_28_081219_grant_payrolls_index_to_employee_and_manager_roles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (172,'2026_10_28_082642_sync_default_role_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (173,'2026_10_28_083231_link_users_to_their_type_roles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (174,'2026_10_28_084856_grant_payrolls_show_to_employee_and_manager_roles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (175,'2026_10_28_231724_add_repeat_to_reminders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (176,'2026_10_28_231725_create_reminder_recipients_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (177,'2026_10_29_084719_grant_reminder_permissions_to_the_employee_role',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (178,'2026_10_29_091847_add_remote_requests_assign_permission',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (179,'2026_10_29_092502_create_remote_request_assignments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (180,'2026_10_29_092503_add_assignment_id_to_remote_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (181,'2026_10_30_200915_add_notified_at_to_reminder_recipients_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (182,'2026_10_31_193104_delete_unused_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (183,'2026_11_01_035435_remove_schedule_history_and_holy_day_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (184,'2026_11_01_051920_fill_missing_permission_descriptions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (185,'2026_11_01_055030_clear_custom_permission_descriptions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (186,'2026_11_01_131539_create_remote_request_assignment_employee_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (187,'2026_11_01_131540_move_employee_ids_to_remote_request_assignment_employee_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (188,'2026_11_01_205856_create_teams_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (189,'2026_11_01_205859_add_department_id_and_team_id_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (190,'2026_11_01_205902_drop_department_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (191,'2026_11_01_205905_add_teams_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (192,'2026_11_14_100042_drop_name_from_payrolls_and_payroll_items_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (193,'2026_11_14_100220_drop_name_active_and_order_id_from_payroll_adjustments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (194,'2026_11_14_142625_add_overtime_max_minutes_per_request_setting',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (195,'2026_11_14_160732_create_reminder_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (196,'2026_11_15_113558_create_setting_approvable_request_steps_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (197,'2026_11_15_113559_drop_active_and_order_id_from_approval_steps_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (198,'2026_11_15_113600_assign_approvers_to_pending_approval_steps',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (199,'2026_11_15_113601_add_setting_approvable_request_steps_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (200,'2026_11_15_115500_drop_name_from_approval_steps_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (201,'2026_11_15_124639_delete_unassigned_pending_approval_steps',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (202,'2026_11_15_125318_add_fallback_step_to_pending_requests_without_steps',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (203,'2026_11_15_211404_add_always_approve_requests_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (204,'2026_11_17_172400_remove_unused_setting_approvable_request_steps_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (205,'2026_11_19_001715_create_branches_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (206,'2026_11_19_001719_create_branch_settings_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (207,'2026_11_19_001721_add_branch_id_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (208,'2026_11_19_001722_add_branch_id_to_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (209,'2026_11_19_001724_add_branches_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (210,'2026_11_19_001727_add_has_branches_setting',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (211,'2026_11_19_020250_clear_hybrid_work_location_on_work_schedule_days',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (212,'2026_11_19_020252_add_schedule_type_to_employees_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (213,'2026_11_19_123202_add_notifications_store_permission',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (214,'2026_11_19_130905_add_notifications_index_permission',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (215,'2026_11_25_194252_rework_schedule_change_requests_to_schedule_days',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (216,'2026_11_25_201228_add_other_reason_for_each_reason_type',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (217,'2026_11_26_001129_add_enable_push_setting',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (218,'2026_11_26_092815_add_is_overwrited_and_drop_active_order_id_from_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (219,'2026_11_26_100914_fix_question_mark_arabic_names_in_departments_and_job_titles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (220,'2026_11_26_112834_split_overnight_overtime_requests',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (221,'2026_11_29_010557_remove_payroll_item_write_and_adjustment_status_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (222,'2026_11_30_222148_create_field_visit_requests_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (223,'2026_12_01_000001_add_loan_request_permissions',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (224,'2026_12_01_000002_add_review_fields_to_payroll_adjustments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (225,'2026_12_01_000003_drop_approved_by_and_cancelled_by_from_payroll_adjustments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (226,'2026_12_01_100002_rename_approved_columns_on_attendance_corrections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (227,'2026_12_01_140712_grant_new_request_permissions_to_employee_roles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (228,'2026_12_01_140713_make_requested_times_nullable_on_attendance_corrections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (229,'2026_12_01_143310_drop_name_from_reminders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (230,'2026_12_01_171608_set_default_basic_salary_for_zero_salary_employees',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (231,'2026_12_01_175405_create_missing_employee_rows_for_users',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (232,'2026_12_02_182326_replace_stored_status_on_reminders',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (233,'2026_12_02_190426_unwrap_json_encoded_reminder_titles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (234,'2026_12_02_195610_add_work_location_to_daily_attendances_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (235,'2026_12_06_093956_delete_enable_push_from_settings_table',2);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (236,'2026_12_06_105229_add_pusher_settings_to_settings_table',3);
