tutoring/database/schema/mysql-schema.sql

810 lines
44 KiB
SQL

/*M!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `bookings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `bookings` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`slot_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`student_name` varchar(255) DEFAULT NULL,
`booked_from_page` varchar(255) DEFAULT NULL,
`message` text DEFAULT NULL,
`status` enum('booked','blocked') NOT NULL DEFAULT 'booked',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `bookings_slot_id_date_unique` (`slot_id`,`date`),
CONSTRAINT `bookings_slot_id_foreign` FOREIGN KEY (`slot_id`) REFERENCES `slots` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
`key` varchar(255) NOT NULL,
`value` mediumtext NOT NULL,
`expiration` int(11) NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache_locks` (
`key` varchar(255) NOT NULL,
`owner` varchar(255) NOT NULL,
`expiration` int(11) NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `chapters`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `chapters` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`lesson_section_id` bigint(20) unsigned NOT NULL,
`title` varchar(255) NOT NULL,
`slug` varchar(255) DEFAULT NULL,
`order` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `chapters_slug_unique` (`slug`),
KEY `chapters_lesson_section_id_foreign` (`lesson_section_id`),
CONSTRAINT `chapters_lesson_section_id_foreign` FOREIGN KEY (`lesson_section_id`) REFERENCES `lesson_sections` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`course_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`last_lesson_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `course_user_user_id_foreign` (`user_id`),
KEY `course_user_course_id_foreign` (`course_id`),
KEY `course_user_last_lesson_id_foreign` (`last_lesson_id`),
CONSTRAINT `course_user_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
CONSTRAINT `course_user_last_lesson_id_foreign` FOREIGN KEY (`last_lesson_id`) REFERENCES `lessons` (`id`) ON DELETE SET NULL,
CONSTRAINT `course_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `courses` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`lead_teacher` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`subject_id` bigint(20) unsigned NOT NULL,
`level_id` bigint(20) unsigned NOT NULL,
`slug` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `courses_subject_id_foreign` (`subject_id`),
KEY `courses_level_id_foreign` (`level_id`),
CONSTRAINT `courses_level_id_foreign` FOREIGN KEY (`level_id`) REFERENCES `levels` (`id`) ON DELETE CASCADE,
CONSTRAINT `courses_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `external_busy_windows`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `external_busy_windows` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`external_calendar_id` bigint(20) unsigned NOT NULL,
`starts_at` datetime NOT NULL,
`ends_at` datetime NOT NULL,
`transparency` varchar(255) NOT NULL DEFAULT 'OPAQUE',
`last_seen_at` datetime DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `external_busy_windows_external_calendar_id_starts_at_index` (`external_calendar_id`,`starts_at`),
CONSTRAINT `external_busy_windows_external_calendar_id_foreign` FOREIGN KEY (`external_calendar_id`) REFERENCES `external_calendars` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `external_calendars`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `external_calendars` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`source` varchar(255) NOT NULL DEFAULT 'nextcloud-ics',
`url` text NOT NULL,
`is_enabled` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `failed_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(255) NOT NULL,
`connection` text NOT NULL,
`queue` text NOT NULL,
`payload` longtext NOT NULL,
`exception` longtext NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `features`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `features` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`scope` varchar(255) NOT NULL,
`value` text NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `features_name_scope_unique` (`name`,`scope`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `invoice_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice_items` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`invoice_id` bigint(20) unsigned NOT NULL,
`attendance_id` bigint(20) unsigned NOT NULL,
`description` varchar(255) NOT NULL,
`quantity` int(11) NOT NULL DEFAULT 1,
`unit_price` decimal(8,2) NOT NULL,
`amount` decimal(8,2) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `invoice_items_invoice_id_foreign` (`invoice_id`),
KEY `invoice_items_attendance_id_foreign` (`attendance_id`),
CONSTRAINT `invoice_items_attendance_id_foreign` FOREIGN KEY (`attendance_id`) REFERENCES `lesson_attendances` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `invoices`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoices` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`student_id` bigint(20) unsigned NOT NULL,
`period_start` date NOT NULL,
`period_end` date NOT NULL,
`total` decimal(8,2) NOT NULL DEFAULT 0.00,
`status` varchar(255) NOT NULL DEFAULT 'draft',
`pdf_path` varchar(255) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `invoices_student_id_foreign` (`student_id`),
CONSTRAINT `invoices_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `student_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `job_batches` (
`id` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`total_jobs` int(11) NOT NULL,
`pending_jobs` int(11) NOT NULL,
`failed_jobs` int(11) NOT NULL,
`failed_job_ids` longtext NOT NULL,
`options` mediumtext DEFAULT NULL,
`cancelled_at` int(11) DEFAULT NULL,
`created_at` int(11) NOT NULL,
`finished_at` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`queue` varchar(255) NOT NULL,
`payload` longtext NOT NULL,
`attempts` tinyint(3) unsigned NOT NULL,
`reserved_at` int(10) unsigned DEFAULT NULL,
`available_at` int(10) unsigned NOT NULL,
`created_at` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lesson_attendances`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lesson_attendances` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`teaching_arrangement_id` bigint(20) unsigned NOT NULL,
`student_teacher_subject_id` bigint(20) unsigned NOT NULL,
`scheduled_start` datetime NOT NULL,
`scheduled_end` datetime NOT NULL,
`actual_start` datetime DEFAULT NULL,
`actual_end` datetime DEFAULT NULL,
`week_of_year` tinyint(4) NOT NULL,
`status` enum('attended','cancelled_by_student','cancelled_by_teacher','no_show','rearranged','sick','centre_closed') NOT NULL,
`billable` tinyint(1) NOT NULL DEFAULT 1,
`payable` tinyint(1) NOT NULL DEFAULT 1,
`notes` text DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `lesson_attendance_teaching_arrangement_id_foreign` (`teaching_arrangement_id`),
KEY `lesson_attendance_student_teacher_subject_id_foreign` (`student_teacher_subject_id`),
CONSTRAINT `lesson_attendance_student_teacher_subject_id_foreign` FOREIGN KEY (`student_teacher_subject_id`) REFERENCES `student_teacher_subjects` (`id`) ON DELETE CASCADE,
CONSTRAINT `lesson_attendance_teaching_arrangement_id_foreign` FOREIGN KEY (`teaching_arrangement_id`) REFERENCES `teaching_arrangements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lesson_progress`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lesson_progress` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`lesson_id` bigint(20) unsigned NOT NULL,
`completed` tinyint(1) NOT NULL DEFAULT 0,
`last_viewed_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `lesson_progress_user_id_lesson_id_unique` (`user_id`,`lesson_id`),
KEY `lesson_progress_lesson_id_foreign` (`lesson_id`),
CONSTRAINT `lesson_progress_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE,
CONSTRAINT `lesson_progress_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lesson_questions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lesson_questions` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`lesson_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`question` text NOT NULL,
`answer` text DEFAULT NULL,
`published` tinyint(3) unsigned NOT NULL DEFAULT 0,
`answered_by` bigint(20) unsigned DEFAULT NULL,
`answered_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `lesson_questions_lesson_id_foreign` (`lesson_id`),
KEY `lesson_questions_user_id_foreign` (`user_id`),
KEY `lesson_questions_answered_by_foreign` (`answered_by`),
CONSTRAINT `lesson_questions_answered_by_foreign` FOREIGN KEY (`answered_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
CONSTRAINT `lesson_questions_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE,
CONSTRAINT `lesson_questions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lesson_sections`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lesson_sections` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`module_id` bigint(20) unsigned NOT NULL,
`title` varchar(255) NOT NULL DEFAULT 'Year',
`slug` varchar(255) DEFAULT NULL,
`year` tinyint(3) unsigned DEFAULT NULL,
`order` int(10) unsigned NOT NULL DEFAULT 0,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `lesson_sections_slug_unique` (`slug`),
KEY `lesson_sections_module_id_foreign` (`module_id`),
CONSTRAINT `lesson_sections_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lesson_videos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lesson_videos` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`lesson_id` bigint(20) unsigned NOT NULL,
`title` varchar(255) NOT NULL,
`video_url` varchar(255) NOT NULL,
`order` int(11) NOT NULL DEFAULT 0,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `lesson_videos_lesson_id_foreign` (`lesson_id`),
CONSTRAINT `lesson_videos_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `lessons`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `lessons` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`order` int(10) unsigned NOT NULL DEFAULT 0,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`chapter_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `lessons_slug_unique` (`slug`),
KEY `lessons_chapter_id_foreign` (`chapter_id`),
CONSTRAINT `lessons_chapter_id_foreign` FOREIGN KEY (`chapter_id`) REFERENCES `chapters` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `level_subject_teacher`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `level_subject_teacher` (
`teacher_profile_id` bigint(20) unsigned NOT NULL,
`subject_id` bigint(20) unsigned NOT NULL,
`level_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`teacher_profile_id`,`subject_id`,`level_id`),
KEY `level_subject_teacher_subject_id_foreign` (`subject_id`),
KEY `level_subject_teacher_level_id_foreign` (`level_id`),
CONSTRAINT `level_subject_teacher_level_id_foreign` FOREIGN KEY (`level_id`) REFERENCES `levels` (`id`) ON DELETE CASCADE,
CONSTRAINT `level_subject_teacher_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
CONSTRAINT `level_subject_teacher_teacher_profile_id_foreign` FOREIGN KEY (`teacher_profile_id`) REFERENCES `teacher_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `levels`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `levels` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `levels_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `locations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `locations` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`location_name` varchar(255) NOT NULL,
`has_smartboard` tinyint(1) NOT NULL DEFAULT 0,
`has_whiteboard` tinyint(1) NOT NULL DEFAULT 0,
`has_projector` tinyint(1) NOT NULL DEFAULT 0,
`has_computer` tinyint(1) NOT NULL DEFAULT 0,
`has_video_conferencing` tinyint(1) NOT NULL DEFAULT 0,
`computer_quantity` tinyint(4) 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 */;
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `model_has_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `model_has_permissions` (
`permission_id` bigint(20) unsigned NOT NULL,
`model_type` varchar(255) NOT NULL,
`model_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `model_has_roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `model_has_roles` (
`role_id` bigint(20) unsigned NOT NULL,
`model_type` varchar(255) NOT NULL,
`model_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`role_id`,`model_id`,`model_type`),
KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `modules`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `modules` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`course_id` bigint(20) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`order` int(10) unsigned NOT NULL DEFAULT 0,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `modules_course_id_foreign` (`course_id`),
CONSTRAINT `modules_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset_tokens` (
`email` varchar(255) NOT NULL,
`token` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`guard_name` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `role_has_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `role_has_permissions` (
`permission_id` bigint(20) unsigned NOT NULL,
`role_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`permission_id`,`role_id`),
KEY `role_has_permissions_role_id_foreign` (`role_id`),
CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`guard_name` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `sessions` (
`id` varchar(255) NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`ip_address` varchar(45) DEFAULT NULL,
`user_agent` text DEFAULT NULL,
`payload` longtext NOT NULL,
`last_activity` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `sessions_user_id_index` (`user_id`),
KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `slots`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `slots` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`weekday` tinyint(3) unsigned NOT NULL,
`time` time NOT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `student_profiles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_profiles` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`parent_id` bigint(20) unsigned DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`notes` text DEFAULT NULL,
`sen_notes` text DEFAULT NULL,
`year_group` varchar(255) DEFAULT NULL,
`has_dyslexia` tinyint(1) NOT NULL DEFAULT 0,
`has_dyspraxia` tinyint(1) NOT NULL DEFAULT 0,
`has_autism` tinyint(1) NOT NULL DEFAULT 0,
`has_adhd` tinyint(1) NOT NULL DEFAULT 0,
`has_speech_needs` tinyint(1) NOT NULL DEFAULT 0,
`student_type_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `student_profiles_student_type_id_foreign` (`student_type_id`),
CONSTRAINT `student_profiles_student_type_id_foreign` FOREIGN KEY (`student_type_id`) REFERENCES `student_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `student_teacher_subjects`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_teacher_subjects` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`student_id` bigint(20) unsigned NOT NULL,
`teacher_id` bigint(20) unsigned NOT NULL,
`subject_id` bigint(20) unsigned NOT NULL,
`rate_override` decimal(8,2) DEFAULT NULL,
`status` varchar(255) NOT NULL DEFAULT 'active',
`notes` text DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `student_teacher_subject_student_id_foreign` (`student_id`),
KEY `student_teacher_subject_teacher_id_foreign` (`teacher_id`),
KEY `student_teacher_subject_subject_id_foreign` (`subject_id`),
CONSTRAINT `student_teacher_subject_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `student_profiles` (`id`) ON DELETE CASCADE,
CONSTRAINT `student_teacher_subject_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
CONSTRAINT `student_teacher_subject_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `teacher_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `student_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_types` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `student_types_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `subjects`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `subjects` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`slug` varchar(255) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `subjects_name_unique` (`name`),
UNIQUE KEY `subjects_slug_unique` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teacher_pay_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teacher_pay_items` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`teacher_pay_period_id` bigint(20) unsigned NOT NULL,
`attendance_id` bigint(20) unsigned NOT NULL,
`hours` decimal(5,2) NOT NULL,
`rate` decimal(8,2) NOT NULL,
`total` decimal(8,2) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `teacher_pay_items_teacher_pay_period_id_foreign` (`teacher_pay_period_id`),
KEY `teacher_pay_items_attendance_id_foreign` (`attendance_id`),
CONSTRAINT `teacher_pay_items_attendance_id_foreign` FOREIGN KEY (`attendance_id`) REFERENCES `lesson_attendances` (`id`) ON DELETE CASCADE,
CONSTRAINT `teacher_pay_items_teacher_pay_period_id_foreign` FOREIGN KEY (`teacher_pay_period_id`) REFERENCES `teacher_pay_periods` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teacher_pay_periods`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teacher_pay_periods` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`teacher_id` bigint(20) unsigned NOT NULL,
`period_start` date NOT NULL,
`period_end` date NOT NULL,
`total` decimal(8,2) NOT NULL DEFAULT 0.00,
`status` varchar(255) NOT NULL DEFAULT 'draft',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `teacher_pay_periods_teacher_id_foreign` (`teacher_id`),
CONSTRAINT `teacher_pay_periods_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `teacher_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teacher_profiles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teacher_profiles` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`ics_token` varchar(64) DEFAULT NULL,
`bio` text DEFAULT NULL,
`qualifications` text DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT 1,
`picture` varchar(255) DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`hourly_rate` decimal(8,2) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `teacher_profiles_user_id_unique` (`user_id`),
UNIQUE KEY `teacher_profiles_ics_token_unique` (`ics_token`),
CONSTRAINT `teacher_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 */;
DROP TABLE IF EXISTS `teaching_arrangement_students`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teaching_arrangement_students` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`teaching_arrangement_id` bigint(20) unsigned NOT NULL,
`student_teacher_subject_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `teaching_arrangement_students_teaching_arrangement_id_foreign` (`teaching_arrangement_id`),
KEY `teaching_arrangement_students_student_teacher_subject_id_foreign` (`student_teacher_subject_id`),
CONSTRAINT `teaching_arrangement_students_student_teacher_subject_id_foreign` FOREIGN KEY (`student_teacher_subject_id`) REFERENCES `student_teacher_subjects` (`id`) ON DELETE CASCADE,
CONSTRAINT `teaching_arrangement_students_teaching_arrangement_id_foreign` FOREIGN KEY (`teaching_arrangement_id`) REFERENCES `teaching_arrangements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `teaching_arrangements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teaching_arrangements` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`teacher_id` bigint(20) unsigned NOT NULL,
`subject_id` bigint(20) unsigned NOT NULL,
`location_id` bigint(20) unsigned DEFAULT NULL,
`weekday` tinyint(4) NOT NULL,
`start_time` time NOT NULL,
`duration_minutes` int(11) NOT NULL,
`is_group` tinyint(1) NOT NULL DEFAULT 0,
`max_students` int(11) DEFAULT NULL,
`fee_policy` varchar(255) NOT NULL DEFAULT 'normal',
`active` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `teaching_arrangements_teacher_id_foreign` (`teacher_id`),
KEY `teaching_arrangements_subject_id_foreign` (`subject_id`),
KEY `teaching_arrangements_location_id_foreign` (`location_id`),
CONSTRAINT `teaching_arrangements_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE SET NULL,
CONSTRAINT `teaching_arrangements_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
CONSTRAINT `teaching_arrangements_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `teacher_profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_entries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_entries` (
`sequence` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) NOT NULL,
`batch_id` char(36) NOT NULL,
`family_hash` varchar(255) DEFAULT NULL,
`should_display_on_index` tinyint(1) NOT NULL DEFAULT 1,
`type` varchar(20) NOT NULL,
`content` longtext NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`sequence`),
UNIQUE KEY `telescope_entries_uuid_unique` (`uuid`),
KEY `telescope_entries_batch_id_index` (`batch_id`),
KEY `telescope_entries_family_hash_index` (`family_hash`),
KEY `telescope_entries_created_at_index` (`created_at`),
KEY `telescope_entries_type_should_display_on_index_index` (`type`,`should_display_on_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_entries_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_entries_tags` (
`entry_uuid` char(36) NOT NULL,
`tag` varchar(255) NOT NULL,
PRIMARY KEY (`entry_uuid`,`tag`),
KEY `telescope_entries_tags_tag_index` (`tag`),
CONSTRAINT `telescope_entries_tags_entry_uuid_foreign` FOREIGN KEY (`entry_uuid`) REFERENCES `telescope_entries` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `telescope_monitoring`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `telescope_monitoring` (
`tag` varchar(255) NOT NULL,
PRIMARY KEY (`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) NOT NULL,
`remember_token` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*M!999999\- enable the sandbox mode */
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'0001_01_01_000000_create_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'0001_01_01_000001_create_cache_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'0001_01_01_000002_create_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2025_09_09_203821_create_permission_tables',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2025_09_09_204352_create_features_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2025_09_09_204411_create_telescope_entries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2025_09_10_000801_create_courses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2025_09_10_145118_add_role_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2025_09_11_000940_alter_role_default_on_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2025_09_11_010334_remove_role_column_from_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2025_09_11_103252_create_teacher_profiles_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2025_09_11_103255_create_subjects_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2025_09_11_103258_create_levels_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2025_09_11_103301_create_level_subject_teacher_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2025_09_12_105011_update_courses_table_with_subject_and_level',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2025_09_12_141116_remove_title_from_courses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2025_09_12_141321_remove_title_from_courses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2025_09_12_141441_remove_title_from_courses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2025_09_12_145930_update_courses_table_lead_teacher_to_foreign',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2025_09_20_201133_create_modules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2025_09_20_201137_create_lesson_sections_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2025_09_20_201139_create_lessons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2025_09_21_000855_create_chapters_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2025_09_25_001309_create_lesson_videos_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2025_09_25_004727_remove_video_url_from_lessons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2025_09_26_204754_create_slots_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2025_09_26_204848_create_bookings_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2025_09_26_223715_remove_lesson_section_id_from_lessons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (29,'2025_09_27_012432_create_course_user_table',2);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (30,'2025_09_27_013114_drop_course_user_table',3);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (31,'2025_09_27_013231_drop_course_user_table',3);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (32,'2025_09_27_013420_create_course_user_table',4);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (33,'2025_09_27_174930_add_unique_index_to_lessons_slug',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (34,'2025_10_18_211737_add_ics_token_to_teacher_profiles_table',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (35,'2025_10_19_172321_create_external_calendars_table',6);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (36,'2025_10_19_172325_create_external_busy_windows_table',6);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (37,'2025_11_08_232702_create_lesson_progress_table',7);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (38,'2025_11_09_014447_add_last_lesson_id_to_course_user_table',8);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (39,'2025_11_09_155159_add_slug_to_courses_table',8);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (40,'2025_11_10_230040_create_lesson_questions_table',9);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (41,'2025_11_11_111954_add_published_to_lesson_questions_table',10);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (42,'2025_11_13_124055_add_slug_to_chapters_table',11);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (43,'2025_11_20_134212_add_slug_to_lesson_sections_table',12);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (45,'2025_11_27_155927_add_slug_to_subjects_table',13);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (46,'2025_11_27_164103_create_student_profiles_table',13);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (47,'2025_11_27_164305_create_student_teacher_subject_table',14);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (48,'2025_11_27_214652_create_locations_table',15);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (49,'2025_11_27_214822_create_teaching_arrangements_table',16);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (50,'2025_11_27_215054_create_teaching_arrangement_students_table',17);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (51,'2025_11_27_215302_create_lesson_attendance_table',18);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (52,'2025_11_27_220103_update_teacher_profiles_add_qualifications_and_active',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (53,'2025_11_27_220335_create_invoices_table',20);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (54,'2025_11_27_220429_create_invoice_items_table',21);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (55,'2025_11_27_220532_create_teacher_pay_periods_table',22);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (56,'2025_11_27_220613_create_teacher_pay_items_table',23);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (57,'2025_11_29_210900_create_student_types_table',24);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (58,'2025_11_29_211113_add_student_type_id_to_student_profiles',24);