-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 13, 2026 at 04:06 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `farzad`
--

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

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `id` bigint(20) UNSIGNED 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 `admins`
--

INSERT INTO `admins` (`id`, `created_at`, `updated_at`) VALUES
(1, '2026-06-06 04:27:22', '2026-06-06 04:27:22');

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

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

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

--
-- Dumping data for table `cache`
--

INSERT INTO `cache` (`key`, `value`, `expiration`) VALUES
('laravel-cache-d189a3df25facd3522214377f5876bcb', 'i:1;', 1780843192),
('laravel-cache-d189a3df25facd3522214377f5876bcb:timer', 'i:1780843192;', 1780843192),
('laravel-cache-d2bfa8e8b749d2772a21edee7b70a2b3', 'i:2;', 1780896026),
('laravel-cache-d2bfa8e8b749d2772a21edee7b70a2b3:timer', 'i:1780896026;', 1780896026),
('laravel-cache-e9b6cc1432541b9ceebf113eee05eeba', 'i:1;', 1780842525),
('laravel-cache-e9b6cc1432541b9ceebf113eee05eeba:timer', 'i:1780842525;', 1780842525),
('laravel-cache-f1f70ec40aaa556905d4a030501c0ba4', 'i:2;', 1780843141),
('laravel-cache-f1f70ec40aaa556905d4a030501c0ba4:timer', 'i:1780843141;', 1780843141);

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

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

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

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

--
-- Table structure for table `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 `folders`
--

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

CREATE TABLE `institutes` (
  `id` bigint(20) UNSIGNED 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 `institutes`
--

INSERT INTO `institutes` (`id`, `created_at`, `updated_at`) VALUES
(1, '2026-06-07 11:00:18', '2026-06-07 11:00:18');

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

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

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

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

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

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

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

--
-- Table structure for table `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
(50, '0001_01_01_000000_create_users_table', 1),
(51, '0001_01_01_000001_create_cache_table', 1),
(52, '0001_01_01_000002_create_jobs_table', 1),
(53, '2026_06_01_171856_create_personal_access_tokens_table', 1),
(56, '2026_06_06_052038_create_institutes_table', 1),
(57, '2026_06_06_052513_create_supervisors_table', 1),
(58, '2026_06_06_053951_create_supporters_table', 1),
(59, '2026_06_06_061731_create_admins_table', 1),
(63, '2026_06_04_131852_create_plans_table', 2),
(66, '2026_06_13_133103_create_folders_table', 4),
(67, '2026_06_03_142917_create_students_table', 5);

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

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

CREATE TABLE `password_reset_tokens` (
  `phone` 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 `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` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) 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
(6, 'App\\Models\\User', 2, 'api-token', '916b0f67d0caffe2a17a06557c75864b372047845cf85ae70685a0915c3215ad', '[\"*\"]', '2026-06-07 10:57:45', NULL, '2026-06-07 10:26:18', '2026-06-07 10:57:45'),
(7, 'App\\Models\\User', 3, 'api-token', '7ee6ae9650e1b19d071f1af610a5f53f8b254fb1cd77407a6a8cee7d5b050c59', '[\"*\"]', NULL, NULL, '2026-06-07 11:00:19', '2026-06-07 11:00:19'),
(8, 'App\\Models\\User', 1, 'api-token', '1ecbc1bfe999f782617a4ef1a92867962dde3d343e38f7018b55d597bcd0170c', '[\"*\"]', '2026-06-07 11:08:21', NULL, '2026-06-07 11:01:07', '2026-06-07 11:08:21'),
(9, 'App\\Models\\User', 3, 'api-token', '4ca304ceff9c4a65e440ba8071a8aff8ec6b69d7a270968488b29098f4a422ee', '[\"*\"]', '2026-06-08 01:50:13', NULL, '2026-06-07 11:08:53', '2026-06-08 01:50:13');

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

--
-- Table structure for table `plans`
--

CREATE TABLE `plans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `dayLabels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`dayLabels`)),
  `partLabels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`partLabels`)),
  `grid` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`grid`)),
  `supporter_id` bigint(20) UNSIGNED NOT NULL,
  `student_id` bigint(20) UNSIGNED 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 `plans`
--

INSERT INTO `plans` (`id`, `name`, `dayLabels`, `partLabels`, `grid`, `supporter_id`, `student_id`, `created_at`, `updated_at`) VALUES
(1, 'plan 1', '[]', '[]', '[]', 1, 1, '2026-06-07 10:43:37', '2026-06-07 10:43:37'),
(2, 'my plan', '[]', '[]', '[]', 1, 1, '2026-06-07 10:52:07', '2026-06-07 10:52:07');

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

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

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

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('En0U4C6UhYtPx3gQjojIsRWkqBuWJ2vp780Ewxnk', 3, '::1', 'PostmanRuntime/7.15.2', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiV0x0YjVwR0M2WURpbGJlck51S1lKczZua0hXb1AweVoxMmpvanJGaCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTg6Imh0dHA6Ly9sb2NhbGhvc3QvZmFyemFkL3B1YmxpYy9hcGkvaW5zdGl0dXRlL3N1cGVydmlzb3JzLzEiO3M6NToicm91dGUiO3M6MTY6InN1cGVydmlzb3JzLnNob3ciO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1780844987),
('fYVTZyXgJZESrwFY8zNhaopSTV0zzpXA0FHlH0oN', 3, '::1', 'PostmanRuntime/7.15.2', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiV1c2Z3h4MldNR1NyU2VEMDRxM2hoa28xRjY2alZvczhLalUxM0FNVSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTY6Imh0dHA6Ly9sb2NhbGhvc3QvZmFyemFkL3B1YmxpYy9hcGkvaW5zdGl0dXRlL3N1cGVydmlzb3JzIjtzOjU6InJvdXRlIjtzOjE3OiJzdXBlcnZpc29ycy5pbmRleCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1780896013),
('UjTny6DTTyAqYdhDAhFvzcSWVaEcB1nP78nlDUQl', 1, '::1', 'PostmanRuntime/7.15.2', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoidlpBUnhSREtxNWNOMnB5cE9ZQmE2ZHo1aVZOMGJBODRabGlQY2J2YiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9sb2NhbGhvc3QvZmFyemFkL3B1YmxpYy9hcGkvYWRtaW4iO3M6NToicm91dGUiO047fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1780732691);

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

--
-- Table structure for table `students`
--

CREATE TABLE `students` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `grade` int(11) NOT NULL,
  `field` varchar(255) NOT NULL,
  `gender` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `parent_phone` varchar(255) NOT NULL,
  `notes` text NOT NULL DEFAULT '',
  `supporter_id` bigint(20) UNSIGNED NOT NULL,
  `folder_id` bigint(20) UNSIGNED DEFAULT NULL,
  `active_plan_id` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `supervisors`
--

CREATE TABLE `supervisors` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `institute_id` bigint(20) UNSIGNED 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 `supervisors`
--

INSERT INTO `supervisors` (`id`, `institute_id`, `created_at`, `updated_at`) VALUES
(1, 1, '2026-06-07 11:19:28', '2026-06-07 11:19:28'),
(2, 1, '2026-06-08 01:30:45', '2026-06-08 01:30:45');

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

--
-- Table structure for table `supporters`
--

CREATE TABLE `supporters` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `theme` varchar(255) NOT NULL DEFAULT 'light',
  `supervisor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `institute_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supporters`
--

INSERT INTO `supporters` (`id`, `theme`, `supervisor_id`, `institute_id`, `created_at`, `updated_at`) VALUES
(1, 'light', NULL, NULL, '2026-06-07 08:59:38', '2026-06-07 08:59:38'),
(2, 'light', NULL, 1, '2026-06-07 11:17:10', '2026-06-07 11:17:10'),
(4, 'light', 2, NULL, '2026-06-08 01:33:35', '2026-06-08 01:33:35'),
(5, 'light', 2, NULL, '2026-06-08 01:37:40', '2026-06-08 01:37:40'),
(6, 'light', 2, 1, '2026-06-08 01:40:42', '2026-06-08 01:40:42');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `expire_time` timestamp NULL DEFAULT NULL,
  `subscription_type` varchar(255) DEFAULT NULL,
  `userable_type` varchar(255) NOT NULL,
  `userable_id` bigint(20) UNSIGNED NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `name`, `phone`, `password`, `expire_time`, `subscription_type`, `userable_type`, `userable_id`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'farzad', '09039202535', '$2y$12$km0oNz.ILVDzxi/C4v5hv.nhpTwflKEF8MhccmXGY6r/5e7GigLdK', NULL, NULL, 'App\\Models\\Admin', 1, NULL, '2026-06-06 04:27:23', '2026-06-06 04:27:23'),
(2, 'ابوالفضل', '09026262156', '$2y$12$L32Naay0IS/OyOq7fIDdTedOw2Utms0UEU5qNg4AemxPiXTdQPqfS', '2026-07-07 10:12:06', 'pro', 'App\\Models\\Supporter', 1, NULL, '2026-06-07 08:59:39', '2026-06-07 10:12:06'),
(3, 'jahad', '09917341571', '$2y$12$6WsQPjxSaaMYp2EoUlvqSeaXtvgY8ugVftCTJzr4muvkN6NbmNdqq', '2026-07-07 11:08:01', 'pro', 'App\\Models\\Institute', 1, NULL, '2026-06-07 11:00:19', '2026-06-07 11:08:01'),
(4, 'ali', '09158337110', '$2y$12$htdcVYxpoMcMCjPl/EaA.O0SW05MUuJcnwsdVfF5gz2WRNcS9fk/C', NULL, NULL, 'App\\Models\\Supporter', 2, NULL, '2026-06-07 11:17:10', '2026-06-07 11:17:10'),
(5, 'hossein', '09147856894', '$2y$12$/AO0CMrdgtlUNg/PE.ILOOgrxJ.V3/TeqwXEbIVk1fBef/OJXhypW', NULL, NULL, 'App\\Models\\Supervisor', 1, NULL, '2026-06-07 11:19:29', '2026-06-07 11:19:29'),
(6, 'new supervisor', '09036362514', '$2y$12$fcRT3LcdO.PC9CQKDS8FkerXFtbZzryzFav63yodFaUKLn8AZJgz2', '2026-07-07 11:08:01', 'pro', 'App\\Models\\Supervisor', 2, NULL, '2026-06-08 01:30:46', '2026-06-08 01:30:46'),
(7, 'new supporter', '09036362525', '$2y$12$/js8Sx9UU36JFVKwwiI0g.QssKlS5Y/Kf3sLCBpGpxaKXL.VfWCy6', '2026-07-07 11:08:01', 'pro', 'App\\Models\\Supporter', 4, NULL, '2026-06-08 01:33:35', '2026-06-08 01:33:35'),
(8, 'my supporter', '09036251496', '$2y$12$7yXIUGqkjg3jW1iXegUsbuSuqnrxEFNV/rBrM/ZKaiTHxZMYH71/K', '2026-07-07 11:08:01', 'pro', 'App\\Models\\Supporter', 5, NULL, '2026-06-08 01:37:41', '2026-06-08 01:37:41'),
(9, 'mamad', '09085749641', '$2y$12$7l3LelnBWmaI8ik0xOEDnepn6F4qtr0KykzE1MgRqy4ltbeOMfice', '2026-07-07 11:08:01', 'pro', 'App\\Models\\Supporter', 6, NULL, '2026-06-08 01:40:42', '2026-06-08 01:40:42');

--
-- Indexes for dumped tables
--

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

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

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

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

--
-- Indexes for table `folders`
--
ALTER TABLE `folders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `folders_supporter_id_foreign` (`supporter_id`);

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

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

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

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

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

--
-- 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`),
  ADD KEY `personal_access_tokens_expires_at_index` (`expires_at`);

--
-- Indexes for table `plans`
--
ALTER TABLE `plans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `plans_supporter_id_foreign` (`supporter_id`),
  ADD KEY `plans_student_id_foreign` (`student_id`);

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

--
-- Indexes for table `students`
--
ALTER TABLE `students`
  ADD PRIMARY KEY (`id`),
  ADD KEY `students_supporter_id_foreign` (`supporter_id`),
  ADD KEY `students_folder_id_foreign` (`folder_id`);

--
-- Indexes for table `supervisors`
--
ALTER TABLE `supervisors`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supervisors_institute_id_foreign` (`institute_id`);

--
-- Indexes for table `supporters`
--
ALTER TABLE `supporters`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supporters_supervisor_id_foreign` (`supervisor_id`),
  ADD KEY `supporters_institute_id_foreign` (`institute_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_phone_unique` (`phone`),
  ADD KEY `users_userable_type_userable_id_index` (`userable_type`,`userable_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `folders`
--
ALTER TABLE `folders`
  ADD CONSTRAINT `folders_supporter_id_foreign` FOREIGN KEY (`supporter_id`) REFERENCES `supporters` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `plans`
--
ALTER TABLE `plans`
  ADD CONSTRAINT `plans_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `plans_supporter_id_foreign` FOREIGN KEY (`supporter_id`) REFERENCES `supporters` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `students`
--
ALTER TABLE `students`
  ADD CONSTRAINT `students_folder_id_foreign` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `students_supporter_id_foreign` FOREIGN KEY (`supporter_id`) REFERENCES `supporters` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supervisors`
--
ALTER TABLE `supervisors`
  ADD CONSTRAINT `supervisors_institute_id_foreign` FOREIGN KEY (`institute_id`) REFERENCES `institutes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supporters`
--
ALTER TABLE `supporters`
  ADD CONSTRAINT `supporters_institute_id_foreign` FOREIGN KEY (`institute_id`) REFERENCES `institutes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `supporters_supervisor_id_foreign` FOREIGN KEY (`supervisor_id`) REFERENCES `supervisors` (`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 */;
