-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 22, 2025 at 04:54 PM
-- Server version: 10.11.14-MariaDB
-- PHP Version: 8.4.11

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: `vertexdev_educato`
--

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

--
-- Table structure for table `active_periods`
--

CREATE TABLE `active_periods` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `period` bigint(20) UNSIGNED DEFAULT NULL,
  `day` bigint(20) UNSIGNED DEFAULT NULL,
  `month` int(11) DEFAULT NULL,
  `year` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `answers`
--

CREATE TABLE `answers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `answer` text DEFAULT NULL,
  `question_id` bigint(20) UNSIGNED DEFAULT NULL,
  `is_correct` tinyint(1) NOT NULL DEFAULT 0,
  `file` varchar(255) DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `answers`
--

INSERT INTO `answers` (`id`, `answer`, `question_id`, `is_correct`, `file`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '<p>الاجابة</p>', 1, 1, NULL, NULL, '2025-07-11 07:43:30', '2025-07-11 07:43:30'),
(2, '<p>الاجابة الاولي مراجعات</p>', 2, 1, NULL, NULL, '2025-07-11 07:44:13', '2025-07-11 07:44:13'),
(3, 'true', 3, 1, NULL, NULL, '2025-07-11 07:45:00', '2025-07-11 07:45:00'),
(4, 'false', 3, 0, NULL, NULL, '2025-07-11 07:45:00', '2025-07-11 07:45:00');

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

--
-- Table structure for table `boxes`
--

CREATE TABLE `boxes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `open` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `boxes`
--

INSERT INTO `boxes` (`id`, `title`, `open`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, '{\"en\":\"Box 1\",\"ar\":\"الصندوق  1\"}', 3, '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL),
(2, '{\"en\":\"Box 2\",\"ar\":\"الصندوق  2\"}', 3, '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL),
(3, '{\"en\":\"Box 3\",\"ar\":\"الصندوق  3\"}', 3, '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL),
(4, '{\"en\":\"Box 4\",\"ar\":\"الصندوق  4\"}', 3, '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL),
(5, '{\"en\":\"Box 5\",\"ar\":\"الصندوق  5\"}', 3, '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL);

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

--
-- Table structure for table `box_answers`
--

CREATE TABLE `box_answers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `question_id` bigint(20) UNSIGNED DEFAULT NULL,
  `answer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `is_correct` tinyint(1) DEFAULT NULL,
  `from_box` int(11) DEFAULT NULL,
  `to_box` int(11) DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `answered_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `box_answers`
--

INSERT INTO `box_answers` (`id`, `question_id`, `answer_id`, `is_correct`, `from_box`, `to_box`, `user_id`, `deleted_at`, `created_at`, `updated_at`, `answered_at`) VALUES
(1, 3, NULL, 0, 1, 1, 3, NULL, '2025-07-25 20:56:34', '2025-07-25 20:56:34', NULL);

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

--
-- Table structure for table `calendars`
--

CREATE TABLE `calendars` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `lesson_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cities`
--

CREATE TABLE `cities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_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 `contacts`
--

CREATE TABLE `contacts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `msg` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contact_reasons`
--

CREATE TABLE `contact_reasons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `image` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `phone_code` varchar(255) DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` (`id`, `title`, `image`, `code`, `phone_code`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"ar\": \"مصر\", \"en\": \"Egypt\"}', NULL, 'eg', '20', NULL, '2025-07-10 20:42:26', '2025-07-10 20:42:26'),
(2, '{\"ar\": \"الكويت\", \"en\": \"Kuwait\"}', NULL, 'kw', '965', NULL, '2025-07-10 20:43:03', '2025-07-10 20:43:03'),
(3, '{\"ar\": \"السعودية\", \"en\": \"Saudi Arabia\"}', NULL, 'sa', '966', NULL, '2025-07-10 20:43:03', '2025-07-10 20:43:03');

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

--
-- Table structure for table `education_systems`
--

CREATE TABLE `education_systems` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `semesters_count` int(11) DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `education_systems`
--

INSERT INTO `education_systems` (`id`, `title`, `semesters_count`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"en\":\"Saudi Arabia system\",\"ar\":\"المسار السعودي\"}', 12, NULL, '2025-07-11 07:31:50', '2025-07-11 07:31:50');

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

--
-- Table structure for table `exams`
--

CREATE TABLE `exams` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `time_per_second` int(11) NOT NULL DEFAULT 10,
  `type` enum('individual','friends') NOT NULL DEFAULT 'individual',
  `user_id_1` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id_2` bigint(20) UNSIGNED DEFAULT NULL,
  `subject_id` bigint(20) UNSIGNED DEFAULT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `grade_id` bigint(20) UNSIGNED DEFAULT NULL,
  `question_num` int(11) NOT NULL DEFAULT 0,
  `status` enum('pending','finished') NOT NULL DEFAULT 'pending',
  `user_1_score` int(11) NOT NULL DEFAULT 0,
  `user_2_score` int(11) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `exams`
--

INSERT INTO `exams` (`id`, `title`, `time_per_second`, `type`, `user_id_1`, `user_id_2`, `subject_id`, `unit_id`, `grade_id`, `question_num`, `status`, `user_1_score`, `user_2_score`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'تتتتت', 10, 'individual', 3, NULL, 1, 1, 1, 1, 'finished', 1, 0, NULL, '2025-07-25 20:59:48', '2025-07-25 20:59:55'),
(2, 'uyyu', 10, 'individual', 3, NULL, 1, 1, 1, 1, 'finished', 0, 0, NULL, '2025-09-25 02:24:29', '2025-09-25 02:24:37');

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

--
-- Table structure for table `exam_questions`
--

CREATE TABLE `exam_questions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `exam_id` bigint(20) UNSIGNED DEFAULT NULL,
  `question_id` bigint(20) UNSIGNED DEFAULT NULL,
  `answer_id_user_1` bigint(20) UNSIGNED DEFAULT NULL,
  `answer_id_user_2` bigint(20) UNSIGNED DEFAULT NULL,
  `user_1_score` int(11) NOT NULL DEFAULT 0,
  `user_2_score` int(11) NOT NULL DEFAULT 0,
  `time` int(11) NOT NULL DEFAULT 1,
  `deleted_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;

--
-- Dumping data for table `exam_questions`
--

INSERT INTO `exam_questions` (`id`, `exam_id`, `question_id`, `answer_id_user_1`, `answer_id_user_2`, `user_1_score`, `user_2_score`, `time`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 3, 3, NULL, 1, 0, 10, NULL, '2025-07-25 20:59:48', '2025-07-25 20:59:54'),
(2, 2, 3, 4, NULL, 0, 0, 10, NULL, '2025-09-25 02:24:29', '2025-09-25 02:24:37');

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

--
-- 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 `faqs`
--

CREATE TABLE `faqs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `question` varchar(255) DEFAULT NULL,
  `answer` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `grades`
--

CREATE TABLE `grades` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `education_system_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `grades`
--

INSERT INTO `grades` (`id`, `title`, `education_system_id`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"en\":\"Grade 1\",\"ar\":\"الصف الاول\"}', 1, NULL, '2025-07-11 07:32:46', '2025-07-11 07:32:46'),
(2, '{\"en\":\"Grade 2\",\"ar\":\"الصف الثاني\"}', 1, NULL, '2025-07-11 07:33:03', '2025-07-11 07:33:03');

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

--
-- Table structure for table `languages`
--

CREATE TABLE `languages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `code` varchar(255) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `languages`
--

INSERT INTO `languages` (`id`, `title`, `code`, `is_default`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"ar\": \"عربي\", \"en\": \"Arabic\"}', 'ar', 0, NULL, '2025-07-13 17:28:26', '2025-07-13 17:28:28'),
(2, '{\"ar\": \"انجليزي\", \"en\": \"English\"}', 'en', 0, NULL, '2025-07-13 17:28:30', '2025-07-13 17:28:32');

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

--
-- Table structure for table `lessons`
--

CREATE TABLE `lessons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `unit_semester_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `lessons`
--

INSERT INTO `lessons` (`id`, `title`, `image`, `unit_semester_id`, `order`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'الدرس الاول', NULL, 1, 0, NULL, '2025-07-11 07:42:35', '2025-07-11 07:42:35');

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

--
-- Table structure for table `media`
--

CREATE TABLE `media` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `uuid` char(36) DEFAULT NULL,
  `collection_name` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `mime_type` varchar(255) DEFAULT NULL,
  `disk` varchar(255) NOT NULL,
  `conversions_disk` varchar(255) DEFAULT NULL,
  `size` bigint(20) UNSIGNED NOT NULL,
  `manipulations` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`manipulations`)),
  `custom_properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`custom_properties`)),
  `generated_conversions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`generated_conversions`)),
  `responsive_images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`responsive_images`)),
  `order_column` int(10) UNSIGNED 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, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2019_08_19_000000_create_failed_jobs_table', 1),
(5, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(6, '2024_04_22_142928_create_education_systems_table', 1),
(7, '2024_04_22_151039_create_languages_table', 1),
(8, '2024_04_22_151458_create_grades_table', 1),
(9, '2024_04_22_153252_create_subjects_table', 1),
(10, '2024_04_22_153253_create_subject_grades_table', 1),
(11, '2024_04_22_154946_create_units_table', 1),
(12, '2024_04_22_160236_create_unit_semesters_table', 1),
(13, '2024_04_22_160719_create_lessons_table', 1),
(14, '2024_04_22_161311_create_questions_table', 1),
(15, '2024_04_22_161830_create_answers_table', 1),
(16, '2024_04_22_162354_create_countries_table', 1),
(17, '2024_04_22_162633_create_cities_table', 1),
(18, '2024_04_28_161810_create_schools_table', 1),
(19, '2024_04_28_161811_add_fields_to_users_table', 1),
(20, '2024_05_19_152456_create_permission_tables', 1),
(21, '2024_05_26_002058_create_exams_table', 1),
(22, '2024_05_28_021217_create_exam_questions_table', 1),
(23, '2024_06_03_144950_add_soft_delete_column_to_roles_table', 1),
(24, '2024_06_04_091906_create_student_parents_table', 1),
(25, '2024_06_04_164544_create_faqs_table', 1),
(26, '2024_06_05_113540_create_settings_table', 1),
(27, '2024_06_09_172451_create_subscriptions_table', 1),
(28, '2024_06_09_172459_create_user_subscriptions_table', 1),
(29, '2024_06_23_130550_create_boxes_table', 1),
(30, '2024_07_05_150644_user_boxes', 1),
(31, '2024_07_05_151155_create_box_answers_table', 1),
(32, '2024_07_06_154450_add_box_start_at_to_users_table', 1),
(33, '2024_07_17_200817_active_periods', 1),
(34, '2024_07_18_101344_create_media_table', 1),
(35, '2024_07_23_114124_create_calendars_table', 1),
(36, '2024_07_26_092604_add_new_columns_to_settings_table', 1),
(37, '2024_07_28_232628_create_contacts_table', 1),
(38, '2024_07_29_004946_add_time_and_date_to_box_answers_table', 1),
(39, '2024_07_29_130809_create_contact_reasons_table', 1),
(40, '2024_08_01_015253_create_notification_templates_table', 1),
(41, '2024_08_01_020007_notifications', 1),
(42, '2024_08_01_042047_add_title_to_notification_templates_table', 1),
(43, '2024_08_01_043741_add_fcm_token_to_users_table', 1),
(44, '2024_08_03_000403_add_type_to_notification_templates', 1),
(45, '2024_08_04_130331_change_email_type_in_users_table', 1),
(46, '2024_08_08_230154_add_group_column_to_notifications_table', 1),
(47, '2024_08_09_003539_add_order_column_to_questions_table', 1),
(48, '2024_08_09_035348_drop_school_id_from_users_table', 1),
(49, '2024_10_20_110825_add_answer_type_to_questions_table', 1);

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

--
-- Table structure for table `model_has_permissions`
--

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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\Models\\User', 1);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `notification_template_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `seen` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `group` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notification_templates`
--

CREATE TABLE `notification_templates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `message` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`message`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `type` enum('general','individual_exam','friends_exam','boxes','subscription','unfinished_exam','leaderboard','calendar') NOT NULL DEFAULT 'general'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notification_templates`
--

INSERT INTO `notification_templates` (`id`, `title`, `message`, `created_at`, `updated_at`, `deleted_at`, `type`) VALUES
(1, '{\"en\":\"Hourly Rate for student usage\",\"ar\":\"عدد ساعات الاستخدام للطالب\"}', '{\"ar\":\"لقد قام الطالب %student باستخدام التطبيق اليوم لمدة %hours ساعات & %minutes دقائق\",\"en\":\"Student %student has used the application for %hours hours & %minutes minutes\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'general'),
(2, '{\"en\":\"individual Exam \",\"ar\":\"اختبار فردي\"}', '{\"ar\":\"تمكن الطالب %student من انهاء اختبار فردي\",\"en\":\"Student %student has finished an individual exam\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'individual_exam'),
(3, '{\"en\":\"Friends Exam \",\"ar\":\"اختبار جماعي\"}', '{\"ar\":\"تمكن الطالب %student من انهاء اختبار جماعي\",\"en\":\"Student %student has finished an friends exam\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'friends_exam'),
(4, '{\"en\":\"Boxes Answers\",\"ar\":\"أجابات الصناديق\"}', '{\"ar\":\"تمكن الطالب %student من اجابة %questions_count سؤال من اسئلة الصناديق المفتوحة اليوم , %correct_count  اجابات صحيحة & %wrong_count  اجابات خاطئة\",\"en\":\"Student %student answered %questions_count questions from the open boxes of today , %correct_count is correct & %wrong_count is wrong\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'boxes'),
(5, '{\"en\":\"Subscription Renewal\",\"ar\":\"تحديث الاشتراك\"}', '{\"ar\":\"سوف يتم انتهاء اشتراكك بعد ٧ أيام\",\"en\":\"Your subscription will be expired after 7 days\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'subscription'),
(6, '{\"en\":\"Unfinished Exams\",\"ar\":\"اختبارات لم تكتمل\"}', '{\"ar\":\"يُرجى ملاحظة أن هناك اختبارًات غير مكتملة. يرجي إكمالها في أقرب وقت ممكن لضمان تحقيق التقدم الأكاديمي\",\"en\":\"Please note that there are unfinished exams. Please complete them as soon as possible to ensure academic progress\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'unfinished_exam'),
(7, '{\"en\":\"%title\",\"ar\":\"%title\"}', '{\"ar\":\"%msg\",\"en\":\"%msg\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'general'),
(8, '{\"en\":\"Top ranked student\",\"ar\":\"الأعلى علي الصف\"}', '{\"ar\":\"تهانينا قام الطالب %student بالوصول الي المركز الأول علي %grade لشهر %month  , استمروا في السعي نحو التميز والإبداع. ترقبوا التحديات القادمة، فقد يكون اسمك هو التالي .\",\"en\":\"Congratulations, %student has reached the first place on %grade for the month of %month, keep striving for excellence and creativity. Stay tuned for the upcoming challenges, your name could be next.\"}', '2025-06-16 18:09:10', '2025-06-16 18:09:10', NULL, 'leaderboard');

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

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `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 `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 `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` 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 `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'home-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(2, 'home-numbers', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(3, 'home-charts', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(4, 'home-table', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(5, 'parents-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(6, 'parents-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(7, 'parents-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(8, 'parents-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(9, 'parents-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(10, 'parents-profile', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(11, 'students-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(12, 'students-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(13, 'students-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(14, 'students-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(15, 'students-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(16, 'students-profile', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(17, 'FAQs-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(18, 'FAQs-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(19, 'FAQs-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(20, 'FAQs-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(21, 'FAQs-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(22, 'settings-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(23, 'settings-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(24, 'settings-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(25, 'settings-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(26, 'settings-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(27, 'education_system-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(28, 'education_system-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(29, 'education_system-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(30, 'education_system-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(31, 'education_system-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(32, 'education_system-profile', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(33, 'grades-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(34, 'grades-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(35, 'grades-create', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(36, 'grades-update', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(37, 'grades-delete', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(38, 'grades-profile', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(39, 'subjects-list', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(40, 'subjects-read', 'web', '2025-06-16 18:09:09', '2025-06-16 18:09:09'),
(41, 'subjects-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(42, 'subjects-update', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(43, 'subjects-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(44, 'subjects-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(45, 'subject_profiles-unit', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(46, 'subject_profiles-studies', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(47, 'subject_profiles-reviews', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(48, 'subject_profiles-questions', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(49, 'admins-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(50, 'admins-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(51, 'admins-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(52, 'admins-update', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(53, 'admins-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(54, 'admins-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(55, 'roles-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(56, 'roles-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(57, 'roles-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(58, 'roles-update', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(59, 'roles-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(60, 'roles-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(61, 'subscriptions-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(62, 'subscriptions-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(63, 'subscriptions-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(64, 'subscriptions-update', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(65, 'subscriptions-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(66, 'subscriptions-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(67, 'boxes-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(68, 'boxes-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(69, 'boxes-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(70, 'boxes-update', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(71, 'boxes-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(72, 'boxes-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(73, 'contact-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(74, 'contact-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(75, 'contact-delete', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(76, 'contact-profile', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(77, 'notifications-list', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(78, 'notifications-read', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10'),
(79, 'notifications-create', 'web', '2025-06-16 18:09:10', '2025-06-16 18:09:10');

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

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `personal_access_tokens`
--

INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `expires_at`, `created_at`, `updated_at`) VALUES
(1, 'App\\Models\\User', 2, 'Laravel', '1798b4ec548a33d22cd7c7c93aa0108948a5594027265cb3e894984a9dd88dfe', '[\"*\"]', '2025-07-13 18:41:49', NULL, '2025-07-10 21:12:45', '2025-07-13 18:41:49'),
(2, 'App\\Models\\User', 3, 'Laravel', '50a8952e79d76212843fe30b2348f28d3e1a1c9ed72c3935043b250e757ed503', '[\"*\"]', '2025-07-12 21:31:36', NULL, '2025-07-12 21:31:05', '2025-07-12 21:31:36'),
(3, 'App\\Models\\User', 3, 'Laravel', 'c45945421bacdb79a6f27b0b8d667c744b4e67ce78fda462bb030991cf0ef311', '[\"*\"]', '2025-10-11 05:16:16', NULL, '2025-07-12 21:31:51', '2025-10-11 05:16:16'),
(4, 'App\\Models\\User', 2, 'Laravel', '403a71bf8cceb0a5ab8b32a9de5f86d28d64c1add2893cbe7e6c0c494155870a', '[\"*\"]', '2025-07-13 17:25:35', NULL, '2025-07-13 17:25:07', '2025-07-13 17:25:35');

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

--
-- Table structure for table `questions`
--

CREATE TABLE `questions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `question` text NOT NULL,
  `type` enum('reviews','notes','q_bank') NOT NULL DEFAULT 'reviews',
  `q_type` enum('mcq','text','TF') NOT NULL DEFAULT 'text',
  `lesson_id` bigint(20) UNSIGNED DEFAULT NULL,
  `unit_semester_id` bigint(20) UNSIGNED DEFAULT NULL,
  `points` int(11) NOT NULL DEFAULT 0,
  `time_per_second` int(11) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 0,
  `answer_type` varchar(255) DEFAULT 'text'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `questions`
--

INSERT INTO `questions` (`id`, `question`, `type`, `q_type`, `lesson_id`, `unit_semester_id`, `points`, `time_per_second`, `deleted_at`, `created_at`, `updated_at`, `order`, `answer_type`) VALUES
(1, 'السؤال الاول؟', 'notes', 'text', 1, 1, 1, 10, NULL, '2025-07-11 07:43:30', '2025-07-11 07:43:30', 0, 'text'),
(2, 'السؤال الاول مراجعات؟', 'reviews', 'text', 1, 1, 1, 10, NULL, '2025-07-11 07:44:13', '2025-07-11 07:44:13', 0, 'text'),
(3, 'سؤال صح او خطأ', 'q_bank', 'TF', NULL, 1, 1, 10, NULL, '2025-07-11 07:45:00', '2025-07-11 07:45:00', 0, 'text');

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Admin', 'web', '2025-06-16 18:13:33', '2025-06-16 18:13:33', NULL);

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

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 1),
(22, 1),
(23, 1),
(24, 1),
(25, 1),
(26, 1),
(27, 1),
(28, 1),
(29, 1),
(30, 1),
(31, 1),
(32, 1),
(33, 1),
(34, 1),
(35, 1),
(36, 1),
(37, 1),
(38, 1),
(39, 1),
(40, 1),
(41, 1),
(42, 1),
(43, 1),
(44, 1),
(45, 1),
(46, 1),
(47, 1),
(48, 1),
(49, 1),
(50, 1),
(51, 1),
(52, 1),
(53, 1),
(54, 1),
(55, 1),
(56, 1),
(57, 1),
(58, 1),
(59, 1),
(60, 1),
(61, 1),
(62, 1),
(63, 1),
(64, 1),
(65, 1),
(66, 1),
(67, 1),
(68, 1),
(69, 1),
(70, 1),
(71, 1),
(72, 1),
(73, 1),
(74, 1),
(75, 1),
(76, 1),
(77, 1),
(78, 1),
(79, 1);

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

--
-- Table structure for table `schools`
--

CREATE TABLE `schools` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `deleted_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 `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `site_title` varchar(255) DEFAULT NULL,
  `site_description` text DEFAULT NULL,
  `site_address` varchar(255) DEFAULT NULL,
  `site_keywords` varchar(255) DEFAULT NULL,
  `site_facebook` varchar(255) DEFAULT NULL,
  `site_x` varchar(255) DEFAULT NULL,
  `site_instagram` varchar(255) DEFAULT NULL,
  `site_ios_link` varchar(255) DEFAULT NULL,
  `site_android_link` varchar(255) DEFAULT NULL,
  `site_google` varchar(255) DEFAULT NULL,
  `google_maps_link` varchar(255) DEFAULT NULL,
  `google_tag_manager_code` varchar(255) DEFAULT NULL,
  `site_logo` varchar(255) DEFAULT NULL,
  `site_username` varchar(255) DEFAULT NULL,
  `site_email` varchar(255) DEFAULT NULL,
  `country_code` varchar(255) DEFAULT NULL,
  `site_phone` varchar(255) DEFAULT NULL,
  `site_password` varchar(255) DEFAULT NULL,
  `site_sender_name` varchar(255) DEFAULT NULL,
  `default_language` varchar(255) DEFAULT NULL,
  `site_server` varchar(255) DEFAULT NULL,
  `site_port` varchar(255) DEFAULT NULL,
  `site_encryption_method` varchar(255) DEFAULT NULL,
  `student_privacy_policy` text DEFAULT NULL,
  `student_terms_conditions` text DEFAULT NULL,
  `parent_privacy_policy` text DEFAULT NULL,
  `parent_terms_conditions` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `student_app_privacy_policy` text DEFAULT NULL,
  `student_app_terms_conditions` text DEFAULT NULL,
  `parent_app_privacy_policy` text DEFAULT NULL,
  `parent_app_terms_conditions` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `student_parents`
--

CREATE TABLE `student_parents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `parent_id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED NOT NULL,
  `status` enum('pending','accepted','cancelled') NOT NULL DEFAULT 'pending',
  `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 `subjects`
--

CREATE TABLE `subjects` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `image` varchar(255) DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `subjects`
--

INSERT INTO `subjects` (`id`, `title`, `image`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"en\":\"اللغة العربية\",\"ar\":\"اللغة العربية\"}', NULL, NULL, '2025-07-11 07:33:25', '2025-07-11 07:33:25');

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

--
-- Table structure for table `subject_grades`
--

CREATE TABLE `subject_grades` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `grade_id` bigint(20) UNSIGNED NOT NULL,
  `subject_id` bigint(20) UNSIGNED NOT NULL,
  `deleted_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;

--
-- Dumping data for table `subject_grades`
--

INSERT INTO `subject_grades` (`id`, `grade_id`, `subject_id`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, '2025-07-11 07:33:25', '2025-07-11 07:33:25'),
(2, 2, 1, NULL, '2025-07-11 07:33:25', '2025-07-11 07:33:25');

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`title`)),
  `months` int(11) NOT NULL DEFAULT 1,
  `shows_to` enum('students','parents') NOT NULL DEFAULT 'students',
  `price` decimal(10,2) NOT NULL,
  `discounted_price` decimal(10,2) NOT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`description`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `deleted_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;

--
-- Dumping data for table `subscriptions`
--

INSERT INTO `subscriptions` (`id`, `title`, `months`, `shows_to`, `price`, `discounted_price`, `description`, `is_active`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '{\"ar\":\"باقة الفصل الدراسي\",\"en\":\"Silver package\"}', 3, 'students', 50.00, 50.00, '{\"en\":\"Debitis eligendi ex doloremque. Culpa eos est ab est. Qui quia adipisci aliquid in doloremque cum temporibus. Voluptas quo assumenda et molestiae eligendi numquam.\",\"ar\":\"Corporis qui esse illum sint. Totam aut voluptas veritatis excepturi a qui. Et voluptas necessitatibus quasi expedita vitae.\"}', 1, NULL, '2025-06-16 18:09:10', '2025-07-14 07:28:47'),
(2, '{\"ar\":\"باقة الفصل الدراسي\",\"en\":\"Silver package\"}', 3, 'parents', 50.00, 50.00, '{\"en\":\"Voluptatum iure quasi ut laudantium et cum. Omnis vitae dicta enim alias veritatis dicta dolor numquam. Aspernatur voluptas dolores nam aliquid quibusdam nobis animi.\",\"ar\":\"Omnis quos et neque architecto ea qui. Occaecati rerum eum voluptatem adipisci ipsam fugit sit. Qui vel a itaque asperiores ea id asperiores veniam. Minus est ipsa amet commodi laudantium at omnis.\"}', 1, NULL, '2025-06-16 18:09:10', '2025-07-14 07:29:49'),
(3, '{\"ar\":\"باقة العام الدراسي\",\"en\":\"Gold package\"}', 12, 'students', 120.00, 200.00, '{\"en\":\"Dolor et facilis omnis sed. Consequuntur reiciendis aliquid esse sit nihil sapiente eaque sapiente. Tempore et distinctio recusandae voluptatem quasi qui quo.\",\"ar\":\"Omnis doloribus laborum dolorem temporibus sapiente. Dolorem porro et at delectus perspiciatis temporibus. Et consequatur voluptatum qui culpa ut quia.\"}', 1, NULL, '2025-06-16 18:09:10', '2025-07-14 07:29:13'),
(4, '{\"ar\":\"باقة العام الدراسي\",\"en\":\"Gold package\"}', 12, 'parents', 120.00, 120.00, '{\"en\":\"Omnis omnis et quod similique sunt ipsam qui. Et repellendus ipsum quaerat nobis. Accusamus molestiae rerum magni aut.\",\"ar\":\"Et expedita id sint tempore est veritatis. Rerum in a consequatur in. Sint corporis quas aliquid voluptatem. Qui et deleniti voluptas est ut. Corrupti vel accusantium similique laudantium nobis enim.\"}', 1, NULL, '2025-06-16 18:09:10', '2025-07-14 07:30:04'),
(5, '{\"en\":\"Testing\",\"ar\":\"باقة تجريبية\"}', 1, 'students', 0.00, 0.00, '{\"en\":\"nice package only for testing\",\"ar\":\"باقة جميله حلوه تجريبيه من غير فلوس\"}', 1, NULL, '2025-07-13 18:10:27', '2025-07-14 07:29:24'),
(6, '{\"en\":\"For Testing\",\"ar\":\"باقة تجريبية\"}', 1, 'parents', 0.00, 0.00, '{\"en\":\"No money , no love , no drugs\",\"ar\":\"من غير فلوس خالص .. خلي يا سعادة البيه\"}', 1, NULL, '2025-07-13 18:11:40', '2025-07-14 07:30:11');

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `subject_id` bigint(20) UNSIGNED DEFAULT NULL,
  `grade_id` bigint(20) UNSIGNED DEFAULT NULL,
  `semester` int(11) DEFAULT NULL,
  `deleted_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;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `title`, `subject_id`, `grade_id`, `semester`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'الاولي', 1, 1, 1, NULL, '2025-07-11 07:42:04', '2025-07-11 07:42:04');

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

--
-- Table structure for table `unit_semesters`
--

CREATE TABLE `unit_semesters` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `unit_semesters`
--

INSERT INTO `unit_semesters` (`id`, `title`, `unit_id`, `order`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'الاول', 1, 0, NULL, '2025-07-11 07:42:04', '2025-07-11 07:42:04'),
(2, 'الثاني', 1, 0, NULL, '2025-07-11 07:42:04', '2025-07-11 07:42:04');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `semester` int(11) DEFAULT NULL,
  `otp` int(11) DEFAULT NULL,
  `password_otp` int(11) DEFAULT NULL,
  `verified` tinyint(1) NOT NULL DEFAULT 0,
  `payment_status` enum('pending','cancelled','accepted') NOT NULL DEFAULT 'pending',
  `school_name` varchar(255) DEFAULT NULL,
  `type` enum('parent','student','admin') NOT NULL DEFAULT 'student',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `grade_id` bigint(20) UNSIGNED DEFAULT NULL,
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `language_id` bigint(20) UNSIGNED DEFAULT NULL,
  `education_system_id` bigint(20) UNSIGNED DEFAULT NULL,
  `country_code` varchar(255) DEFAULT NULL,
  `box_start_at` date DEFAULT NULL,
  `fcm_token` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `name`, `phone`, `email`, `email_verified_at`, `password`, `remember_token`, `avatar`, `semester`, `otp`, `password_otp`, `verified`, `payment_status`, `school_name`, `type`, `deleted_at`, `created_at`, `updated_at`, `grade_id`, `country_id`, `city_id`, `language_id`, `education_system_id`, `country_code`, `box_start_at`, `fcm_token`) VALUES
(1, 'Admin', '1007982551', 'admin@admin.com', NULL, '$2y$10$H8e.OjJCt1i/mG8kbrkQz.Z0HNb7L9JZXmiPxG8UCeaLjTrhFjBn6', NULL, NULL, NULL, NULL, NULL, 1, 'pending', NULL, 'admin', NULL, '2025-06-16 18:11:03', '2025-06-16 18:11:03', NULL, NULL, NULL, NULL, NULL, '965', NULL, NULL),
(2, 'ahmed ramadan', '1112292690', 'deve.ahmedramadan@gmail.com', NULL, '$2y$12$bhM8QyaDLUq5ZcEkBk3T8.2tfui9o794VTY/i5L/owgf4H6lJ6aza', NULL, NULL, 1, NULL, NULL, 1, 'accepted', 'مدرسة', 'student', NULL, '2025-07-10 21:05:28', '2025-07-13 18:06:36', 1, 1, NULL, 1, 1, '20', NULL, 'dLLez69KTfOqi-xXT8NQhj:APA91bFudCLObDA8K-QOk50bAUGPCKT1L-P-jirPIdWSKhc8dtt9khLXWeP96oAtbugjW-5OY1Yw_HB2ukKKs1-7Xzdijvjd9Fyzb_xaoU5ukqt_EJd_h4g'),
(3, 'Ahmed Selim', '1119000897', 'ahmed@aselim.com', NULL, '$2y$12$Y4SB7EeApmomIQLy7pQ0mOlMWRrw8zOrj9kVjzPWB/z0.REgfpK/u', NULL, NULL, 1, NULL, NULL, 1, 'accepted', 'Al Nasr', 'student', NULL, '2025-07-12 21:21:37', '2025-07-25 20:56:34', 1, 1, NULL, 1, 1, '20', '2025-07-25', 'diSsQjkXQyK2kzugf658YU:APA91bHoitQCaWkXOB9P0E2ntZ98vIXG03Fh9d4rlOiw166Xx2TCbWIRmWyrdwxtvSYufH9poFkWWH5JEoDnhym6pdsF_8SULmn36fX4mlIpTsBTU6lnWTo'),
(4, 'test parent', '1145528090', 'test@parent.com', NULL, '$2y$12$COxwP29gzJeuHdlcu3XbFO5WmLBwg8FsCCGC9YtvEfgQ8wO2vljP6', NULL, 'users/1752467224Screenshot 2024-11-26 at 09.01.32.png', NULL, NULL, NULL, 0, 'pending', NULL, 'parent', NULL, '2025-07-14 07:27:05', '2025-07-14 07:27:05', NULL, NULL, NULL, NULL, NULL, '20', NULL, NULL);

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

--
-- Table structure for table `user_boxes`
--

CREATE TABLE `user_boxes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `box_id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED NOT NULL,
  `grade_id` bigint(20) UNSIGNED DEFAULT NULL,
  `semester` int(11) DEFAULT NULL,
  `open` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_boxes`
--

INSERT INTO `user_boxes` (`id`, `box_id`, `student_id`, `grade_id`, `semester`, `open`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 3, 1, 1, 1, '2025-07-25 20:56:34', '2025-10-11 05:16:13', NULL),
(2, 2, 3, 1, 1, 1, '2025-07-25 20:56:34', '2025-10-11 05:16:13', NULL),
(3, 3, 3, 1, 1, 1, '2025-07-25 20:56:34', '2025-10-11 05:16:13', NULL),
(4, 4, 3, 1, 1, 1, '2025-07-25 20:56:34', '2025-10-11 05:16:13', NULL),
(5, 5, 3, 1, 1, 1, '2025-07-25 20:56:34', '2025-10-11 05:16:13', NULL);

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

--
-- Table structure for table `user_subscriptions`
--

CREATE TABLE `user_subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subscription_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` enum('pending','accepted','rejected','expired') NOT NULL DEFAULT 'pending',
  `starts_at` date DEFAULT NULL,
  `ends_at` date DEFAULT NULL,
  `payment_id` varchar(255) DEFAULT NULL,
  `payment_status` enum('pending','completed','not_completed') NOT NULL DEFAULT 'pending',
  `deleted_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;

--
-- Dumping data for table `user_subscriptions`
--

INSERT INTO `user_subscriptions` (`id`, `user_id`, `subscription_id`, `status`, `starts_at`, `ends_at`, `payment_id`, `payment_status`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 2, 1, 'accepted', '2025-07-11', '2025-08-11', NULL, 'completed', NULL, '2025-07-11 07:26:05', '2025-07-11 07:26:05'),
(2, 3, 5, 'expired', '2025-07-14', '2025-08-14', NULL, 'completed', NULL, '2025-07-14 16:53:22', '2025-09-05 01:56:48'),
(3, 3, 5, 'expired', '2025-09-05', '2025-10-05', NULL, 'completed', NULL, '2025-09-05 01:56:51', '2025-10-11 05:15:58'),
(4, 3, 5, 'accepted', '2025-10-11', '2025-11-11', NULL, 'completed', NULL, '2025-10-11 05:16:03', '2025-10-11 05:16:03');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `answers`
--
ALTER TABLE `answers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `answers_question_id_foreign` (`question_id`);

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

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

--
-- Indexes for table `calendars`
--
ALTER TABLE `calendars`
  ADD PRIMARY KEY (`id`),
  ADD KEY `calendars_user_id_foreign` (`user_id`),
  ADD KEY `calendars_lesson_id_foreign` (`lesson_id`);

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cities_country_id_foreign` (`country_id`);

--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contacts_user_id_foreign` (`user_id`);

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

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

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

--
-- Indexes for table `exams`
--
ALTER TABLE `exams`
  ADD PRIMARY KEY (`id`),
  ADD KEY `exams_user_id_1_foreign` (`user_id_1`),
  ADD KEY `exams_user_id_2_foreign` (`user_id_2`),
  ADD KEY `exams_subject_id_foreign` (`subject_id`),
  ADD KEY `exams_unit_id_foreign` (`unit_id`),
  ADD KEY `exams_grade_id_foreign` (`grade_id`);

--
-- Indexes for table `exam_questions`
--
ALTER TABLE `exam_questions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `exam_questions_exam_id_foreign` (`exam_id`),
  ADD KEY `exam_questions_question_id_foreign` (`question_id`),
  ADD KEY `exam_questions_answer_id_user_1_foreign` (`answer_id_user_1`),
  ADD KEY `exam_questions_answer_id_user_2_foreign` (`answer_id_user_2`);

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

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

--
-- Indexes for table `grades`
--
ALTER TABLE `grades`
  ADD PRIMARY KEY (`id`),
  ADD KEY `grades_education_system_id_foreign` (`education_system_id`);

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

--
-- Indexes for table `lessons`
--
ALTER TABLE `lessons`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lessons_unit_semester_id_foreign` (`unit_semester_id`);

--
-- Indexes for table `media`
--
ALTER TABLE `media`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `media_uuid_unique` (`uuid`),
  ADD KEY `media_model_type_model_id_index` (`model_type`,`model_id`),
  ADD KEY `media_order_column_index` (`order_column`);

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

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_notification_template_id_foreign` (`notification_template_id`),
  ADD KEY `notifications_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

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

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);

--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `questions_lesson_id_foreign` (`lesson_id`),
  ADD KEY `questions_unit_semester_id_foreign` (`unit_semester_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

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

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

--
-- Indexes for table `student_parents`
--
ALTER TABLE `student_parents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_parents_parent_id_foreign` (`parent_id`),
  ADD KEY `student_parents_student_id_foreign` (`student_id`);

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

--
-- Indexes for table `subject_grades`
--
ALTER TABLE `subject_grades`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subject_grades_grade_id_foreign` (`grade_id`),
  ADD KEY `subject_grades_subject_id_foreign` (`subject_id`);

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

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`),
  ADD KEY `units_subject_id_foreign` (`subject_id`),
  ADD KEY `units_grade_id_foreign` (`grade_id`);

--
-- Indexes for table `unit_semesters`
--
ALTER TABLE `unit_semesters`
  ADD PRIMARY KEY (`id`),
  ADD KEY `unit_semesters_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `users_grade_id_foreign` (`grade_id`),
  ADD KEY `users_country_id_foreign` (`country_id`),
  ADD KEY `users_city_id_foreign` (`city_id`),
  ADD KEY `users_language_id_foreign` (`language_id`),
  ADD KEY `users_education_system_id_foreign` (`education_system_id`);

--
-- Indexes for table `user_boxes`
--
ALTER TABLE `user_boxes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_boxes_box_id_foreign` (`box_id`),
  ADD KEY `user_boxes_student_id_foreign` (`student_id`),
  ADD KEY `user_boxes_grade_id_foreign` (`grade_id`);

--
-- Indexes for table `user_subscriptions`
--
ALTER TABLE `user_subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_subscriptions_user_id_foreign` (`user_id`),
  ADD KEY `user_subscriptions_subscription_id_foreign` (`subscription_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `media`
--
ALTER TABLE `media`
  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=50;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `answers`
--
ALTER TABLE `answers`
  ADD CONSTRAINT `answers_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `calendars`
--
ALTER TABLE `calendars`
  ADD CONSTRAINT `calendars_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `calendars_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cities`
--
ALTER TABLE `cities`
  ADD CONSTRAINT `cities_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contacts`
--
ALTER TABLE `contacts`
  ADD CONSTRAINT `contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exams`
--
ALTER TABLE `exams`
  ADD CONSTRAINT `exams_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exams_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exams_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exams_user_id_1_foreign` FOREIGN KEY (`user_id_1`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exams_user_id_2_foreign` FOREIGN KEY (`user_id_2`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `exam_questions`
--
ALTER TABLE `exam_questions`
  ADD CONSTRAINT `exam_questions_answer_id_user_1_foreign` FOREIGN KEY (`answer_id_user_1`) REFERENCES `answers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exam_questions_answer_id_user_2_foreign` FOREIGN KEY (`answer_id_user_2`) REFERENCES `answers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exam_questions_exam_id_foreign` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `exam_questions_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `grades`
--
ALTER TABLE `grades`
  ADD CONSTRAINT `grades_education_system_id_foreign` FOREIGN KEY (`education_system_id`) REFERENCES `education_systems` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `lessons`
--
ALTER TABLE `lessons`
  ADD CONSTRAINT `lessons_unit_semester_id_foreign` FOREIGN KEY (`unit_semester_id`) REFERENCES `unit_semesters` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notifications`
--
ALTER TABLE `notifications`
  ADD CONSTRAINT `notifications_notification_template_id_foreign` FOREIGN KEY (`notification_template_id`) REFERENCES `notification_templates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `questions`
--
ALTER TABLE `questions`
  ADD CONSTRAINT `questions_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `questions_unit_semester_id_foreign` FOREIGN KEY (`unit_semester_id`) REFERENCES `unit_semesters` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `student_parents`
--
ALTER TABLE `student_parents`
  ADD CONSTRAINT `student_parents_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_parents_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subject_grades`
--
ALTER TABLE `subject_grades`
  ADD CONSTRAINT `subject_grades_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subject_grades_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `units`
--
ALTER TABLE `units`
  ADD CONSTRAINT `units_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `units_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `unit_semesters`
--
ALTER TABLE `unit_semesters`
  ADD CONSTRAINT `unit_semesters_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_education_system_id_foreign` FOREIGN KEY (`education_system_id`) REFERENCES `education_systems` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `user_boxes`
--
ALTER TABLE `user_boxes`
  ADD CONSTRAINT `user_boxes_box_id_foreign` FOREIGN KEY (`box_id`) REFERENCES `boxes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_boxes_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `user_boxes_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_subscriptions`
--
ALTER TABLE `user_subscriptions`
  ADD CONSTRAINT `user_subscriptions_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `user_subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
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 */;
