-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `carekori`
--

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

--
-- Table structure for table `add_banners`
--

CREATE TABLE `add_banners` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `add_image` varchar(255) NOT NULL,
  `add_for` varchar(255) DEFAULT NULL,
  `add_type` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `appointments`
--

CREATE TABLE `appointments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `provider_id` bigint(20) UNSIGNED NOT NULL,
  `status` enum('pending','confirmed','completed','cancelled') NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `appointment_time` datetime 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 `appointment_slots`
--

CREATE TABLE `appointment_slots` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `availability_id` bigint(20) UNSIGNED NOT NULL,
  `slot_time` time NOT NULL,
  `is_booked` tinyint(1) 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 `common_profiles`
--

CREATE TABLE `common_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `bio` text DEFAULT NULL,
  `pricing` decimal(8,2) DEFAULT NULL,
  `availability` tinyint(1) NOT NULL DEFAULT 0,
  `avatar` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `thana` varchar(255) DEFAULT NULL,
  `identification_no` varchar(255) NOT NULL COMMENT 'nid, passport',
  `active_from` time DEFAULT NULL,
  `active_to` time DEFAULT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `common_speciality_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `common_provider_specialities`
--

CREATE TABLE `common_provider_specialities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `specialized_at` varchar(255) NOT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_profiles`
--

CREATE TABLE `customer_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `gender` varchar(255) NOT NULL,
  `dob` date NOT NULL,
  `district` varchar(255) NOT NULL,
  `sub_district` varchar(255) NOT NULL,
  `union_name` varchar(255) NOT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT 1,
  `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 `doctor_profiles`
--

CREATE TABLE `doctor_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `doctor_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `doctor_speciality_id` bigint(20) UNSIGNED DEFAULT NULL,
  `doctor_title_id` bigint(20) UNSIGNED DEFAULT NULL,
  `bio` text DEFAULT NULL,
  `pricing` decimal(8,2) DEFAULT NULL,
  `availability` tinyint(1) NOT NULL DEFAULT 0,
  `avatar` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `thana` varchar(255) DEFAULT NULL,
  `identification_no` varchar(255) NOT NULL COMMENT 'nid, passport',
  `registration_no` varchar(255) NOT NULL,
  `active_from` time DEFAULT NULL,
  `active_to` time DEFAULT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `doctor_profiles`
--

INSERT INTO `doctor_profiles` (`id`, `user_id`, `doctor_type_id`, `doctor_speciality_id`, `doctor_title_id`, `bio`, `pricing`, `availability`, `avatar`, `gender`, `dob`, `district`, `thana`, `identification_no`, `registration_no`, `active_from`, `active_to`, `active_status`, `created_at`, `updated_at`) VALUES
(1, 23, 2, 2, 2, NULL, '1000.00', 1, 'http://127.0.0.1:8000/images/doctor/1747207069_23.png', 'female', '2025-05-06', 'Dhaka', 'Pallabi', '63453531', '34343234', NULL, NULL, 0, '2025-05-14 00:39:22', '2025-05-14 01:24:55');

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

--
-- Table structure for table `doctor_specialities`
--

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

--
-- Dumping data for table `doctor_specialities`
--

INSERT INTO `doctor_specialities` (`id`, `specialized_at`, `icon`, `created_at`, `updated_at`) VALUES
(2, 'Cardiologist 2', NULL, '2025-05-13 23:33:06', '2025-05-13 23:33:06');

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

--
-- Table structure for table `doctor_titles`
--

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

INSERT INTO `doctor_titles` (`id`, `title`, `created_at`, `updated_at`) VALUES
(2, 'Professor', '2025-05-13 23:29:35', '2025-05-13 23:29:35');

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

--
-- Table structure for table `doctor_types`
--

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

INSERT INTO `doctor_types` (`id`, `type`, `created_at`, `updated_at`) VALUES
(2, 'Medical', '2025-05-13 23:19:31', '2025-05-13 23:19:31'),
(3, 'Medical 2', '2025-05-13 23:26:02', '2025-05-13 23:26:02');

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

--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `document_link` varchar(255) NOT NULL,
  `type` enum('verification','public','private') 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 `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 `language_states`
--

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

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

--
-- Table structure for table `lawyer_profiles`
--

CREATE TABLE `lawyer_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `lawyer_title_id` bigint(20) UNSIGNED DEFAULT NULL,
  `bio` text DEFAULT NULL,
  `pricing` decimal(8,2) DEFAULT NULL,
  `availability` tinyint(1) NOT NULL DEFAULT 0,
  `avatar` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `thana` varchar(255) DEFAULT NULL,
  `practice_area` varchar(255) DEFAULT NULL,
  `identification_no` varchar(255) NOT NULL COMMENT 'nid, passport',
  `bar_registration_no` varchar(255) NOT NULL,
  `active_from` time DEFAULT NULL,
  `active_to` time DEFAULT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `lawyer_speciality_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lawyer_specialities`
--

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

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

--
-- Table structure for table `lawyer_titles`
--

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

INSERT INTO `lawyer_titles` (`id`, `title`, `created_at`, `updated_at`) VALUES
(1, 'Advocate', '2025-05-06 22:46:00', '2025-05-06 22:46:00');

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

--
-- 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, '2025_05_05_053846_create_roles_table', 1),
(2, '2014_10_12_000000_create_users_table', 2),
(3, '2014_10_12_100000_create_password_reset_tokens_table', 2),
(4, '2019_08_19_000000_create_failed_jobs_table', 2),
(5, '2019_12_14_000001_create_personal_access_tokens_table', 2),
(6, '2025_05_05_054636_create_customer_profiles_table', 2),
(7, '2025_05_05_055003_create_otp_codes_table', 2),
(9, '2025_05_05_163458_add_avatar_and_active_status_to_customer_profiles_table', 3),
(10, '2025_05_06_040902_create_moderator_profiles_table', 4),
(11, '2025_05_06_041548_create_moderator_profiles_table', 5),
(12, '2025_05_06_093430_create_doctor_types_table', 5),
(13, '2025_05_06_100153_create_doctor_specialities_table', 6),
(14, '2025_05_06_110600_create_doctor_titles_table', 7),
(15, '2025_05_06_110700_create_doctor_profiles_table', 7),
(16, '2025_05_07_031756_create_lawyer_titles_table', 8),
(17, '2025_05_07_031926_create_lawyer_profiles_table', 8),
(20, '2025_05_09_102536_create_common_profiles_table', 9),
(21, '2025_05_09_103027_create_unique_identifications_table', 9),
(22, '2025_05_10_175241_add_unique_user_id_to_users_table', 10),
(23, '2025_05_16_055028_create_wallets_table', 11),
(24, '2025_05_16_055439_create_service_provider_availabilities_table', 11),
(25, '2025_05_16_055538_create_appointments_table', 11),
(26, '2025_05_16_055556_create_appointment_slots_table', 11),
(27, '2025_05_19_044226_create_documents_table', 11),
(28, '2025_05_19_044242_create_private_documents_table', 11),
(29, '2025_05_19_061204_create_reviews_table', 11),
(30, '2025_05_19_095053_create_lawyer_specialities_table', 11),
(31, '2025_05_19_095408_add_lawyer_speciality_id_to_lawyer_profiles', 11),
(32, '2025_05_19_112146_create_add_banners_table', 12),
(33, '2025_05_20_135615_create_common_provider_specialities_table', 12),
(34, '2025_05_20_144050_add_common_speciality_id_to_common_profiles', 12),
(35, '2025_05_21_031819_make_foreign_keys_nullable_in_doctor_profiles_table', 12),
(36, '2025_05_21_032254_make_foreign_keys_nullable_in_lawyer_profiles_table', 12),
(37, '2025_05_21_033151_make_foreign_keys_nullable_in_common_profiles_table', 12),
(38, '2025_05_21_040804_add_icon_to_roles_table', 12),
(39, '2025_05_21_041448_add_icon_to_doctor_specialities_table', 12),
(40, '2025_05_21_041632_add_icon_to_lawyer_specialities_table', 12),
(41, '2025_05_21_041723_add_icon_to_common_provider_specialities_table', 12),
(42, '2025_05_21_063723_create_language_states_table', 12);

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

--
-- Table structure for table `moderator_profiles`
--

CREATE TABLE `moderator_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT 1,
  `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 `moderator_profiles`
--

INSERT INTO `moderator_profiles` (`id`, `user_id`, `gender`, `dob`, `avatar`, `active_status`, `created_at`, `updated_at`) VALUES
(1, 19, NULL, NULL, NULL, 1, '2025-05-13 06:32:27', '2025-05-13 06:32:27');

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

--
-- Table structure for table `otp_codes`
--

CREATE TABLE `otp_codes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `phone` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `is_verified` tinyint(1) NOT NULL DEFAULT 0,
  `expires_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `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 `otp_codes`
--

INSERT INTO `otp_codes` (`id`, `phone`, `code`, `is_verified`, `expires_at`, `created_at`, `updated_at`) VALUES
(2, '01675332900', '4882', 1, '2025-05-13 10:22:17', '2025-05-05 03:41:47', '2025-05-13 04:22:17');

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

--
-- Table structure for table `private_documents`
--

CREATE TABLE `private_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `document_id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `created_for` bigint(20) UNSIGNED NOT NULL,
  `appointment_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 `reviews`
--

CREATE TABLE `reviews` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `service_provider_id` bigint(20) UNSIGNED NOT NULL,
  `review` text DEFAULT NULL,
  `rating` decimal(2,1) NOT NULL,
  `status` enum('pending','approved','rejected') 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 `roles`
--

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

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

INSERT INTO `roles` (`id`, `name`, `identification_placeholder`, `icon`, `created_at`, `updated_at`) VALUES
(2, 'super admin', NULL, NULL, '2025-05-05 10:31:25', '2025-05-05 10:31:25'),
(3, 'moderator', NULL, NULL, '2025-05-05 21:56:28', '2025-05-05 21:56:28'),
(4, 'doctor', NULL, NULL, '2025-05-05 22:00:05', '2025-05-05 22:00:05'),
(5, 'customer', NULL, NULL, '2025-05-06 00:17:50', '2025-05-06 00:17:50'),
(6, 'lawyer', NULL, NULL, '2025-05-06 22:21:06', '2025-05-06 22:21:06');

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

--
-- Table structure for table `service_provider_availabilities`
--

CREATE TABLE `service_provider_availabilities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `provider_id` bigint(20) UNSIGNED NOT NULL,
  `availability_type` enum('appointment','instant_consultation') NOT NULL,
  `day` enum('monday','tuesday','wednesday','thursday','friday','saturday','sunday') NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `slot_duration` int(11) NOT NULL DEFAULT 10,
  `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 `unique_identifications`
--

CREATE TABLE `unique_identifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `common_profile_id` bigint(20) UNSIGNED NOT NULL,
  `unique_identification_no` varchar(255) NOT NULL,
  `other_data` varchar(1000) DEFAULT NULL COMMENT 'Json Data',
  `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 `wallets`
--

CREATE TABLE `wallets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `balance` decimal(10,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `appointments`
--
ALTER TABLE `appointments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `appointments_customer_id_foreign` (`customer_id`),
  ADD KEY `appointments_provider_id_foreign` (`provider_id`);

--
-- Indexes for table `appointment_slots`
--
ALTER TABLE `appointment_slots`
  ADD PRIMARY KEY (`id`),
  ADD KEY `appointment_slots_availability_id_foreign` (`availability_id`);

--
-- Indexes for table `common_profiles`
--
ALTER TABLE `common_profiles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `common_profiles_user_id_foreign` (`user_id`),
  ADD KEY `common_profiles_common_speciality_id_foreign` (`common_speciality_id`);

--
-- Indexes for table `common_provider_specialities`
--
ALTER TABLE `common_provider_specialities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `common_provider_specialities_specialized_at_unique` (`specialized_at`),
  ADD KEY `common_provider_specialities_category_id_foreign` (`category_id`);

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

--
-- Indexes for table `doctor_profiles`
--
ALTER TABLE `doctor_profiles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `doctor_profiles_user_id_foreign` (`user_id`),
  ADD KEY `doctor_profiles_doctor_type_id_foreign` (`doctor_type_id`),
  ADD KEY `doctor_profiles_doctor_speciality_id_foreign` (`doctor_speciality_id`),
  ADD KEY `doctor_profiles_doctor_title_id_foreign` (`doctor_title_id`);

--
-- Indexes for table `doctor_specialities`
--
ALTER TABLE `doctor_specialities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `doctor_specialities_specialized_at_unique` (`specialized_at`);

--
-- Indexes for table `doctor_titles`
--
ALTER TABLE `doctor_titles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `doctor_titles_title_unique` (`title`);

--
-- Indexes for table `doctor_types`
--
ALTER TABLE `doctor_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `doctor_types_type_unique` (`type`);

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

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

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

--
-- Indexes for table `lawyer_profiles`
--
ALTER TABLE `lawyer_profiles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lawyer_profiles_user_id_foreign` (`user_id`),
  ADD KEY `lawyer_profiles_lawyer_speciality_id_foreign` (`lawyer_speciality_id`),
  ADD KEY `lawyer_profiles_lawyer_title_id_foreign` (`lawyer_title_id`);

--
-- Indexes for table `lawyer_specialities`
--
ALTER TABLE `lawyer_specialities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `lawyer_specialities_specialized_at_unique` (`specialized_at`);

--
-- Indexes for table `lawyer_titles`
--
ALTER TABLE `lawyer_titles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `lawyer_titles_title_unique` (`title`);

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

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

--
-- Indexes for table `otp_codes`
--
ALTER TABLE `otp_codes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `otp_codes_phone_index` (`phone`);

--
-- Indexes for table `private_documents`
--
ALTER TABLE `private_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `private_documents_document_id_foreign` (`document_id`),
  ADD KEY `private_documents_created_by_foreign` (`created_by`),
  ADD KEY `private_documents_created_for_foreign` (`created_for`),
  ADD KEY `private_documents_appointment_id_foreign` (`appointment_id`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `reviews_customer_id_foreign` (`customer_id`),
  ADD KEY `reviews_service_provider_id_foreign` (`service_provider_id`);

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

--
-- Indexes for table `service_provider_availabilities`
--
ALTER TABLE `service_provider_availabilities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_provider_availabilities_provider_id_foreign` (`provider_id`);

--
-- Indexes for table `unique_identifications`
--
ALTER TABLE `unique_identifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `unique_identifications_common_profile_id_foreign` (`common_profile_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `appointments`
--
ALTER TABLE `appointments`
  ADD CONSTRAINT `appointments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `appointments_provider_id_foreign` FOREIGN KEY (`provider_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `appointment_slots`
--
ALTER TABLE `appointment_slots`
  ADD CONSTRAINT `appointment_slots_availability_id_foreign` FOREIGN KEY (`availability_id`) REFERENCES `service_provider_availabilities` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `common_profiles`
--
ALTER TABLE `common_profiles`
  ADD CONSTRAINT `common_profiles_common_speciality_id_foreign` FOREIGN KEY (`common_speciality_id`) REFERENCES `common_provider_specialities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `common_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `common_provider_specialities`
--
ALTER TABLE `common_provider_specialities`
  ADD CONSTRAINT `common_provider_specialities_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `doctor_profiles`
--
ALTER TABLE `doctor_profiles`
  ADD CONSTRAINT `doctor_profiles_doctor_speciality_id_foreign` FOREIGN KEY (`doctor_speciality_id`) REFERENCES `doctor_specialities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `doctor_profiles_doctor_title_id_foreign` FOREIGN KEY (`doctor_title_id`) REFERENCES `doctor_titles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `doctor_profiles_doctor_type_id_foreign` FOREIGN KEY (`doctor_type_id`) REFERENCES `doctor_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `doctor_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

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

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

--
-- Constraints for table `lawyer_profiles`
--
ALTER TABLE `lawyer_profiles`
  ADD CONSTRAINT `lawyer_profiles_lawyer_speciality_id_foreign` FOREIGN KEY (`lawyer_speciality_id`) REFERENCES `lawyer_specialities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `lawyer_profiles_lawyer_title_id_foreign` FOREIGN KEY (`lawyer_title_id`) REFERENCES `lawyer_titles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `lawyer_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `private_documents`
--
ALTER TABLE `private_documents`
  ADD CONSTRAINT `private_documents_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `private_documents_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `private_documents_created_for_foreign` FOREIGN KEY (`created_for`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `private_documents_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `reviews_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reviews_service_provider_id_foreign` FOREIGN KEY (`service_provider_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `service_provider_availabilities`
--
ALTER TABLE `service_provider_availabilities`
  ADD CONSTRAINT `service_provider_availabilities_provider_id_foreign` FOREIGN KEY (`provider_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `unique_identifications`
--
ALTER TABLE `unique_identifications`
  ADD CONSTRAINT `unique_identifications_common_profile_id_foreign` FOREIGN KEY (`common_profile_id`) REFERENCES `common_profiles` (`id`) ON DELETE CASCADE;

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

