-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 16, 2026 at 05:43 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `internship_portal`
--

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

--
-- Table structure for table `cache`
--

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

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

--
-- Table structure for table `cache_locks`
--

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

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

--
-- Table structure for table `companies`
--

CREATE TABLE `companies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_registration_id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `address` text NOT NULL,
  `phone_number` varchar(255) NOT NULL,
  `supervisor_user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` (`id`, `company_registration_id`, `name`, `address`, `phone_number`, `supervisor_user_id`, `created_at`, `updated_at`) VALUES
(1, 'TSB001', 'Tech Solutions Sdn Bhd', '123 Jalan Teknologi, Cyberjaya, Selangor 63000', '03-8888-1111', 3, '2026-08-04 16:12:30', '2026-08-04 16:12:30'),
(2, 'DCS002', 'DataCore Systems', '456 Jalan Data, Petaling Jaya, Selangor 47500', '03-7777-2222', 4, '2026-08-04 16:12:30', '2026-08-04 16:12:30'),
(3, 'CWT003', 'CloudWave Technologies', '789 Jalan Cloud, KLCC, Kuala Lumpur 50450', '03-6666-3333', 5, '2026-08-04 16:12:30', '2026-08-04 16:12:30');

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

--
-- Table structure for table `evaluations`
--

CREATE TABLE `evaluations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED NOT NULL,
  `evaluator_id` bigint(20) UNSIGNED NOT NULL,
  `evaluator_role` enum('company_supervisor','lecturer') NOT NULL,
  `assessment_code` varchar(80) DEFAULT NULL,
  `rubric_template_id` bigint(20) UNSIGNED DEFAULT NULL,
  `rubric_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`rubric_data`)),
  `rubric_snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`rubric_snapshot`)),
  `total_marks` decimal(5,2) DEFAULT NULL,
  `weightage` decimal(5,2) DEFAULT NULL,
  `final_comments` text DEFAULT NULL,
  `attachment_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

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

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

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

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

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

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

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

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

--
-- Table structure for table `logbooks`
--

CREATE TABLE `logbooks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED NOT NULL,
  `entry_type` varchar(255) NOT NULL,
  `date_of_entry` date NOT NULL,
  `activity_description` text NOT NULL,
  `evidence_file_path` varchar(255) DEFAULT NULL,
  `status` enum('pending','reviewed','approved','rejected') NOT NULL DEFAULT 'pending',
  `company_supervisor_comment` text DEFAULT NULL,
  `lecturer_comment` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

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

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2026_05_29_063614_create_companies_table', 1),
(5, '2026_05_29_063854_create_student_profiles_table', 1),
(6, '2026_05_29_063941_create_logbooks_table', 1),
(7, '2026_05_29_064030_create_evaluations_table', 1),
(8, '2026_05_30_000001_add_content_to_student_profiles_table', 1),
(9, '2026_07_27_000000_make_company_supervisor_nullable', 1),
(10, '2026_07_27_000001_replace_duration_with_dates_on_student_profiles', 1),
(11, '2026_07_27_000002_add_attachments_to_logbooks_table', 1),
(12, '2026_07_27_000003_add_attachment_to_evaluations_table', 1),
(13, '2026_07_27_000004_create_settings_table', 1),
(14, '2026_08_03_000001_create_rubric_tables', 1),
(15, '2026_08_04_000001_expand_user_roles_and_constraints', 1),
(16, '2026_08_16_000001_create_student_documents_table', 2),
(17, '2026_08_16_000002_align_official_internship_assessments', 2);

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

--
-- Table structure for table `password_reset_tokens`
--

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

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

--
-- Table structure for table `rubric_items`
--

CREATE TABLE `rubric_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `rubric_template_id` bigint(20) UNSIGNED NOT NULL,
  `criterion` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `max_score` decimal(6,2) NOT NULL DEFAULT 100.00,
  `weight` decimal(6,2) NOT NULL DEFAULT 0.00,
  `sort_order` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rubric_items`
--

INSERT INTO `rubric_items` (`id`, `rubric_template_id`, `criterion`, `description`, `max_score`, `weight`, `sort_order`, `created_at`, `updated_at`) VALUES
(1, 1, 'Attendance and punctuality', NULL, 100.00, 12.50, 1, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(2, 1, 'Professional attitude and ethics', NULL, 100.00, 12.50, 2, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(3, 1, 'Technical knowledge and skills', NULL, 100.00, 12.50, 3, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(4, 1, 'Quality and accuracy of work', NULL, 100.00, 12.50, 4, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(5, 1, 'Initiative and problem-solving', NULL, 100.00, 12.50, 5, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(6, 1, 'Communication skills', NULL, 100.00, 12.50, 6, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(7, 1, 'Teamwork and cooperation', NULL, 100.00, 12.50, 7, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(8, 1, 'Adaptability and willingness to learn', NULL, 100.00, 12.50, 8, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(9, 2, 'Quality of internship report', NULL, 100.00, 20.00, 1, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(10, 2, 'Application of academic knowledge', NULL, 100.00, 20.00, 2, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(11, 2, 'Reflection and critical thinking', NULL, 100.00, 20.00, 3, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(12, 2, 'Presentation and communication', NULL, 100.00, 20.00, 4, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(13, 2, 'Achievement of internship learning outcomes', NULL, 100.00, 20.00, 5, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(14, 3, 'Work Discipline - Punctuality and sense of time', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 0, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(15, 3, 'Work Discipline - Acceptance of duty and responsibility', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 1, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(16, 3, 'Work Discipline - Attitude towards work and people', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 2, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(17, 3, 'Work Discipline - Quality of work', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 3, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(18, 3, 'Technical / Analytical Skills - Logical and analytical skills', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 4, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(19, 3, 'Technical / Analytical Skills - Ability to express and defend ideas', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 5, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(20, 3, 'Technical / Analytical Skills - Willingness to learn new skills', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 6, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(21, 3, 'Leadership Skills - Ability to lead people', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 7, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(22, 3, 'Leadership Skills - Ability to work in group', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 8, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(23, 3, 'Leadership Skills - Initiatives and independence', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 9, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(24, 3, 'Leadership Skills - Dedicated towards work and team', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 10, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(25, 3, 'Personality and Professionalism - Appearance and personality', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 11, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(26, 3, 'Personality and Professionalism - Ethics and confidence', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 12, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(27, 3, 'Personality and Professionalism - Communication with superior', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 13, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(28, 3, 'Personality and Professionalism - Communication with peers and staff', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 14, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(29, 3, 'Communication Skills - Oral', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.88, 15, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(30, 3, 'Communication Skills - Writing', 'Rate 1 (Unsatisfactory) to 5 (Excellent).', 5.00, 5.92, 16, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(31, 4, 'Neatness of daily activity record', NULL, 10.00, 10.00, 0, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(32, 4, 'Update on daily activity record', NULL, 20.00, 20.00, 1, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(33, 4, 'Content - concept, procedure and explanation', 'Concept, procedure and explanation on the system or equipment used.', 50.00, 50.00, 2, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(34, 4, 'Comments from industrial supervisor', NULL, 20.00, 20.00, 3, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(35, 5, 'Internship Project', 'Relevance to BITNS and technical challenge.', 20.00, 40.00, 0, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(36, 5, 'Oral Delivery', 'Clarity, subject knowledge, time management and audience communication.', 20.00, 40.00, 1, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(37, 5, 'Presentation Materials', 'Quality of the materials presented.', 10.00, 20.00, 2, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(38, 6, 'Company / organization background', NULL, 10.00, 10.00, 0, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(39, 6, 'Internship project / task / training', NULL, 50.00, 50.00, 1, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(40, 6, 'Conclusion', NULL, 20.00, 20.00, 2, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(41, 6, 'Clarity (grammar / spelling)', NULL, 10.00, 10.00, 3, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(42, 6, 'Presentation / Structure of Report', NULL, 10.00, 10.00, 4, '2026-08-15 17:34:45', '2026-08-15 17:34:45');

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

--
-- Table structure for table `rubric_templates`
--

CREATE TABLE `rubric_templates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `assessment_code` varchar(80) DEFAULT NULL,
  `evaluator_role` enum('company_supervisor','lecturer') NOT NULL,
  `assessment_weight` decimal(5,2) NOT NULL DEFAULT 0.00,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rubric_templates`
--

INSERT INTO `rubric_templates` (`id`, `name`, `assessment_code`, `evaluator_role`, `assessment_weight`, `description`, `is_active`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'Company Supervisor Evaluation', NULL, 'company_supervisor', 0.00, 'Default workplace performance evaluation rubric.', 0, NULL, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(2, 'Lecturer Evaluation', NULL, 'lecturer', 0.00, 'Default academic internship evaluation rubric.', 0, NULL, '2026-08-04 00:00:56', '2026-08-04 00:00:56'),
(3, 'Industry Supervisor Evaluation', 'industry_supervisor', 'company_supervisor', 30.00, 'Official Industry Supervisor Evaluation Form - 30% of the internship final mark. Raw total: 85 marks.', 1, NULL, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(4, 'Log Book Evaluation', 'log_book', 'lecturer', 15.00, 'Official Industrial Training Log Book Feedback Form - 15% of the internship final mark.', 1, NULL, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(5, 'Presentation Evaluation', 'presentation', 'lecturer', 15.00, 'Official Industrial Training Presentation Evaluation Form - 15% of the internship final mark. Raw total: 50 marks.', 1, NULL, '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(6, 'Internship Report Evaluation', 'report', 'lecturer', 40.00, 'Official Training Report Feedback Form - 40% of the internship final mark.', 1, NULL, '2026-08-15 17:34:45', '2026-08-15 17:34:45');

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

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

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

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `key` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `key`, `value`, `created_at`, `updated_at`) VALUES
(1, 'supervisor_weightage', '30', '2026-08-15 17:34:45', '2026-08-15 17:34:45'),
(2, 'lecturer_weightage', '70', '2026-08-15 17:34:45', '2026-08-15 17:34:45');

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

--
-- Table structure for table `student_documents`
--

CREATE TABLE `student_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED NOT NULL,
  `category` varchar(80) NOT NULL DEFAULT 'Other',
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `original_name` varchar(255) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `mime_type` varchar(150) DEFAULT NULL,
  `file_size` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `student_profiles`
--

CREATE TABLE `student_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `company_id` bigint(20) UNSIGNED DEFAULT NULL,
  `company_supervisor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `lecturer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `internship_start_date` date DEFAULT NULL,
  `internship_end_date` date DEFAULT NULL,
  `extra_information` text DEFAULT NULL,
  `internship_memo` text DEFAULT NULL,
  `internship_memo_path` varchar(255) DEFAULT NULL,
  `internship_rules` text DEFAULT NULL,
  `internship_rules_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `student_profiles`
--

INSERT INTO `student_profiles` (`id`, `user_id`, `company_id`, `company_supervisor_id`, `lecturer_id`, `internship_start_date`, `internship_end_date`, `extra_information`, `internship_memo`, `internship_memo_path`, `internship_rules`, `internship_rules_path`, `created_at`, `updated_at`) VALUES
(1, 9, 1, 3, 6, '2026-07-06', '2026-10-04', 'Test student for development purposes.', NULL, NULL, NULL, NULL, '2026-08-04 16:12:31', '2026-08-04 16:12:31'),
(2, 10, 2, 4, 6, '2026-07-06', '2026-10-04', 'Test student for development purposes.', NULL, NULL, NULL, NULL, '2026-08-04 16:12:31', '2026-08-04 16:12:31');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `contact_number` varchar(255) DEFAULT NULL,
  `staff_or_student_id` varchar(255) DEFAULT NULL,
  `program` varchar(255) DEFAULT NULL,
  `profile_photo_path` varchar(255) DEFAULT NULL,
  `role` enum('superadmin','admin','student','lecturer','company_supervisor') NOT NULL DEFAULT 'student',
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `password`, `contact_number`, `staff_or_student_id`, `program`, `profile_photo_path`, `role`, `email_verified_at`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Super Administrator', 'superadmin@internship.local', '$2y$12$Q2LC3MnzPki0angELW3nA.iv3AXbw.KuBJ0iFJc3zXtN.SximL8Fy', NULL, NULL, NULL, NULL, 'superadmin', NULL, NULL, '2026-08-04 00:00:57', '2026-08-16 03:39:49'),
(2, 'Super Administrator', 'admin@internship.local', '$2y$12$bUgEA30lr38YsYWFsKmboeIb3Pmf2VWi0ioQduTOxDF4UM7Laq4bq', NULL, NULL, NULL, NULL, 'superadmin', '2026-08-04 16:12:29', NULL, '2026-08-04 16:12:29', '2026-08-04 16:12:29'),
(3, 'Ahmad Fadzil', 'supervisor1@test.com', '$2y$12$WAxQ2OLHIZIBFhIDeTGEvOoH0w6ypV5EOTutdY4JzUFdzTd8097nO', '015-5580856', 'SUP001', NULL, NULL, 'company_supervisor', '2026-08-04 16:12:29', NULL, '2026-08-04 16:12:29', '2026-08-16 03:42:35'),
(4, 'Priya Nair', 'supervisor2@test.com', '$2y$12$BHIulRvy/2dDta22.RguwOExIS7RFo0Zunv9UQmHpDA44M0sUj9Aq', '018-3250205', 'SUP002', NULL, NULL, 'company_supervisor', '2026-08-04 16:12:30', NULL, '2026-08-04 16:12:30', '2026-08-16 03:42:55'),
(5, 'James Tan', 'supervisor3@test.com', '$2y$12$LvcXTIOWFcwLcKruTDP5xOWUf5H9hoQpdXvcoXUwIMlJEbVNAJJtS', '012-6301566', 'SUP003', NULL, NULL, 'company_supervisor', '2026-08-04 16:12:30', NULL, '2026-08-04 16:12:30', '2026-08-16 03:42:45'),
(6, 'Dr. Amirah Hassan', 'lecturer1@test.com', '$2y$12$shbQxzbPp/Oboo.J2PM4h.Jc4JxNqLgw58zPmlObJAYbC09CkZaty', '012-3936328', 'LEC001', NULL, NULL, 'lecturer', '2026-08-04 16:12:30', NULL, '2026-08-04 16:12:30', '2026-08-16 03:42:05'),
(7, 'Prof. Ravi Kumar', 'lecturer2@test.com', '$2y$12$eALudCitDYSrEaUvCVmA9.XIGIvHCGBjQKQ452LJNF1BH1a4/foKu', '011-4392510', 'LEC002', NULL, NULL, 'lecturer', '2026-08-04 16:12:31', NULL, '2026-08-04 16:12:31', '2026-08-15 06:09:26'),
(8, 'Dr. Siti Norzahra', 'lecturer3@test.com', '$2y$12$4s4sni0LoR/RXvrMSf4NgenFrITDlzT9bQmCT2nW/e./HlTNkuy92', '018-5832112', 'LEC003', NULL, NULL, 'lecturer', '2026-08-04 16:12:31', NULL, '2026-08-04 16:12:31', '2026-08-16 03:42:16'),
(9, 'Hafiz Izzat', 'student01@test.com', '$2y$12$uRW4xI.qSADAZ7hSi2QJ0uRSUBsHuci.BLaTGvceXEfKKGy4OXYoq', '011-6204946', 'CS2021001', 'Computer Science', NULL, 'student', '2026-08-04 16:12:31', NULL, '2026-08-04 16:12:31', '2026-08-16 03:43:21'),
(10, 'Nur Farhana', 'student02@test.com', '$2y$12$so39yuBPxyvN5mh65doq2u3EsIW3uUPoNKJGZ4.4q/R4GzjoSoHze', '012-6719590', 'CS2021002', 'Computer Science', NULL, 'student', '2026-08-04 16:12:31', NULL, '2026-08-04 16:12:31', '2026-08-16 03:43:32');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_expiration_index` (`expiration`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_locks_expiration_index` (`expiration`);

--
-- Indexes for table `companies`
--
ALTER TABLE `companies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `companies_company_registration_id_unique` (`company_registration_id`),
  ADD UNIQUE KEY `companies_supervisor_user_id_unique` (`supervisor_user_id`);

--
-- Indexes for table `evaluations`
--
ALTER TABLE `evaluations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `evaluations_student_evaluator_unique` (`student_id`,`evaluator_id`),
  ADD KEY `evaluations_evaluator_id_foreign` (`evaluator_id`),
  ADD KEY `evaluations_rubric_template_id_foreign` (`rubric_template_id`),
  ADD KEY `evaluations_student_id_assessment_code_index` (`student_id`,`assessment_code`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

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

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

--
-- Indexes for table `logbooks`
--
ALTER TABLE `logbooks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `logbooks_student_id_foreign` (`student_id`);

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

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indexes for table `rubric_items`
--
ALTER TABLE `rubric_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rubric_items_rubric_template_id_foreign` (`rubric_template_id`);

--
-- Indexes for table `rubric_templates`
--
ALTER TABLE `rubric_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rubric_templates_created_by_foreign` (`created_by`);

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

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `settings_key_unique` (`key`);

--
-- Indexes for table `student_documents`
--
ALTER TABLE `student_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_documents_student_id_category_index` (`student_id`,`category`);

--
-- Indexes for table `student_profiles`
--
ALTER TABLE `student_profiles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `student_profiles_user_id_unique` (`user_id`),
  ADD KEY `student_profiles_company_id_foreign` (`company_id`),
  ADD KEY `student_profiles_company_supervisor_id_foreign` (`company_supervisor_id`),
  ADD KEY `student_profiles_lecturer_id_foreign` (`lecturer_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `companies`
--
ALTER TABLE `companies`
  ADD CONSTRAINT `companies_supervisor_user_id_foreign` FOREIGN KEY (`supervisor_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `evaluations`
--
ALTER TABLE `evaluations`
  ADD CONSTRAINT `evaluations_evaluator_id_foreign` FOREIGN KEY (`evaluator_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `evaluations_rubric_template_id_foreign` FOREIGN KEY (`rubric_template_id`) REFERENCES `rubric_templates` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `evaluations_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `logbooks`
--
ALTER TABLE `logbooks`
  ADD CONSTRAINT `logbooks_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `rubric_items`
--
ALTER TABLE `rubric_items`
  ADD CONSTRAINT `rubric_items_rubric_template_id_foreign` FOREIGN KEY (`rubric_template_id`) REFERENCES `rubric_templates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `rubric_templates`
--
ALTER TABLE `rubric_templates`
  ADD CONSTRAINT `rubric_templates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `student_documents`
--
ALTER TABLE `student_documents`
  ADD CONSTRAINT `student_documents_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `student_profiles`
--
ALTER TABLE `student_profiles`
  ADD CONSTRAINT `student_profiles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_profiles_company_supervisor_id_foreign` FOREIGN KEY (`company_supervisor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_profiles_lecturer_id_foreign` FOREIGN KEY (`lecturer_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

/*!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 */;
