

CREATE TABLE `academic_sessions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `academic_sessions_branch_id_name_unique` (`branch_id`,`name`),
  CONSTRAINT `academic_sessions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `academic_sessions` (`id`, `branch_id`, `name`, `start_date`, `end_date`, `is_active`, `created_at`, `updated_at`) VALUES ('1', '1', '2026', '2026-01-01', '2026-12-31', '1', '2026-10-16 08:59:19', '2026-10-16 08:59:19');


CREATE TABLE `branches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branches_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `branches` (`id`, `name`, `code`, `address`, `phone`, `email`, `status`, `created_at`, `updated_at`) VALUES ('1', 'Main Branch', 'main-1', '257/1/G Ahmed Nagar, Paikpara, Mirpur-1, Dhaka-1216', '01674099838', 'iconacademy2000e@gmail.com', '1', '2026-10-16 08:55:46', '2026-10-16 08:55:46');
INSERT INTO `branches` (`id`, `name`, `code`, `address`, `phone`, `email`, `status`, `created_at`, `updated_at`) VALUES ('2', 'Monipur', 'Branch-2', 'Monipur, Mirpur, Dhaka-1216', '01753787564', 'icon@academy.bd.com', '1', '2026-10-17 08:12:41', '2026-10-17 08:12:41');


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



CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `class_groups` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `group_name` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `class_groups_branch_id_group_name_unique` (`branch_id`,`group_name`),
  CONSTRAINT `class_groups_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `class_groups` (`id`, `group_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('1', 'General', '1', '2026-10-16 10:10:45', '2026-10-16 10:10:45');


CREATE TABLE `class_subject` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) unsigned NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `class_subject_class_id_subject_id_unique` (`class_id`,`subject_id`),
  KEY `class_subject_subject_id_foreign` (`subject_id`),
  CONSTRAINT `class_subject_class_id_foreign` FOREIGN KEY (`class_id`) REFERENCES `clss_m_s` (`id`) ON DELETE CASCADE,
  CONSTRAINT `class_subject_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('1', '14', '6', NULL, NULL);
INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('2', '14', '5', NULL, NULL);
INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('3', '14', '4', NULL, NULL);
INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('4', '14', '1', NULL, NULL);
INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('5', '14', '2', NULL, NULL);
INSERT INTO `class_subject` (`id`, `class_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('6', '14', '3', NULL, NULL);


CREATE TABLE `clss_m_s` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `class_name` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `clss_m_s_branch_id_foreign` (`branch_id`),
  CONSTRAINT `clss_m_s_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('2', 'Play', '1', '2026-10-16 09:20:25', '2026-10-16 09:20:25');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('3', 'Nursery', '1', '2026-10-16 09:20:48', '2026-10-16 09:20:48');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('4', 'KG', '1', '2026-10-16 09:21:01', '2026-10-16 09:21:01');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('5', 'Class 1', '1', '2026-10-16 09:21:22', '2026-10-16 09:21:22');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('6', 'Class 2', '1', '2026-10-16 09:21:35', '2026-10-16 09:21:35');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('7', 'Class 3', '1', '2026-10-16 09:21:50', '2026-10-16 09:21:50');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('8', 'Class 4', '1', '2026-10-16 09:22:00', '2026-10-16 09:22:00');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('9', 'Class 5', '1', '2026-10-16 09:22:10', '2026-10-16 09:22:10');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('10', 'Class 6', '1', '2026-10-16 09:22:20', '2026-10-16 09:22:20');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('11', 'Class 7', '1', '2026-10-16 09:22:32', '2026-10-16 09:22:32');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('12', 'Class 8', '1', '2026-10-16 09:23:17', '2026-10-16 09:23:17');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('13', 'Class 9', '1', '2026-10-16 09:23:30', '2026-10-16 09:23:30');
INSERT INTO `clss_m_s` (`id`, `class_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('14', 'Class 10', '1', '2026-10-16 09:23:45', '2026-10-16 09:23:45');


CREATE TABLE `examinations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `examination_type` varchar(255) NOT NULL,
  `examination_year` varchar(255) NOT NULL,
  `exam_mark` decimal(8,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `examinations_branch_id_foreign` (`branch_id`),
  CONSTRAINT `examinations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `examinations` (`id`, `branch_id`, `examination_type`, `examination_year`, `exam_mark`, `created_at`, `updated_at`) VALUES ('1', '1', 'FINAL', '2026', NULL, '2026-10-17 00:16:54', '2026-10-17 00:16:54');
INSERT INTO `examinations` (`id`, `branch_id`, `examination_type`, `examination_year`, `exam_mark`, `created_at`, `updated_at`) VALUES ('2', '1', 'HALF-YEARLY', '2026', NULL, '2026-10-17 00:17:13', '2026-10-17 00:17:13');
INSERT INTO `examinations` (`id`, `branch_id`, `examination_type`, `examination_year`, `exam_mark`, `created_at`, `updated_at`) VALUES ('3', '1', 'MID-TERM', '2026', NULL, '2026-10-17 08:21:00', '2026-10-17 08:21:00');


CREATE TABLE `expenses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `academic_session_id` bigint(20) unsigned DEFAULT NULL,
  `expense_type` varchar(255) NOT NULL,
  `employee_name` varchar(255) DEFAULT NULL,
  `salary_amount` decimal(10,2) NOT NULL,
  `paid_amount` decimal(10,2) NOT NULL,
  `due_amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_method` enum('Cash','Bkash','Nagad','Bank') NOT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `payment_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `payment_month` date DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_branch_id_foreign` (`branch_id`),
  KEY `expenses_academic_session_id_foreign` (`academic_session_id`),
  CONSTRAINT `expenses_academic_session_id_foreign` FOREIGN KEY (`academic_session_id`) REFERENCES `academic_sessions` (`id`) ON DELETE SET NULL,
  CONSTRAINT `expenses_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `expenses` (`id`, `branch_id`, `academic_session_id`, `expense_type`, `employee_name`, `salary_amount`, `paid_amount`, `due_amount`, `payment_method`, `created_by`, `payment_date`, `created_at`, `updated_at`, `payment_month`, `remarks`) VALUES ('1', '1', '1', 'Electricity Bill', NULL, '500.00', '500.00', '0.00', 'Cash', 'Tapsina Hasneen', '2026-10-17', '2026-10-17 05:57:52', '2026-10-17 05:57:52', '2026-10-01', 'This is Electricity Bill of October');


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



CREATE TABLE `final_results` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `examination_id` bigint(20) unsigned NOT NULL,
  `percentage` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `final_results_examination_id_foreign` (`examination_id`),
  CONSTRAINT `final_results_examination_id_foreign` FOREIGN KEY (`examination_id`) REFERENCES `examinations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `final_results` (`id`, `examination_id`, `percentage`, `created_at`, `updated_at`) VALUES ('3', '1', '50.00', '2026-10-17 08:22:39', '2026-10-17 08:22:39');
INSERT INTO `final_results` (`id`, `examination_id`, `percentage`, `created_at`, `updated_at`) VALUES ('4', '2', '30.00', '2026-10-17 08:22:46', '2026-10-17 08:22:46');
INSERT INTO `final_results` (`id`, `examination_id`, `percentage`, `created_at`, `updated_at`) VALUES ('5', '3', '20.00', '2026-10-17 08:22:50', '2026-10-17 08:22:50');


CREATE TABLE `grading_systems` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `grade` varchar(10) NOT NULL,
  `grade_point` decimal(3,2) NOT NULL,
  `min_percentage` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('1', 'A+', '5.00', '80.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('2', 'A', '4.00', '70.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('3', 'A-', '3.50', '60.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('4', 'B', '3.00', '50.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('5', 'C', '2.00', '40.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('6', 'D', '1.00', '33.00', NULL, NULL);
INSERT INTO `grading_systems` (`id`, `grade`, `grade_point`, `min_percentage`, `created_at`, `updated_at`) VALUES ('7', 'F', '0.00', '0.00', NULL, NULL);


CREATE TABLE `group_subject_mappings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `class_group_id` bigint(20) unsigned NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `group_subject_mappings_class_group_id_subject_id_unique` (`class_group_id`,`subject_id`),
  KEY `group_subject_mappings_subject_id_foreign` (`subject_id`),
  CONSTRAINT `group_subject_mappings_class_group_id_foreign` FOREIGN KEY (`class_group_id`) REFERENCES `class_groups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `group_subject_mappings_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `group_subjects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `class_group_id` bigint(20) unsigned NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `group_subjects_class_group_id_subject_id_unique` (`class_group_id`,`subject_id`),
  KEY `group_subjects_subject_id_foreign` (`subject_id`),
  CONSTRAINT `group_subjects_class_group_id_foreign` FOREIGN KEY (`class_group_id`) REFERENCES `class_groups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `group_subjects_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `group_subjects` (`id`, `class_group_id`, `subject_id`, `created_at`, `updated_at`) VALUES ('1', '1', '4', NULL, NULL);


CREATE TABLE `holidays` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `holidays_branch_id_foreign` (`branch_id`),
  CONSTRAINT `holidays_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `institute_infos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `institute_name` varchar(255) NOT NULL,
  `established_year` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `contact` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `institute_infos_branch_id_index` (`branch_id`),
  CONSTRAINT `institute_infos_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `institute_infos` (`id`, `branch_id`, `institute_name`, `established_year`, `location`, `contact`, `email`, `logo`, `created_at`, `updated_at`) VALUES ('1', '1', 'Icon Academy', '2000', '257/1/G Ahmednagar, Mirpur-1, Dhaka-1216', '01674099838', NULL, 'institute/1792177063_cpdMsFlHXW.jpeg', '2026-10-16 08:57:43', '2026-10-16 08:57:43');


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



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



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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('1', '0001_01_01_000000_create_users_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('2', '0001_01_01_000001_create_cache_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('3', '0001_01_01_000002_create_jobs_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('4', '2026_01_02_152655_create_teachers_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('5', '2026_01_02_164123_create_teachers_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('6', '2026_02_07_071712_create_shifts_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('7', '2026_04_23_074928_create_sections_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('8', '2026_05_10_191531_create_examinations_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('9', '2026_05_11_210152_create_personal_access_tokens_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('10', '2026_05_18_234106_create_clss_m_s_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('11', '2026_05_19_061918_students', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('12', '2026_05_19_115201_create_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('13', '2026_05_19_182404_add_month_to_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('14', '2026_06_20_161735_create_results_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('15', '2026_07_11_094428_add_exit_time_to_teacher_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('16', '2026_07_16_083620_add_monthly_fee_to_students_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('17', '2026_07_17_193256_add_admission_fee_and_exam_fee_to_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('18', '2026_07_18_075010_create_other_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('19', '2026_07_19_104636_create_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('20', '2026_07_19_133530_add_payment_month_to_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('21', '2026_07_30_174357_add_created_by_to_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('22', '2026_08_02_152559_create_model_names_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('23', '2026_08_11_154210_staff', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('24', '2026_08_25_095835_create_staff_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('25', '2026_08_27_191706_create_holidays_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('26', '2026_08_28_120440_create_subjects_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('27', '2026_08_28_121348_create_class_subject_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('28', '2026_08_28_183831_create_result_subjects_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('29', '2026_08_31_175137_create_class_groups_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('30', '2026_08_31_175526_create_group_subjects_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('31', '2026_08_31_190731_add_class_group_id_to_students_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('32', '2026_09_01_160715_create_institute_infos_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('33', '2026_09_07_124506_create_group_subject_mappings_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('34', '2026_09_08_082408_add_full_mark_column_to_subjects_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('35', '2026_09_08_090418_create_grading_systems_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('36', '2026_09_08_201522_add_exam_mark_to_examinations_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('37', '2026_09_10_183844_create_final_results_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('38', '2026_09_16_213755_add_version_to_students_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('39', '2026_09_26_075457_create_branches_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('40', '2026_09_26_084953_add_branch_id_to_staff_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('41', '2026_09_26_143458_add_branch_id_to_clss_m_s_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('42', '2026_09_26_151140_add_branch_id_to_class_groups_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('43', '2026_09_26_170151_add_branch_id_to_sections_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('44', '2026_09_26_171433_add_branch_id_to_shifts_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('45', '2026_09_26_173225_add_branch_id_to_subjects_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('46', '2026_09_26_175622_add_branch_id_to_students_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('47', '2026_09_27_060613_add_branch_id_to_teachers_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('48', '2026_09_28_070702_add_branch_id_to_teachers_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('49', '2026_09_28_071847_add_branch_id_to_staff_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('50', '2026_09_28_092806_add_branch_id_to_examinations_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('51', '2026_09_28_101042_add_branch_id_to_results_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('52', '2026_09_28_111533_add_branch_id_to_holidays_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('53', '2026_09_28_235821_add_branch_id_to_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('54', '2026_09_30_045513_add_branch_id_to_institute_infos_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('55', '2026_10_02_192341_create_student_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('56', '2026_10_03_170617_add_leave_to_student_attendances_status', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('57', '2026_10_12_080903_create_academic_sessions_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('58', '2026_10_12_081734_create_student_sessions_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('59', '2026_10_12_084212_add_student_session_id_to_results_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('60', '2026_10_12_114006_add_student_session_id_to_student_attendances_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('61', '2026_10_12_114742_update_student_attendance_unique_constraint', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('62', '2026_10_12_200323_add_class_snapshot_fields_to_results_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('63', '2026_10_12_215030_add_student_session_id_to_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('64', '2026_10_13_093055_add_student_session_id_to_other_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('65', '2026_10_13_111324_add_academic_session_id_to_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('66', '2026_10_14_142859_add_due_payment_fields_to_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('67', '2026_10_14_184742_add_payment_type_to_other_payments_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('68', '2026_10_14_223344_add_remarks_to_expenses_table', '1');
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES ('69', '2026_10_15_133138_add_student_roll_and_second_phone_to_students_table', '1');


CREATE TABLE `model_names` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `other_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `student_id` bigint(20) unsigned NOT NULL,
  `student_session_id` bigint(20) unsigned DEFAULT NULL,
  `payment_type` varchar(255) NOT NULL DEFAULT 'Other',
  `item_name` varchar(255) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(255) NOT NULL,
  `payment_date` date NOT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `other_payments_student_id_foreign` (`student_id`),
  KEY `other_payments_student_session_id_foreign` (`student_session_id`),
  CONSTRAINT `other_payments_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `other_payments_student_session_id_foreign` FOREIGN KEY (`student_session_id`) REFERENCES `student_sessions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



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



CREATE TABLE `payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `student_id` bigint(20) unsigned NOT NULL,
  `student_session_id` bigint(20) unsigned DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `paid_amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `admission_fee` decimal(10,2) DEFAULT NULL,
  `exam_fee` decimal(10,2) DEFAULT NULL,
  `due_amount` decimal(10,2) DEFAULT NULL,
  `payment_method` varchar(255) DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `status` enum('paid','due') NOT NULL DEFAULT 'due',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `month` varchar(255) DEFAULT NULL,
  `due_month` varchar(255) DEFAULT NULL,
  `due_payment_amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`),
  KEY `payments_student_id_foreign` (`student_id`),
  KEY `payments_session_month_index` (`student_session_id`,`month`),
  CONSTRAINT `payments_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payments_student_session_id_foreign` FOREIGN KEY (`student_session_id`) REFERENCES `student_sessions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `payments` (`id`, `student_id`, `student_session_id`, `amount`, `paid_amount`, `admission_fee`, `exam_fee`, `due_amount`, `payment_method`, `payment_date`, `status`, `created_at`, `updated_at`, `month`, `due_month`, `due_payment_amount`) VALUES ('1', '1', '1', '2000.00', '1500.00', '0.00', '0.00', '500.00', 'Cash', '2026-10-17', 'due', '2026-10-16 23:23:37', '2026-10-16 23:23:37', 'October', NULL, '0.00');
INSERT INTO `payments` (`id`, `student_id`, `student_session_id`, `amount`, `paid_amount`, `admission_fee`, `exam_fee`, `due_amount`, `payment_method`, `payment_date`, `status`, `created_at`, `updated_at`, `month`, `due_month`, `due_payment_amount`) VALUES ('2', '1', '1', '0.00', '0.00', '0.00', '0.00', '0.00', 'Cash', '2026-10-16', 'paid', '2026-10-16 23:24:07', '2026-10-16 23:24:07', NULL, 'October', '500.00');


CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) unsigned NOT NULL,
  `name` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  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_expires_at_index` (`expires_at`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('1', 'App\\Models\\Staff', '1', 'staff-token', '8b4d58ab2c6db00048d9c7d7ddf61254dfa0f5499d107b36a9db9e9a3a8acc56', '[\"*\"]', '2026-10-16 10:12:15', NULL, '2026-10-16 08:40:11', '2026-10-16 10:12:15');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('2', 'App\\Models\\Staff', '2', 'staff-token', '307785b205a08ca33b6e9a341b5cb670015895c5627366ebfce1f0f923657485', '[\"*\"]', '2026-10-16 10:06:18', NULL, '2026-10-16 09:04:34', '2026-10-16 10:06:18');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('3', 'App\\Models\\Staff', '1', 'staff-token', '1f159d83123055f506b62ee740d7bd145a3bf118bf4484f897acc34d1cf80906', '[\"*\"]', '2026-10-16 22:09:34', NULL, '2026-10-16 22:06:15', '2026-10-16 22:09:34');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('4', 'App\\Models\\Staff', '1', 'staff-token', '28e4b426eaa972e51a442dbb8e58df55e7ef2561381fd821eb5f9ef8ffa6fecf', '[\"*\"]', NULL, NULL, '2026-10-16 22:53:06', '2026-10-16 22:53:06');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('5', 'App\\Models\\Staff', '1', 'staff-token', 'c66035433bbec7e61da182147c136212431163f9a489dbaa50fda79f8183bade', '[\"*\"]', NULL, NULL, '2026-10-16 22:53:19', '2026-10-16 22:53:19');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('6', 'App\\Models\\Staff', '1', 'staff-token', '0a33b5ec1eab51f9f86ed277bebde8765ab28943e84913d357ca19b9b1241fee', '[\"*\"]', '2026-10-16 22:57:36', NULL, '2026-10-16 22:53:32', '2026-10-16 22:57:36');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('7', 'App\\Models\\Staff', '1', 'staff-token', '45cdc209a7b3d96c061381e345f0bd065e4d8450eae3d505d1475dbdc0370737', '[\"*\"]', '2026-10-24 13:26:03', NULL, '2026-10-16 22:55:10', '2026-10-24 13:26:03');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('8', 'App\\Models\\Staff', '2', 'staff-token', 'b1a3385586aaf00c2b99751167350b9fbf4e2778e0f24902e47a19f0c51abc3b', '[\"*\"]', '2026-10-23 13:47:33', NULL, '2026-10-16 23:07:07', '2026-10-23 13:47:33');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('9', 'App\\Models\\Staff', '2', 'staff-token', 'b597c6e2c0c321846b91b6db2f84210b391f54b8f506a42c7bd03e66f173130e', '[\"*\"]', NULL, NULL, '2026-10-17 00:29:23', '2026-10-17 00:29:23');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('10', 'App\\Models\\Staff', '2', 'staff-token', 'd888b711b5e24e094f7f681e0d7c7574bc08af1a4c5d7078300860a0534cf95f', '[\"*\"]', NULL, NULL, '2026-10-17 00:29:33', '2026-10-17 00:29:33');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('11', 'App\\Models\\Staff', '2', 'staff-token', '93179dc3e6b06c7c4b78233ff0d2969091695e7979d527882e63b0d98050619b', '[\"*\"]', '2026-10-17 00:32:31', NULL, '2026-10-17 00:29:35', '2026-10-17 00:32:31');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('12', 'App\\Models\\Staff', '1', 'staff-token', '1db6dd8b39afd8e2e20ac64cdf259ae279697aa4643cf7deddf01dd7d96e2611', '[\"*\"]', NULL, NULL, '2026-10-17 08:11:24', '2026-10-17 08:11:24');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('13', 'App\\Models\\Staff', '1', 'staff-token', '1556c9dfa881e39ddaccb8b8daafa69a07d98f71f8516fa3b271b6355fd3d5cb', '[\"*\"]', '2026-10-19 13:54:19', NULL, '2026-10-17 08:11:35', '2026-10-19 13:54:19');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('14', 'App\\Models\\Staff', '1', 'staff-token', 'f91cd18c59fa93d1b916ee30eab7bab0ab161a2e9e4a2b7c57476720634bbdb0', '[\"*\"]', '2026-10-18 14:49:53', NULL, '2026-10-17 09:11:38', '2026-10-18 14:49:53');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('15', 'App\\Models\\Staff', '4', 'staff-token', '904b3052c7bd6db8638244033d23b127f955c7e0c1a44eeef07f524501dbe5a0', '[\"*\"]', '2026-10-19 14:39:08', NULL, '2026-10-19 14:33:12', '2026-10-19 14:39:08');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('16', 'App\\Models\\Staff', '1', 'staff-token', '63d7d1eb43932654a0768f8d0412ae92672ed9494b461ceb3fd563a55c62797d', '[\"*\"]', '2026-10-19 14:43:13', NULL, '2026-10-19 14:41:56', '2026-10-19 14:43:13');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('17', 'App\\Models\\Staff', '5', 'staff-token', '58c5775b800fd0a87492d212c4bb7db41800eeb3e13135d94c5cb881cc919ca6', '[\"*\"]', '2026-10-19 18:26:53', NULL, '2026-10-19 14:43:34', '2026-10-19 18:26:53');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('18', 'App\\Models\\Staff', '5', 'staff-token', 'e9cb4ff27b3ba87a5e0268ee8d19fb437af36794fcc1f2e0eb0aaeff5c9573a7', '[\"*\"]', '2026-10-20 08:28:38', NULL, '2026-10-19 18:27:42', '2026-10-20 08:28:38');
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES ('19', 'App\\Models\\Staff', '1', 'staff-token', 'b35aed571ee0651f2489566ebc30afc6f0543e236f3bee589eb974b9d42faa8d', '[\"*\"]', '2026-10-24 13:50:09', NULL, '2026-10-20 08:29:07', '2026-10-24 13:50:09');


CREATE TABLE `result_subjects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `result_id` bigint(20) unsigned NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `marks` decimal(5,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `result_subjects_result_id_subject_id_unique` (`result_id`,`subject_id`),
  KEY `result_subjects_subject_id_foreign` (`subject_id`),
  CONSTRAINT `result_subjects_result_id_foreign` FOREIGN KEY (`result_id`) REFERENCES `results` (`id`) ON DELETE CASCADE,
  CONSTRAINT `result_subjects_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('1', '1', '1', '99.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('2', '1', '2', '98.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('3', '1', '3', '78.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('4', '1', '4', '87.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('5', '1', '5', '98.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('6', '1', '6', '88.00', '2026-10-17 00:19:58', '2026-10-17 00:19:58');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('7', '2', '1', '99.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('8', '2', '2', '98.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('9', '2', '3', '78.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('10', '2', '4', '76.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('11', '2', '5', '99.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('12', '2', '6', '99.00', '2026-10-17 00:20:29', '2026-10-17 00:20:29');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('13', '3', '1', '98.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('14', '3', '2', '95.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('15', '3', '3', '96.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('16', '3', '4', '88.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('17', '3', '5', '85.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');
INSERT INTO `result_subjects` (`id`, `result_id`, `subject_id`, `marks`, `created_at`, `updated_at`) VALUES ('18', '3', '6', '75.00', '2026-10-17 08:21:52', '2026-10-17 08:21:52');


CREATE TABLE `results` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `student_id` bigint(20) unsigned NOT NULL,
  `student_session_id` bigint(20) unsigned DEFAULT NULL,
  `exam_year` varchar(255) NOT NULL,
  `exam_type` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `class_name_snapshot` varchar(255) DEFAULT NULL,
  `section_name_snapshot` varchar(255) DEFAULT NULL,
  `shift_name_snapshot` varchar(255) DEFAULT NULL,
  `class_group_name_snapshot` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `results_student_id_exam_year_exam_type_unique` (`student_id`,`exam_year`,`exam_type`),
  KEY `results_branch_id_foreign` (`branch_id`),
  KEY `results_student_session_id_foreign` (`student_session_id`),
  CONSTRAINT `results_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `results_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `results_student_session_id_foreign` FOREIGN KEY (`student_session_id`) REFERENCES `student_sessions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `results` (`id`, `branch_id`, `student_id`, `student_session_id`, `exam_year`, `exam_type`, `created_at`, `updated_at`, `class_name_snapshot`, `section_name_snapshot`, `shift_name_snapshot`, `class_group_name_snapshot`) VALUES ('1', '1', '1', '1', '2026', 'HALF-YEARLY', '2026-10-17 00:19:58', '2026-10-17 00:19:58', 'Class 10', 'Eagle', 'Pre-play(Day)', 'General');
INSERT INTO `results` (`id`, `branch_id`, `student_id`, `student_session_id`, `exam_year`, `exam_type`, `created_at`, `updated_at`, `class_name_snapshot`, `section_name_snapshot`, `shift_name_snapshot`, `class_group_name_snapshot`) VALUES ('2', '1', '1', '1', '2026', 'FINAL', '2026-10-17 00:20:29', '2026-10-17 00:20:29', 'Class 10', 'Eagle', 'Pre-play(Day)', 'General');
INSERT INTO `results` (`id`, `branch_id`, `student_id`, `student_session_id`, `exam_year`, `exam_type`, `created_at`, `updated_at`, `class_name_snapshot`, `section_name_snapshot`, `shift_name_snapshot`, `class_group_name_snapshot`) VALUES ('3', '1', '1', '1', '2026', 'MID-TERM', '2026-10-17 08:21:52', '2026-10-17 08:21:52', 'Class 10', 'Eagle', 'Pre-play(Day)', 'General');


CREATE TABLE `sections` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `section_name` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sections_branch_id_section_name_unique` (`branch_id`,`section_name`),
  CONSTRAINT `sections_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('1', 'Nazrul', '1', '2026-10-16 09:13:01', '2026-10-16 09:13:01');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('2', 'Nuton', '1', '2026-10-16 09:13:13', '2026-10-16 09:13:13');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('3', 'Turag', '1', '2026-10-16 09:13:22', '2026-10-16 09:13:22');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('4', 'Jonaki', '1', '2026-10-16 09:13:34', '2026-10-16 09:13:34');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('5', 'Projapoti', '1', '2026-10-16 09:13:46', '2026-10-16 09:13:46');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('6', 'spider', '1', '2026-10-16 09:14:06', '2026-10-16 09:14:06');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('7', 'Hadi', '1', '2026-10-16 09:14:15', '2026-10-16 09:14:15');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('8', 'Ababil', '1', '2026-10-16 09:14:26', '2026-10-16 09:14:26');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('9', 'Modhumoti', '1', '2026-10-16 09:14:40', '2026-10-16 09:14:40');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('10', 'Jamuna', '1', '2026-10-16 09:14:55', '2026-10-16 09:14:55');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('11', 'Padma', '1', '2026-10-16 09:15:20', '2026-10-16 09:15:20');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('12', 'Korotoa', '1', '2026-10-16 09:15:31', '2026-10-16 09:15:31');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('13', 'Isamoti', '1', '2026-10-16 09:15:41', '2026-10-16 09:15:41');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('14', 'Tista', '1', '2026-10-16 09:15:54', '2026-10-16 09:15:54');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('15', 'Titash', '1', '2026-10-16 09:16:04', '2026-10-16 09:16:04');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('16', 'Bokul', '1', '2026-10-16 09:16:13', '2026-10-16 09:16:13');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('17', 'Shimul', '1', '2026-10-16 09:16:23', '2026-10-16 09:16:23');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('18', 'Rupsha', '1', '2026-10-16 09:16:39', '2026-10-16 09:16:39');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('19', 'Daffodil', '1', '2026-10-16 09:16:50', '2026-10-16 09:16:50');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('20', 'A', '1', '2026-10-16 09:17:02', '2026-10-16 09:17:02');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('21', 'B', '1', '2026-10-16 09:17:11', '2026-10-16 09:17:11');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('22', 'Pigeon', '1', '2026-10-16 09:17:28', '2026-10-16 09:17:28');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('23', 'Kingfisher', '1', '2026-10-16 09:17:45', '2026-10-16 09:17:45');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('24', 'Magpie', '1', '2026-10-16 09:18:08', '2026-10-16 09:18:08');
INSERT INTO `sections` (`id`, `section_name`, `branch_id`, `created_at`, `updated_at`) VALUES ('25', 'Eagle', '1', '2026-10-16 09:18:23', '2026-10-16 09:18:23');


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



CREATE TABLE `shifts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `start_time` time NOT NULL DEFAULT '09:00:00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `shifts_branch_id_name_unique` (`branch_id`,`name`),
  CONSTRAINT `shifts_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('1', 'Staff Shift', '1', '07:30:00', '2026-10-16 09:00:27', '2026-10-16 09:12:02');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('2', 'Day (Special)', '1', '10:30:00', '2026-10-16 09:06:10', '2026-10-16 09:06:10');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('3', 'Morning (Special)', '1', '08:00:00', '2026-10-16 09:06:35', '2026-10-16 09:06:35');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('4', 'Evening (Special)', '1', '15:00:00', '2026-10-16 09:07:42', '2026-10-16 09:07:42');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('5', 'Day (School Section) Play-KG', '1', '10:45:00', '2026-10-16 09:08:06', '2026-10-16 09:08:06');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('6', 'Morning (EV)', '1', '08:00:00', '2026-10-16 09:08:34', '2026-10-16 09:08:34');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('7', 'Morning(EV)1-5', '1', '07:30:00', '2026-10-16 09:08:53', '2026-10-16 09:08:53');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('8', 'Day (EV)', '1', '10:30:00', '2026-10-16 09:09:27', '2026-10-16 09:09:27');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('9', 'Day (School Section) 1-2', '1', '11:00:00', '2026-10-16 09:09:50', '2026-10-16 09:09:50');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('10', 'Day( School Section) 3-10', '1', '12:30:00', '2026-10-16 09:10:36', '2026-10-16 09:10:36');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('11', 'Pre-Play (Morning)', '1', '08:00:00', '2026-10-16 09:10:56', '2026-10-16 09:10:56');
INSERT INTO `shifts` (`id`, `name`, `branch_id`, `start_time`, `created_at`, `updated_at`) VALUES ('12', 'Pre-play(Day)', '1', '10:30:00', '2026-10-16 09:11:16', '2026-10-16 09:11:16');


CREATE TABLE `staff` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `user_name` varchar(255) NOT NULL,
  `skill` varchar(255) DEFAULT NULL,
  `role` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `salary` decimal(10,2) NOT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `staff_user_name_unique` (`user_name`),
  UNIQUE KEY `staff_email_unique` (`email`),
  KEY `staff_shift_id_foreign` (`shift_id`),
  KEY `staff_branch_id_foreign` (`branch_id`),
  CONSTRAINT `staff_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `staff_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `staff` (`id`, `branch_id`, `shift_id`, `name`, `user_name`, `skill`, `role`, `email`, `image`, `salary`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES ('1', NULL, NULL, 'MOSHARRAF HOSSAIN', 'manager', 'Administration', 'Manager', 'icon@academy.com', NULL, '0.00', '$2y$12$/LOC089mm.eYdb8gt6LxEO4v7CsJfc3wZwYEyNEkGtstHSx2bTA2O', NULL, '2026-10-16 08:39:11', '2026-10-16 08:39:11');
INSERT INTO `staff` (`id`, `branch_id`, `shift_id`, `name`, `user_name`, `skill`, `role`, `email`, `image`, `salary`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES ('2', '1', '1', 'Tapsina Hasneen', 'tapsina2002', 'Full-Time', 'Branch Manager', 'tapsinahasneen2002@gmail.com', 'staffs/JMGyiVATHgYmLVDJZaeQCC0CcIuMcefY46gMnMg2.png', '15000.00', '$2y$12$HxxKVTUsKmjmQKSOjXXjKu6JdCClakX7Hf9VwBRn1FljiWS/S770O', NULL, '2026-10-16 09:03:22', '2026-10-16 23:06:35');
INSERT INTO `staff` (`id`, `branch_id`, `shift_id`, `name`, `user_name`, `skill`, `role`, `email`, `image`, `salary`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES ('3', '1', '1', 'Kamal', 'kamal', 'Full-Time', 'Guard', 'kamal@gmail.com', NULL, '8000.00', '$2y$12$X6H2lmHfCEQvCRuF7juRYe4GnpZkEZ1LplyfA7/GFt61oiBJsAd2O', NULL, '2026-10-19 14:30:53', '2026-10-19 14:30:53');
INSERT INTO `staff` (`id`, `branch_id`, `shift_id`, `name`, `user_name`, `skill`, `role`, `email`, `image`, `salary`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES ('5', '1', '1', 'Khairul Hasan', 'khairul', 'Full-Time', 'Result Entry', 'khairul@gmail.com', NULL, '0.00', '$2y$12$W3vxdGUD0/pjZ1muvmaJyuOCc7pevntprozrSirdpV2vRt2XZw2Hu', NULL, '2026-10-19 14:43:09', '2026-10-19 14:43:09');


CREATE TABLE `staff_attendances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `staff_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `shift_name` varchar(255) NOT NULL DEFAULT 'General Shift',
  `date` date NOT NULL,
  `status` enum('Present','Absent','Late','Leave') NOT NULL DEFAULT 'Present',
  `in_time` time DEFAULT NULL,
  `out_time` time DEFAULT NULL,
  `note` text DEFAULT NULL,
  `leave` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `staff_attendances_staff_id_shift_name_date_unique` (`staff_id`,`shift_name`,`date`),
  KEY `staff_attendances_branch_id_foreign` (`branch_id`),
  CONSTRAINT `staff_attendances_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `staff_attendances_staff_id_foreign` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `staff_attendances` (`id`, `staff_id`, `branch_id`, `shift_name`, `date`, `status`, `in_time`, `out_time`, `note`, `leave`, `created_at`, `updated_at`) VALUES ('1', '2', '1', 'Staff Shift', '2026-10-17', 'Late', '07:33:00', NULL, 'Late by 3 mins', '0', '2026-10-17 01:33:21', '2026-10-17 01:33:28');
INSERT INTO `staff_attendances` (`id`, `staff_id`, `branch_id`, `shift_name`, `date`, `status`, `in_time`, `out_time`, `note`, `leave`, `created_at`, `updated_at`) VALUES ('2', '5', '1', 'Staff Shift', '2026-10-19', 'Leave', NULL, NULL, 'Staff is on leave', '1', '2026-10-19 16:08:09', '2026-10-19 16:08:09');
INSERT INTO `staff_attendances` (`id`, `staff_id`, `branch_id`, `shift_name`, `date`, `status`, `in_time`, `out_time`, `note`, `leave`, `created_at`, `updated_at`) VALUES ('3', '3', '1', 'Staff Shift', '2026-10-19', 'Late', '22:08:00', NULL, 'Late by 878 mins', '0', '2026-10-19 16:08:13', '2026-10-19 16:08:13');
INSERT INTO `staff_attendances` (`id`, `staff_id`, `branch_id`, `shift_name`, `date`, `status`, `in_time`, `out_time`, `note`, `leave`, `created_at`, `updated_at`) VALUES ('4', '2', '1', 'Staff Shift', '2026-10-19', 'Late', '22:08:00', NULL, 'Late by 878 mins', '0', '2026-10-19 16:08:21', '2026-10-19 16:08:21');


CREATE TABLE `student_attendances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `student_id` bigint(20) unsigned NOT NULL,
  `student_session_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `date` date NOT NULL,
  `status` enum('present','absent','late','leave') NOT NULL DEFAULT 'present',
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_attendance_session_date_unique` (`student_session_id`,`date`),
  KEY `student_attendances_branch_id_foreign` (`branch_id`),
  KEY `student_attendances_student_id_index` (`student_id`),
  CONSTRAINT `student_attendances_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `student_attendances_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `student_attendances_student_session_id_foreign` FOREIGN KEY (`student_session_id`) REFERENCES `student_sessions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `student_attendances` (`id`, `student_id`, `student_session_id`, `branch_id`, `date`, `status`, `remarks`, `created_at`, `updated_at`) VALUES ('1', '1', '1', '1', '2026-10-17', 'present', NULL, '2026-10-17 00:22:54', '2026-10-17 00:22:54');
INSERT INTO `student_attendances` (`id`, `student_id`, `student_session_id`, `branch_id`, `date`, `status`, `remarks`, `created_at`, `updated_at`) VALUES ('2', '1', '1', '1', '2026-10-19', 'present', NULL, '2026-10-19 03:13:50', '2026-10-19 03:13:50');


CREATE TABLE `student_sessions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `student_id` bigint(20) unsigned NOT NULL,
  `academic_session_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `class_id` bigint(20) unsigned NOT NULL,
  `section_id` bigint(20) unsigned NOT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `class_group_id` bigint(20) unsigned DEFAULT NULL,
  `monthly_fee` decimal(10,2) NOT NULL DEFAULT 0.00,
  `status` enum('active','completed','transferred') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_session_unique` (`student_id`,`academic_session_id`),
  KEY `student_sessions_academic_session_id_foreign` (`academic_session_id`),
  KEY `student_sessions_class_id_foreign` (`class_id`),
  KEY `student_sessions_section_id_foreign` (`section_id`),
  KEY `student_sessions_shift_id_foreign` (`shift_id`),
  KEY `student_sessions_class_group_id_foreign` (`class_group_id`),
  KEY `student_sessions_branch_id_academic_session_id_index` (`branch_id`,`academic_session_id`),
  CONSTRAINT `student_sessions_academic_session_id_foreign` FOREIGN KEY (`academic_session_id`) REFERENCES `academic_sessions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `student_sessions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `student_sessions_class_group_id_foreign` FOREIGN KEY (`class_group_id`) REFERENCES `class_groups` (`id`) ON DELETE SET NULL,
  CONSTRAINT `student_sessions_class_id_foreign` FOREIGN KEY (`class_id`) REFERENCES `clss_m_s` (`id`),
  CONSTRAINT `student_sessions_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`),
  CONSTRAINT `student_sessions_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `student_sessions_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `student_sessions` (`id`, `student_id`, `academic_session_id`, `branch_id`, `class_id`, `section_id`, `shift_id`, `class_group_id`, `monthly_fee`, `status`, `created_at`, `updated_at`) VALUES ('1', '1', '1', '1', '14', '25', '12', '1', '2000.00', 'active', '2026-10-16 10:11:39', '2026-10-16 10:11:39');


CREATE TABLE `students` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `section_id` bigint(20) unsigned NOT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `class_id` bigint(20) unsigned NOT NULL,
  `class_group_id` bigint(20) unsigned DEFAULT NULL,
  `full_name` varchar(255) NOT NULL,
  `version` varchar(255) DEFAULT NULL,
  `fathers_name` varchar(255) NOT NULL,
  `mothers_name` varchar(255) NOT NULL,
  `student_id` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `course_name` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `admission_date` date DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `monthly_fee` decimal(10,2) DEFAULT NULL,
  `student_roll` varchar(255) DEFAULT NULL,
  `second_phone` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `students_student_id_unique` (`student_id`),
  KEY `students_section_id_foreign` (`section_id`),
  KEY `students_shift_id_foreign` (`shift_id`),
  KEY `students_class_id_foreign` (`class_id`),
  KEY `students_class_group_id_foreign` (`class_group_id`),
  KEY `students_branch_id_foreign` (`branch_id`),
  CONSTRAINT `students_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `students_class_group_id_foreign` FOREIGN KEY (`class_group_id`) REFERENCES `class_groups` (`id`) ON DELETE SET NULL,
  CONSTRAINT `students_class_id_foreign` FOREIGN KEY (`class_id`) REFERENCES `clss_m_s` (`id`) ON DELETE CASCADE,
  CONSTRAINT `students_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE,
  CONSTRAINT `students_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `students` (`id`, `branch_id`, `section_id`, `shift_id`, `class_id`, `class_group_id`, `full_name`, `version`, `fathers_name`, `mothers_name`, `student_id`, `phone`, `email`, `course_name`, `image`, `admission_date`, `status`, `created_at`, `updated_at`, `monthly_fee`, `student_roll`, `second_phone`) VALUES ('1', '1', '25', '12', '14', '1', 'Tashrif', 'Bangla Medium (Special Care)', 'Shahidul Islam', 'Taskiya Tanzin', 'STD-1001', '01753787564', 'tashrif@gmail.com', NULL, NULL, '2026-10-16', 'active', '2026-10-16 10:11:39', '2026-10-16 10:11:39', '2000.00', '01', '01979787564');


CREATE TABLE `subjects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(50) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `full_mark` int(10) unsigned NOT NULL DEFAULT 100,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subjects_branch_id_code_unique` (`branch_id`,`code`),
  CONSTRAINT `subjects_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('1', 'Bangla', 'BANG', '1', '100', '2026-10-17 00:17:42', '2026-10-17 00:17:42');
INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('2', 'English', 'ENG', '1', '100', '2026-10-17 00:17:56', '2026-10-17 00:17:56');
INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('3', 'Math', 'MATH', '1', '100', '2026-10-17 00:18:07', '2026-10-17 00:18:07');
INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('4', 'Bgs', 'BGS', '1', '100', '2026-10-17 00:18:20', '2026-10-17 00:18:20');
INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('5', 'Science', 'SCE', '1', '100', '2026-10-17 00:18:37', '2026-10-17 00:18:37');
INSERT INTO `subjects` (`id`, `name`, `code`, `branch_id`, `full_mark`, `created_at`, `updated_at`) VALUES ('6', 'Religion', 'REL', '1', '100', '2026-10-17 00:18:48', '2026-10-17 00:18:48');


CREATE TABLE `teacher_shift` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `teacher_id` bigint(20) unsigned NOT NULL,
  `shift_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `teacher_shift_teacher_id_foreign` (`teacher_id`),
  KEY `teacher_shift_shift_id_foreign` (`shift_id`),
  CONSTRAINT `teacher_shift_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `teacher_shift_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `teachers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `teachers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `teacher_id` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `full_name` varchar(255) NOT NULL,
  `designation` varchar(255) NOT NULL,
  `department` varchar(255) NOT NULL,
  `qualification` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `join_date` date NOT NULL,
  `salary` decimal(10,2) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `teachers_teacher_id_unique` (`teacher_id`),
  UNIQUE KEY `teachers_email_unique` (`email`),
  KEY `teachers_branch_id_foreign` (`branch_id`),
  CONSTRAINT `teachers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('1', 'TCH-1001', '1', 'Tasmee Haque Lavly', 'Headmaster', 'Computer Science', 'Masters', '01676535043', 'lavly@gmail.com', '2026-10-16', '13000.00', NULL, '2026-10-16 09:30:06', '2026-10-16 09:30:06');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('2', 'TCH-1002', '1', 'Sudarsan Chandra Sarkar', 'Assistant Headmaster', 'Computer Science', 'Masters', '01896216233', 'Sudorshan@gmail.com', '2026-10-16', '12000.00', NULL, '2026-10-16 09:32:34', '2026-10-16 09:32:34');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('3', 'TCH-1003', '1', 'Kamruzzaman', 'Assistant Teacher', 'English', 'Master\'s', '01879762489', 'kamruzzaman@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 09:34:18', '2026-10-16 09:34:18');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('4', 'TCH-1004', '1', 'Md Selim Reza', 'Senior Teacher', 'Mathematics', 'Master\'s', '01944327481', 'MdSelimReza@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 09:36:07', '2026-10-16 09:36:07');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('5', 'TCH-1005', '1', 'Ferdousi Akter', 'Assistant Teacher', 'Computer Science', 'Hon\'s', '01671839643', 'ferdousi@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:38:06', '2026-10-16 09:38:06');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('6', 'TCH-1006', '1', 'Khurseda Begum', 'Assistant Teacher', 'Computer Science', 'Hon\'s', '01946921619', 'Khurseda@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:39:08', '2026-10-16 09:39:08');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('7', 'TCH-1007', '1', 'Maimuna', 'Assistant Teacher', 'Computer Science', 'Degree', '01951198611', 'maimuna@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:40:15', '2026-10-16 09:40:15');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('8', 'TCH-1008', '1', 'Tahmina Akter', 'Assistant Teacher', 'Computer Science', 'Hon\'s', '01710323420', 'tahmina@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:45:09', '2026-10-16 09:45:09');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('9', 'TCH-1009', '1', 'Rojina Akter', 'Assistant Teacher', 'Computer Science', 'Honours degree', '0149238061', 'rojina@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:46:57', '2026-10-16 09:46:57');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('10', 'TCH-1010', '1', 'Shahela Akter Shapla', 'Assistant Teacher', 'Computer Science', 'Honours degree', '0173149398', 'Shahela@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:48:12', '2026-10-16 09:48:12');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('11', 'TCH-1011', '1', 'Tahmina Yeasmin Oshin', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01913176664', 'oshin@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:49:24', '2026-10-16 09:49:24');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('12', 'TCH-1012', '1', 'Mahmuda Akter Mukti', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01846794052', 'mukti@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 09:50:18', '2026-10-16 09:50:18');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('13', 'TCH-1013', '1', 'Nowshin Anjum Mitu', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01985336979', 'mitu@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:51:19', '2026-10-16 09:51:19');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('14', 'TCH-1014', '1', 'Nelufar Yasmin (Section-poddo)', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01918664882', 'nelufa@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:52:34', '2026-10-16 09:52:34');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('15', 'TCH-1015', '1', 'Muslima Akter Bobita', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01675549612', 'bobita@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:54:00', '2026-10-16 09:54:00');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('16', 'TCH-1016', '1', 'Samshun Nahar Kajol', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01684886773', 'kajol@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:55:28', '2026-10-16 09:55:28');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('17', 'TCH-1017', '1', 'Sharmin Akter', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01632328031', 'Sharmin@gmail.com', '2026-10-16', '1600.00', NULL, '2026-10-16 09:56:58', '2026-10-16 09:56:58');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('18', 'TCH-1018', '1', 'Joyonti Khan labonno', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01732191602', 'labbonno@gmail.com', '2026-10-16', '2200.00', NULL, '2026-10-16 09:58:06', '2026-10-16 09:58:06');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('19', 'TCH-1019', '1', 'Asia Sultana', 'Assistant Teacher', 'Computer Science', 'Honours degree', '0000000', 'asia@gmail.com', '2026-10-16', '1500.00', NULL, '2026-10-16 09:58:57', '2026-10-16 09:58:57');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('20', 'TCH-1020', '1', 'Nargis Sultana', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01913851063', 'sultana@gmail.com', '2026-10-16', '2200.00', NULL, '2026-10-16 09:59:49', '2026-10-16 09:59:49');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('21', 'TCH-1021', '1', 'Farjana Akter Rumi', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01615150285', 'rumi@gmail.com', '2026-10-16', '1800.00', NULL, '2026-10-16 10:01:10', '2026-10-16 10:01:10');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('22', 'TCH-1022', '1', 'Rokeya Sultana', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01911701712', 'rokeya@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 10:03:09', '2026-10-16 10:03:09');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('23', 'TCH-1023', '1', 'Morsheda Akter', 'Assistant Teacher', 'Computer Science', 'Honours degree', '01684359998', 'morsheda@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 10:04:12', '2026-10-16 10:04:12');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('24', 'TCH-1024', '1', 'Nusrat Jerin', 'Assistant Teacher', 'Computer Science', 'Honours degree', '00000', 'jerin@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 10:05:21', '2026-10-16 10:05:21');
INSERT INTO `teachers` (`id`, `teacher_id`, `branch_id`, `full_name`, `designation`, `department`, `qualification`, `phone`, `email`, `join_date`, `salary`, `image`, `created_at`, `updated_at`) VALUES ('25', 'TCH-1025', '1', 'Shraboni Sheikh', 'Assistant Teacher', 'Computer Science', 'Honours degree', '0 1717606389', 'shraboni@gmail.com', '2026-10-16', '3000.00', NULL, '2026-10-16 10:06:16', '2026-10-16 10:06:16');


CREATE TABLE `teachers_attendances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `teacher_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `shift_name` varchar(255) NOT NULL DEFAULT 'General Shift',
  `date` date NOT NULL,
  `status` enum('Present','Absent','Late','Leave') NOT NULL DEFAULT 'Present',
  `leave` tinyint(1) NOT NULL DEFAULT 0,
  `in_time` time DEFAULT NULL,
  `out_time` time DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `teachers_attendances_teacher_id_shift_name_date_unique` (`teacher_id`,`shift_name`,`date`),
  KEY `teachers_attendances_branch_id_foreign` (`branch_id`),
  CONSTRAINT `teachers_attendances_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `teachers_attendances_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `teachers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('1', '25', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:10', '2026-10-19 16:09:10');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('2', '23', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:11', '2026-10-19 16:09:11');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('3', '21', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:13', '2026-10-19 16:09:13');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('4', '19', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:14', '2026-10-19 16:09:14');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('5', '16', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:15', '2026-10-19 16:09:15');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('6', '18', '1', 'General Shift', '2026-10-19', 'Late', '0', '22:09:00', NULL, 'Late by 789 mins', '2026-10-19 16:09:15', '2026-10-19 16:09:15');
INSERT INTO `teachers_attendances` (`id`, `teacher_id`, `branch_id`, `shift_name`, `date`, `status`, `leave`, `in_time`, `out_time`, `note`, `created_at`, `updated_at`) VALUES ('7', '25', '1', 'General Shift', '2026-10-24', 'Absent', '0', NULL, NULL, NULL, '2026-10-24 13:25:35', '2026-10-24 13:25:46');


CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

