-- MySQL dump 10.13  Distrib 8.4.3, for Win64 (x86_64)
--
-- Host: localhost    Database: ebiacada_cpanel_build
-- ------------------------------------------------------
-- Server version	8.4.3

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!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 */;

--
-- Table structure for table `attendance_records`
--

DROP TABLE IF EXISTS `attendance_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_records` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `attendance_session_id` bigint unsigned NOT NULL,
  `portal_student_id` bigint unsigned DEFAULT NULL,
  `staff_user_id` bigint unsigned DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'present',
  `arrival_time` time DEFAULT NULL,
  `departure_time` time DEFAULT NULL,
  `note` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `marked_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_records_attendance_session_id_foreign` (`attendance_session_id`),
  KEY `attendance_records_portal_student_id_foreign` (`portal_student_id`),
  KEY `attendance_records_staff_user_id_foreign` (`staff_user_id`),
  KEY `attendance_records_marked_by_foreign` (`marked_by`),
  CONSTRAINT `attendance_records_attendance_session_id_foreign` FOREIGN KEY (`attendance_session_id`) REFERENCES `attendance_sessions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_records_marked_by_foreign` FOREIGN KEY (`marked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_records_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_records_staff_user_id_foreign` FOREIGN KEY (`staff_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 */;

--
-- Dumping data for table `attendance_records`
--

LOCK TABLES `attendance_records` WRITE;
/*!40000 ALTER TABLE `attendance_records` DISABLE KEYS */;
/*!40000 ALTER TABLE `attendance_records` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendance_sessions`
--

DROP TABLE IF EXISTS `attendance_sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attendance_sessions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `audience` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `portal_course_id` bigint unsigned DEFAULT NULL,
  `academic_period` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `starts_at` timestamp NOT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `late_after_minutes` smallint unsigned NOT NULL DEFAULT '10',
  `early_before_minutes` smallint unsigned NOT NULL DEFAULT '10',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_sessions_portal_course_id_foreign` (`portal_course_id`),
  KEY `attendance_sessions_created_by_foreign` (`created_by`),
  KEY `attendance_sessions_audience_starts_at_index` (`audience`,`starts_at`),
  CONSTRAINT `attendance_sessions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_sessions_portal_course_id_foreign` FOREIGN KEY (`portal_course_id`) REFERENCES `portal_courses` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `attendance_sessions`
--

LOCK TABLES `attendance_sessions` WRITE;
/*!40000 ALTER TABLE `attendance_sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `attendance_sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache`
--

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache_locks`
--

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(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache_locks`
--

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `classroom_attendance`
--

DROP TABLE IF EXISTS `classroom_attendance`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classroom_attendance` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `live_classroom_id` bigint unsigned NOT NULL,
  `portal_student_id` bigint unsigned NOT NULL,
  `joined_at` timestamp NOT NULL,
  `last_seen_at` timestamp NOT NULL,
  `left_at` timestamp NULL DEFAULT NULL,
  `kicked_at` timestamp NULL DEFAULT NULL,
  `kicked_by` bigint unsigned DEFAULT NULL,
  `active_seconds` int unsigned NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `classroom_attendance_live_classroom_id_portal_student_id_unique` (`live_classroom_id`,`portal_student_id`),
  KEY `classroom_attendance_kicked_by_foreign` (`kicked_by`),
  KEY `classroom_attendance_portal_student_id_last_seen_at_index` (`portal_student_id`,`last_seen_at`),
  CONSTRAINT `classroom_attendance_kicked_by_foreign` FOREIGN KEY (`kicked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `classroom_attendance_live_classroom_id_foreign` FOREIGN KEY (`live_classroom_id`) REFERENCES `live_classrooms` (`id`) ON DELETE CASCADE,
  CONSTRAINT `classroom_attendance_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `classroom_attendance`
--

LOCK TABLES `classroom_attendance` WRITE;
/*!40000 ALTER TABLE `classroom_attendance` DISABLE KEYS */;
/*!40000 ALTER TABLE `classroom_attendance` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `contact_inquiries`
--

DROP TABLE IF EXISTS `contact_inquiries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `contact_inquiries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `topic` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_inquiries_reviewed_by_foreign` (`reviewed_by`),
  KEY `contact_inquiries_status_created_at_index` (`status`,`created_at`),
  KEY `contact_inquiries_status_index` (`status`),
  CONSTRAINT `contact_inquiries_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 */;

--
-- Dumping data for table `contact_inquiries`
--

LOCK TABLES `contact_inquiries` WRITE;
/*!40000 ALTER TABLE `contact_inquiries` DISABLE KEYS */;
/*!40000 ALTER TABLE `contact_inquiries` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `course_registration_requests`
--

DROP TABLE IF EXISTS `course_registration_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_registration_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `portal_course_id` bigint unsigned NOT NULL,
  `academic_period` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `course_reg_student_course_period_unique` (`portal_student_id`,`portal_course_id`,`academic_period`),
  KEY `course_registration_requests_portal_course_id_foreign` (`portal_course_id`),
  CONSTRAINT `course_registration_requests_portal_course_id_foreign` FOREIGN KEY (`portal_course_id`) REFERENCES `portal_courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `course_registration_requests_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `course_registration_requests`
--

LOCK TABLES `course_registration_requests` WRITE;
/*!40000 ALTER TABLE `course_registration_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `course_registration_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `defence_schedules`
--

DROP TABLE IF EXISTS `defence_schedules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `defence_schedules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `research_submission_id` bigint unsigned DEFAULT NULL,
  `defence_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stage` smallint unsigned NOT NULL DEFAULT '1',
  `scheduled_at` datetime NOT NULL,
  `venue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `panel_details` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fee_required` tinyint(1) NOT NULL DEFAULT '0',
  `fee_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `fee_currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NGN',
  `portal_fee_id` bigint unsigned DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'scheduled',
  `admin_note` text COLLATE utf8mb4_unicode_ci,
  `scheduled_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `admission_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'not_checked',
  `admission_checked_by` bigint unsigned DEFAULT NULL,
  `admission_checked_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `defence_schedules_portal_student_id_foreign` (`portal_student_id`),
  KEY `defence_schedules_research_submission_id_foreign` (`research_submission_id`),
  KEY `defence_schedules_portal_fee_id_foreign` (`portal_fee_id`),
  KEY `defence_schedules_scheduled_by_foreign` (`scheduled_by`),
  KEY `defence_schedules_admission_checked_by_foreign` (`admission_checked_by`),
  CONSTRAINT `defence_schedules_admission_checked_by_foreign` FOREIGN KEY (`admission_checked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `defence_schedules_portal_fee_id_foreign` FOREIGN KEY (`portal_fee_id`) REFERENCES `portal_fees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `defence_schedules_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `defence_schedules_research_submission_id_foreign` FOREIGN KEY (`research_submission_id`) REFERENCES `research_submissions` (`id`) ON DELETE SET NULL,
  CONSTRAINT `defence_schedules_scheduled_by_foreign` FOREIGN KEY (`scheduled_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 */;

--
-- Dumping data for table `defence_schedules`
--

LOCK TABLES `defence_schedules` WRITE;
/*!40000 ALTER TABLE `defence_schedules` DISABLE KEYS */;
/*!40000 ALTER TABLE `defence_schedules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `desktop_sync_records`
--

DROP TABLE IF EXISTS `desktop_sync_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `desktop_sync_records` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `record_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `desktop_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` json NOT NULL,
  `payload_hash` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `desktop_updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `desktop_sync_records_record_type_desktop_id_unique` (`record_type`,`desktop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `desktop_sync_records`
--

LOCK TABLES `desktop_sync_records` WRITE;
/*!40000 ALTER TABLE `desktop_sync_records` DISABLE KEYS */;
/*!40000 ALTER TABLE `desktop_sync_records` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `exam_proctor_events`
--

DROP TABLE IF EXISTS `exam_proctor_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `exam_proctor_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `attempt_id` bigint unsigned NOT NULL,
  `event_type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `occurred_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exam_proctor_events_attempt_id_foreign` (`attempt_id`),
  CONSTRAINT `exam_proctor_events_attempt_id_foreign` FOREIGN KEY (`attempt_id`) REFERENCES `online_exam_attempts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `exam_proctor_events`
--

LOCK TABLES `exam_proctor_events` WRITE;
/*!40000 ALTER TABLE `exam_proctor_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `exam_proctor_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `exam_settings`
--

DROP TABLE IF EXISTS `exam_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `exam_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `objective_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `subjective_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `theory_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `camera_required` tinyint(1) NOT NULL DEFAULT '0',
  `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 */;

--
-- Dumping data for table `exam_settings`
--

LOCK TABLES `exam_settings` WRITE;
/*!40000 ALTER TABLE `exam_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `exam_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `failed_jobs`
--

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(255) 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 */;

--
-- Dumping data for table `failed_jobs`
--

LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `gateway_settings`
--

DROP TABLE IF EXISTS `gateway_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gateway_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `configuration` json NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `gateway_settings_provider_unique` (`provider`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `gateway_settings`
--

LOCK TABLES `gateway_settings` WRITE;
/*!40000 ALTER TABLE `gateway_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `gateway_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_batches`
--

DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `job_batches`
--

LOCK TABLES `job_batches` WRITE;
/*!40000 ALTER TABLE `job_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_batches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `jobs`
--

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(255) 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 */;

--
-- Dumping data for table `jobs`
--

LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `live_classrooms`
--

DROP TABLE IF EXISTS `live_classrooms`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `live_classrooms` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_course_id` bigint unsigned DEFAULT NULL,
  `instructor_user_id` bigint unsigned NOT NULL,
  `title` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `academic_period` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'scheduled',
  `starts_at` timestamp NOT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `youtube_video_id` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recording_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `live_classrooms_instructor_user_id_foreign` (`instructor_user_id`),
  KEY `live_classrooms_status_starts_at_index` (`status`,`starts_at`),
  KEY `live_classrooms_portal_course_id_academic_period_status_index` (`portal_course_id`,`academic_period`,`status`),
  CONSTRAINT `live_classrooms_instructor_user_id_foreign` FOREIGN KEY (`instructor_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `live_classrooms_portal_course_id_foreign` FOREIGN KEY (`portal_course_id`) REFERENCES `portal_courses` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `live_classrooms`
--

LOCK TABLES `live_classrooms` WRITE;
/*!40000 ALTER TABLE `live_classrooms` DISABLE KEYS */;
/*!40000 ALTER TABLE `live_classrooms` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `migrations`
--

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(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `migrations`
--

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'0001_01_01_000001_create_cache_table',1),(3,'0001_01_01_000002_create_jobs_table',1),(4,'2026_11_26_000001_create_ebiacada_portal_tables',1),(5,'2026_11_26_000002_create_admin_parent_sync_tables',1),(6,'2026_11_26_000003_add_production_portal_features',1),(7,'2026_11_26_000004_create_student_account_link_requests',1),(8,'2026_11_26_000005_stage4_research_defence_and_service_charge',1),(9,'2026_11_26_000006_stage4_payment_split_and_defence_admission',1),(10,'2026_11_26_000007_stage4_outbound_research_sync',1),(11,'2026_11_26_000008_add_result_admin_sync_outbox_id',1),(12,'2026_11_26_000009_create_contact_inquiries_table',1),(13,'2026_11_26_000010_add_graduate_transcript_access',1),(14,'2026_11_26_000011_create_live_classrooms',1),(15,'2026_11_26_000012_add_lecturer_approval_timestamp',1),(16,'2026_11_26_055858_create_personal_access_tokens_table',1),(17,'2026_12_01_000001_create_student_application_documents_table',1),(18,'2026_12_01_000002_add_scoped_fee_rules_and_payment_controls',1),(19,'2026_12_01_000003_create_student_id_card_settings_table',1),(20,'2026_12_01_000004_create_student_certificate_tables',1),(21,'2026_12_01_000005_create_online_exams_tables',1),(22,'2026_12_01_000006_create_staff_id_card_profiles',1),(23,'2026_12_01_000007_create_manual_attendance_tables',1);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `online_exam_attempts`
--

DROP TABLE IF EXISTS `online_exam_attempts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `online_exam_attempts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `online_exam_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `answers` json DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in_progress',
  `started_at` timestamp NULL DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `feedback` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `online_exam_attempts_online_exam_id_user_id_unique` (`online_exam_id`,`user_id`),
  KEY `online_exam_attempts_user_id_foreign` (`user_id`),
  KEY `online_exam_attempts_reviewed_by_foreign` (`reviewed_by`),
  CONSTRAINT `online_exam_attempts_online_exam_id_foreign` FOREIGN KEY (`online_exam_id`) REFERENCES `online_exams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `online_exam_attempts_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `online_exam_attempts_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 */;

--
-- Dumping data for table `online_exam_attempts`
--

LOCK TABLES `online_exam_attempts` WRITE;
/*!40000 ALTER TABLE `online_exam_attempts` DISABLE KEYS */;
/*!40000 ALTER TABLE `online_exam_attempts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `online_exam_questions`
--

DROP TABLE IF EXISTS `online_exam_questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `online_exam_questions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `online_exam_id` bigint unsigned NOT NULL,
  `prompt` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` json DEFAULT NULL,
  `answer_key` text COLLATE utf8mb4_unicode_ci,
  `rubric` text COLLATE utf8mb4_unicode_ci,
  `points` decimal(7,2) NOT NULL DEFAULT '1.00',
  `position` smallint unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `online_exam_questions_online_exam_id_foreign` (`online_exam_id`),
  CONSTRAINT `online_exam_questions_online_exam_id_foreign` FOREIGN KEY (`online_exam_id`) REFERENCES `online_exams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `online_exam_questions`
--

LOCK TABLES `online_exam_questions` WRITE;
/*!40000 ALTER TABLE `online_exam_questions` DISABLE KEYS */;
/*!40000 ALTER TABLE `online_exam_questions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `online_exams`
--

DROP TABLE IF EXISTS `online_exams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `online_exams` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_by` bigint unsigned NOT NULL,
  `title` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `course_code` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exam_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci,
  `duration_minutes` smallint unsigned NOT NULL DEFAULT '60',
  `starts_at` timestamp NULL DEFAULT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `online_exams_created_by_foreign` (`created_by`),
  CONSTRAINT `online_exams_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `online_exams`
--

LOCK TABLES `online_exams` WRITE;
/*!40000 ALTER TABLE `online_exams` DISABLE KEYS */;
/*!40000 ALTER TABLE `online_exams` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `parent_student_access`
--

DROP TABLE IF EXISTS `parent_student_access`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `parent_student_access` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `parent_user_id` bigint unsigned NOT NULL,
  `portal_student_id` bigint unsigned NOT NULL,
  `relationship` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `approved_by` bigint unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `parent_student_access_parent_user_id_portal_student_id_unique` (`parent_user_id`,`portal_student_id`),
  KEY `parent_student_access_portal_student_id_foreign` (`portal_student_id`),
  KEY `parent_student_access_approved_by_foreign` (`approved_by`),
  CONSTRAINT `parent_student_access_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `parent_student_access_parent_user_id_foreign` FOREIGN KEY (`parent_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `parent_student_access_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `parent_student_access`
--

LOCK TABLES `parent_student_access` WRITE;
/*!40000 ALTER TABLE `parent_student_access` DISABLE KEYS */;
/*!40000 ALTER TABLE `parent_student_access` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--

DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset_tokens`
--

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `personal_access_tokens`
--

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(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `name` text 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_expires_at_index` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `personal_access_tokens`
--

LOCK TABLES `personal_access_tokens` WRITE;
/*!40000 ALTER TABLE `personal_access_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `personal_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_audit_events`
--

DROP TABLE IF EXISTS `portal_audit_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_audit_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `details` json DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `portal_audit_events_user_id_foreign` (`user_id`),
  CONSTRAINT `portal_audit_events_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 */;

--
-- Dumping data for table `portal_audit_events`
--

LOCK TABLES `portal_audit_events` WRITE;
/*!40000 ALTER TABLE `portal_audit_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_audit_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_courses`
--

DROP TABLE IF EXISTS `portal_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_courses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `desktop_course_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `units` decimal(5,2) NOT NULL DEFAULT '3.00',
  `semester` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `programme` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ALL',
  `academic_year` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_courses_desktop_course_id_unique` (`desktop_course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_courses`
--

LOCK TABLES `portal_courses` WRITE;
/*!40000 ALTER TABLE `portal_courses` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_courses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_fee_rules`
--

DROP TABLE IF EXISTS `portal_fee_rules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_fee_rules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_fee_id` bigint unsigned NOT NULL,
  `level` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `programme` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `semester` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `term` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `academic_period` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NGN',
  `available_currencies` json DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `portal_fee_rules_portal_fee_id_active_index` (`portal_fee_id`,`active`),
  CONSTRAINT `portal_fee_rules_portal_fee_id_foreign` FOREIGN KEY (`portal_fee_id`) REFERENCES `portal_fees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_fee_rules`
--

LOCK TABLES `portal_fee_rules` WRITE;
/*!40000 ALTER TABLE `portal_fee_rules` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_fee_rules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_fee_service_settings`
--

DROP TABLE IF EXISTS `portal_fee_service_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_fee_service_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `enabled` tinyint(1) NOT NULL DEFAULT '0',
  `percentage` decimal(6,2) NOT NULL DEFAULT '20.00',
  `label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Portal / Payment / Maintenance Fee',
  `updated_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `portal_fee_service_settings_updated_by_foreign` (`updated_by`),
  CONSTRAINT `portal_fee_service_settings_updated_by_foreign` FOREIGN KEY (`updated_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 */;

--
-- Dumping data for table `portal_fee_service_settings`
--

LOCK TABLES `portal_fee_service_settings` WRITE;
/*!40000 ALTER TABLE `portal_fee_service_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_fee_service_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_fees`
--

DROP TABLE IF EXISTS `portal_fees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_fees` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fee_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NGN',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `available_currencies` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_fees_fee_code_unique` (`fee_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_fees`
--

LOCK TABLES `portal_fees` WRITE;
/*!40000 ALTER TABLE `portal_fees` DISABLE KEYS */;
INSERT INTO `portal_fees` VALUES (1,'RESULT_CHECK','Result Checking Fee',0.00,'NGN',0,NULL,'2026-12-02 02:02:53','2026-12-02 02:02:53'),(2,'RESEARCH_TOPIC','Research Topic Application Fee',0.00,'NGN',0,NULL,'2026-12-02 02:02:53','2026-12-02 02:02:53'),(3,'COURSE_REGISTRATION','Course Registration Fee',0.00,'NGN',0,NULL,'2026-12-02 02:02:53','2026-12-02 02:02:53');
/*!40000 ALTER TABLE `portal_fees` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_payment_events`
--

DROP TABLE IF EXISTS `portal_payment_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_payment_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payload` json DEFAULT NULL,
  `processing_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'received',
  `error_note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_payment_events_event_key_unique` (`event_key`),
  KEY `portal_payment_events_reference_index` (`reference`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_payment_events`
--

LOCK TABLES `portal_payment_events` WRITE;
/*!40000 ALTER TABLE `portal_payment_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_payment_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_payments`
--

DROP TABLE IF EXISTS `portal_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `portal_fee_id` bigint unsigned NOT NULL,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `academic_period` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `provider_data` json DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `verified_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `main_fee_amount` decimal(12,2) DEFAULT NULL,
  `service_fee_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `service_fee_percentage` decimal(6,2) NOT NULL DEFAULT '0.00',
  `recipient_email` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `portal_fee_rule_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_payments_reference_unique` (`reference`),
  KEY `portal_payments_portal_fee_id_foreign` (`portal_fee_id`),
  KEY `portal_payments_access_idx` (`portal_student_id`,`portal_fee_id`,`status`,`academic_period`),
  KEY `portal_payments_portal_fee_rule_id_foreign` (`portal_fee_rule_id`),
  CONSTRAINT `portal_payments_portal_fee_id_foreign` FOREIGN KEY (`portal_fee_id`) REFERENCES `portal_fees` (`id`),
  CONSTRAINT `portal_payments_portal_fee_rule_id_foreign` FOREIGN KEY (`portal_fee_rule_id`) REFERENCES `portal_fee_rules` (`id`) ON DELETE SET NULL,
  CONSTRAINT `portal_payments_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_payments`
--

LOCK TABLES `portal_payments` WRITE;
/*!40000 ALTER TABLE `portal_payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_results`
--

DROP TABLE IF EXISTS `portal_results`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_results` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `desktop_result_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `portal_student_id` bigint unsigned NOT NULL,
  `portal_course_id` bigint unsigned NOT NULL,
  `grade` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `score` decimal(5,2) DEFAULT NULL,
  `academic_period` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_results_student_course_period_unique` (`portal_student_id`,`portal_course_id`,`academic_period`),
  UNIQUE KEY `portal_results_desktop_result_id_unique` (`desktop_result_id`),
  KEY `portal_results_portal_course_id_foreign` (`portal_course_id`),
  CONSTRAINT `portal_results_portal_course_id_foreign` FOREIGN KEY (`portal_course_id`) REFERENCES `portal_courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `portal_results_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_results`
--

LOCK TABLES `portal_results` WRITE;
/*!40000 ALTER TABLE `portal_results` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_results` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_settings`
--

DROP TABLE IF EXISTS `portal_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `setting_value` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_settings_setting_key_unique` (`setting_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_settings`
--

LOCK TABLES `portal_settings` WRITE;
/*!40000 ALTER TABLE `portal_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_students`
--

DROP TABLE IF EXISTS `portal_students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_students` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `desktop_student_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `matric_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `full_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `level` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_graduated` tinyint(1) NOT NULL DEFAULT '0',
  `transcript_available` tinyint(1) NOT NULL DEFAULT '0',
  `graduation_year` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `programme` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `portal_students_matric_no_unique` (`matric_no`),
  UNIQUE KEY `portal_students_desktop_student_id_unique` (`desktop_student_id`),
  UNIQUE KEY `portal_students_user_id_unique` (`user_id`),
  CONSTRAINT `portal_students_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 */;

--
-- Dumping data for table `portal_students`
--

LOCK TABLES `portal_students` WRITE;
/*!40000 ALTER TABLE `portal_students` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_students` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `portal_sync_outbox`
--

DROP TABLE IF EXISTS `portal_sync_outbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `portal_sync_outbox` (
  `sequence_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `record_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `desktop_student_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `desktop_record_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payload` json NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`sequence_id`),
  KEY `portal_sync_outbox_record_type_sequence_id_index` (`record_type`,`sequence_id`),
  KEY `portal_sync_outbox_record_type_desktop_record_id_index` (`record_type`,`desktop_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `portal_sync_outbox`
--

LOCK TABLES `portal_sync_outbox` WRITE;
/*!40000 ALTER TABLE `portal_sync_outbox` DISABLE KEYS */;
/*!40000 ALTER TABLE `portal_sync_outbox` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `research_assignments`
--

DROP TABLE IF EXISTS `research_assignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `research_assignments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `approved_topic` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supervisor_1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supervisor_2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supervisor_3` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_by` bigint unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `project_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Project',
  PRIMARY KEY (`id`),
  UNIQUE KEY `research_assignments_portal_student_id_unique` (`portal_student_id`),
  KEY `research_assignments_assigned_by_foreign` (`assigned_by`),
  CONSTRAINT `research_assignments_assigned_by_foreign` FOREIGN KEY (`assigned_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `research_assignments_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `research_assignments`
--

LOCK TABLES `research_assignments` WRITE;
/*!40000 ALTER TABLE `research_assignments` DISABLE KEYS */;
/*!40000 ALTER TABLE `research_assignments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `research_preferences`
--

DROP TABLE IF EXISTS `research_preferences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `research_preferences` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `preference_no` tinyint unsigned NOT NULL,
  `topic` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supervisor_preference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `research_preferences_portal_student_id_preference_no_unique` (`portal_student_id`,`preference_no`),
  CONSTRAINT `research_preferences_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `research_preferences`
--

LOCK TABLES `research_preferences` WRITE;
/*!40000 ALTER TABLE `research_preferences` DISABLE KEYS */;
/*!40000 ALTER TABLE `research_preferences` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `research_submissions`
--

DROP TABLE IF EXISTS `research_submissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `research_submissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `research_assignment_id` bigint unsigned DEFAULT NULL,
  `submission_title` varchar(240) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stored_path` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_extension` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_size` bigint unsigned NOT NULL,
  `review_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'submitted',
  `review_notes` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `research_submissions_portal_student_id_foreign` (`portal_student_id`),
  KEY `research_submissions_research_assignment_id_foreign` (`research_assignment_id`),
  KEY `research_submissions_reviewed_by_foreign` (`reviewed_by`),
  CONSTRAINT `research_submissions_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE,
  CONSTRAINT `research_submissions_research_assignment_id_foreign` FOREIGN KEY (`research_assignment_id`) REFERENCES `research_assignments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `research_submissions_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 */;

--
-- Dumping data for table `research_submissions`
--

LOCK TABLES `research_submissions` WRITE;
/*!40000 ALTER TABLE `research_submissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `research_submissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sessions`
--

DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sessions`
--

LOCK TABLES `sessions` WRITE;
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `staff_id_card_profiles`
--

DROP TABLE IF EXISTS `staff_id_card_profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `staff_id_card_profiles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `staff_id` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role_label` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `staff_id_card_profiles_user_id_unique` (`user_id`),
  UNIQUE KEY `staff_id_card_profiles_staff_id_unique` (`staff_id`),
  CONSTRAINT `staff_id_card_profiles_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 */;

--
-- Dumping data for table `staff_id_card_profiles`
--

LOCK TABLES `staff_id_card_profiles` WRITE;
/*!40000 ALTER TABLE `staff_id_card_profiles` DISABLE KEYS */;
/*!40000 ALTER TABLE `staff_id_card_profiles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `student_account_link_requests`
--

DROP TABLE IF EXISTS `student_account_link_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_account_link_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `matric_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `review_note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_account_link_requests_user_id_matric_no_unique` (`user_id`,`matric_no`),
  KEY `student_account_link_requests_reviewed_by_foreign` (`reviewed_by`),
  CONSTRAINT `student_account_link_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `student_account_link_requests_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 */;

--
-- Dumping data for table `student_account_link_requests`
--

LOCK TABLES `student_account_link_requests` WRITE;
/*!40000 ALTER TABLE `student_account_link_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_account_link_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `student_application_documents`
--

DROP TABLE IF EXISTS `student_application_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_application_documents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `document_type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stored_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_application_documents_user_id_document_type_unique` (`user_id`,`document_type`),
  CONSTRAINT `student_application_documents_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 */;

--
-- Dumping data for table `student_application_documents`
--

LOCK TABLES `student_application_documents` WRITE;
/*!40000 ALTER TABLE `student_application_documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_application_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `student_certificate_settings`
--

DROP TABLE IF EXISTS `student_certificate_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_certificate_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `configuration` json 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 */;

--
-- Dumping data for table `student_certificate_settings`
--

LOCK TABLES `student_certificate_settings` WRITE;
/*!40000 ALTER TABLE `student_certificate_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_certificate_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `student_certificates`
--

DROP TABLE IF EXISTS `student_certificates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_certificates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `portal_student_id` bigint unsigned NOT NULL,
  `certificate_no` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `student_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `student_matric_no` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `award_title` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `programme` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `classification` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `academic_period` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `award_date` date NOT NULL,
  `honours_text` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'issued',
  `issued_by` bigint unsigned DEFAULT NULL,
  `issued_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_certificates_certificate_no_unique` (`certificate_no`),
  KEY `student_certificates_issued_by_foreign` (`issued_by`),
  KEY `student_certificates_portal_student_id_status_index` (`portal_student_id`,`status`),
  CONSTRAINT `student_certificates_issued_by_foreign` FOREIGN KEY (`issued_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `student_certificates_portal_student_id_foreign` FOREIGN KEY (`portal_student_id`) REFERENCES `portal_students` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `student_certificates`
--

LOCK TABLES `student_certificates` WRITE;
/*!40000 ALTER TABLE `student_certificates` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_certificates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `student_id_card_settings`
--

DROP TABLE IF EXISTS `student_id_card_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_id_card_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `configuration` json 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 */;

--
-- Dumping data for table `student_id_card_settings`
--

LOCK TABLES `student_id_card_settings` WRITE;
/*!40000 ALTER TABLE `student_id_card_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_id_card_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sync_audit`
--

DROP TABLE IF EXISTS `sync_audit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sync_audit` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `device_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `operation` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload_hash` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'accepted',
  `conflict_note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sync_audit`
--

LOCK TABLES `sync_audit` WRITE;
/*!40000 ALTER TABLE `sync_audit` DISABLE KEYS */;
/*!40000 ALTER TABLE `sync_audit` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sync_devices`
--

DROP TABLE IF EXISTS `sync_devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sync_devices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `device_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_seen_at` timestamp NULL DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sync_devices_device_id_unique` (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sync_devices`
--

LOCK TABLES `sync_devices` WRITE;
/*!40000 ALTER TABLE `sync_devices` DISABLE KEYS */;
/*!40000 ALTER TABLE `sync_devices` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sync_imports`
--

DROP TABLE IF EXISTS `sync_imports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sync_imports` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `source_device` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `backup_sha256` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'received',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sync_imports_reviewed_by_foreign` (`reviewed_by`),
  CONSTRAINT `sync_imports_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 */;

--
-- Dumping data for table `sync_imports`
--

LOCK TABLES `sync_imports` WRITE;
/*!40000 ALTER TABLE `sync_imports` DISABLE KEYS */;
/*!40000 ALTER TABLE `sync_imports` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

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,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `portal_role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'student',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `lecturer_approved_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database 'ebiacada_cpanel_build'
--
/*!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 */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-12-02  4:06:40
