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

START TRANSACTION;



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

--
-- Table structure for table `categories`
--

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

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

INSERT INTO `chef_categories` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'کبابی', NULL, NULL),
(2, 'پروتئینی', NULL, NULL),
(3, 'غذای خونگی', NULL, NULL);

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

--
-- Table structure for table `chef_profiles`
--

CREATE TABLE `chef_profiles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `chef_category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `profile` text NOT NULL,
  `experience` text DEFAULT NULL,
  `rating` double(2,1) NOT NULL DEFAULT 0.0,
  `profile_picture` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `location_lat` double NOT NULL,
  `location_long` double 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 `chef_profiles`
--

INSERT INTO `chef_profiles` (`id`, `user_id`, `chef_category_id`, `name`, `profile`, `experience`, `rating`, `profile_picture`, `location`, `location_lat`, `location_long`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'حاج خانوم', 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', '2024-12-30 11:42:42', 5.0, 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', 'صدرا فاز یک بلوار البرز، البرز هفت، مجتمع مهتاب، واحد 501، طبقه 5', 29.808905, 52.52104325, '2024-12-30 08:12:42', '2024-12-30 08:12:42'),
(2, 2, 2, 'پروتئینی علی', 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', '2024-12-30 11:42:42', 5.0, 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', 'صدرا فاز یک بلوار البرز، البرز هفت، مجتمع مهتاب، واحد 501، طبقه 5', 29.5918, 52.5837, '2024-12-30 08:12:42', '2024-12-30 08:12:42'),
(3, 2, 2, 'پروتئینی مسعود', 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', '2024-12-30 11:42:42', 4.5, 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', 'صدرا فاز یک بلوار البرز، البرز هفت، مجتمع مهتاب، واحد 501، طبقه 5', 29.808905, 52.52104325, '2024-12-30 08:12:42', '2024-12-30 08:12:42'),
(4, 2, 3, 'آشپزخانه حاج خانوم', 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', '2024-12-30 11:42:42', 4.5, 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', 'صدرا فاز یک بلوار البرز، البرز هفت، مجتمع مهتاب، واحد 501، طبقه 5', 29.808905, 52.52104325, '2024-12-30 08:12:42', '2024-12-30 08:12:42');

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

--
-- Table structure for table `city`
--

CREATE TABLE `city` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `province_id` bigint(11) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `city`
--

INSERT INTO `city` (`id`, `province_id`, `name`, `created_at`, `updated_at`) VALUES
(17, 1, 'شیراز', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(18, 1, 'مرودشت', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(19, 1, 'فسا', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(20, 1, 'کازرون', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(21, 1, 'لار', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(22, 1, 'داراب', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(23, 1, 'آباده', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(24, 1, 'استهبان', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(25, 1, 'نی ریز', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(26, 1, 'فیروزآباد', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(27, 1, 'جهرم', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(28, 1, 'سپیدان', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(29, 1, 'زرین دشت', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(30, 1, 'بوانات', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(31, 1, 'ممسنی', '2024-12-30 12:43:56', '2024-12-30 12:43:56'),
(32, 1, 'شهرجدید صدرا', '2024-12-30 12:43:56', '2024-12-30 12:43:56');

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

--
-- Table structure for table `error_logs`
--

CREATE TABLE `error_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `ip_address` 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;

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

--
-- 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, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(2, '2023_12_30_101415_create_chef_categories_table', 1),
(3, '2024_03_13_140244_sms_verify', 1),
(4, '2024_12_16_114439_create_users_table', 1),
(5, '2024_12_16_115623_create_transactions_table', 1),
(6, '2024_12_16_123220_create_chef_profiles_table', 1),
(7, '2024_12_16_125455_create_error_logs_table', 1),
(8, '2024_12_16_134941_create_apikey_table', 1),
(9, '2024_12_16_190502_create_categories_table', 1),
(10, '2024_12_17_123820_create_products_table', 1),
(11, '2024_12_17_143348_create_user_documents_table', 1),
(12, '2024_12_17_144126_create_notifications_table', 1),
(13, '2024_12_18_124034_create_reviews_table', 1),
(14, '2024_12_30_103800_create_suggestion_migration', 1),
(15, '2024_12_30_152105_create_users_address', 2);

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

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

CREATE TABLE `notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `is_read` 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 `notifications`
--

INSERT INTO `notifications` (`id`, `user_id`, `title`, `message`, `type`, `is_read`, `created_at`, `updated_at`) VALUES
(1, 1, 'تأیید عضویت شما در بخش آشپزهای \"غذاتو\"', 'با سلام و احترام، عضویت شما در جمع آشپزهای محترم \"غذاتو\" با موفقیت تأیید گردید. از این پس می‌توانید خدمات خود را در پلتفرم ما ارائه دهید.', 'approved', 0, '2024-12-30 08:12:42', '2024-12-30 08:12:42');

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `chef_profile_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `price` double(8,2) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `inventory` int(11) NOT NULL,
  `images` 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 `province`
--

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

INSERT INTO `province` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'فارس', NULL, NULL);

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

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `comment` text NOT NULL,
  `rating` int(11) 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 `suggestion_migration`
--

CREATE TABLE `suggestion_migration` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `image_path` 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;

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

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `transaction_code` varchar(255) NOT NULL,
  `product_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`product_ids`)),
  `transaction_time` 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;

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

--
-- Table structure for table `users_address`
--

CREATE TABLE `users_address` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `location` varchar(255) NOT NULL,
  `location_lat` double NOT NULL,
  `location_long` double NOT NULL,
  `selected` tinyint(1) 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 `users_address`
--

INSERT INTO `users_address` (`id`, `user_id`, `location`, `location_lat`, `location_long`, `selected`, `created_at`, `updated_at`) VALUES
(1, 1, 'صدرا فاز یک بلوار البرز هفت تنان مجتمع احسان بلوک A2 طبقه 1 واحد 201', 29.81024067645022, 52.52162718801955, 1, '2024-12-30 12:21:09', '2024-12-30 12:24:38'),
(2, 1, 'صدرا فاز یک بلوار البرز هفت تنان مجتمع احسان بلوک A2 طبقه 1 واحد 201', 29.81024067645022, 52.52162718801955, 0, '2024-12-30 12:22:03', '2024-12-30 12:24:38'),
(3, 1, 'صدرا فاز یک بلوار البرز هفت تنان مجتمع احسان بلوک A2 طبقه 1 واحد 201', 29.81024067645022, 52.52162718801955, 0, '2024-12-30 12:24:03', '2024-12-30 12:24:38');

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

--
-- Table structure for table `user_documents`
--

CREATE TABLE `user_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `chef_profile_name` varchar(255) NOT NULL,
  `chef_category_id` bigint(20) UNSIGNED NOT NULL,
  `national_card_front` varchar(255) DEFAULT NULL,
  `national_card_back` varchar(255) DEFAULT NULL,
  `applicant_photo` varchar(255) DEFAULT NULL,
  `national_code` varchar(255) DEFAULT NULL,
  `verification_status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `verification_video` varchar(255) DEFAULT NULL,
  `location` varchar(255) NOT NULL,
  `location_lat` double NOT NULL,
  `location_long` double 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 `user_documents`
--

INSERT INTO `user_documents` (`id`, `user_id`, `chef_profile_name`, `chef_category_id`, `national_card_front`, `national_card_back`, `applicant_photo`, `national_code`, `verification_status`, `verification_video`, `location`, `location_lat`, `location_long`, `created_at`, `updated_at`) VALUES
(2, 1, 'حاج خانوم', 1, 'documents/P2T1FN0knrQYiy6PFX2eJ7FkynLA9NAiZ4GRELyN.jpg', 'documents/lr4xcBdOgzsj6JD3A2FClEBfNmvpIsuccyTefxTd.jpg', 'documents/0FvI7c6YeMw1MOgPCuirPpAzKrOFYQb1BWB8we6o.jpg', '4260330004', 'approved', 'videos/0UVJaE1R99ebBj1qg33Y7ueK3GDmhFmCtJCJE5PH.mp4', 'صدرا فاز یک بلوار البرز، البرز هفت، مجتمع مهتاب، واحد 501، طبقه 5', 29.808905, 52.52104325, '2024-12-30 08:01:30', '2024-12-30 08:12:42');

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `categories_chef_id_foreign` (`chef_id`);

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

--
-- Indexes for table `chef_profiles`
--
ALTER TABLE `chef_profiles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `chef_profiles_user_id_foreign` (`user_id`),
  ADD KEY `chef_profiles_chef_category_id_foreign` (`chef_category_id`);

--
-- Indexes for table `city`
--
ALTER TABLE `city`
  ADD PRIMARY KEY (`id`),
  ADD KEY `province_id` (`province_id`);

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

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

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

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `products_category_id_foreign` (`category_id`),
  ADD KEY `products_chef_profile_id_foreign` (`chef_profile_id`);

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

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `reviews_product_id_foreign` (`product_id`),
  ADD KEY `reviews_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transactions_transaction_code_unique` (`transaction_code`),
  ADD KEY `transactions_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `user_documents`
--
ALTER TABLE `user_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_documents_chef_category_id_foreign` (`chef_category_id`),
  ADD KEY `user_documents_user_id_foreign` (`user_id`);

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
  ADD CONSTRAINT `categories_chef_id_foreign` FOREIGN KEY (`chef_id`) REFERENCES `chef_profiles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `chef_profiles`
--
ALTER TABLE `chef_profiles`
  ADD CONSTRAINT `chef_profiles_chef_category_id_foreign` FOREIGN KEY (`chef_category_id`) REFERENCES `chef_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `chef_profiles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_chef_profile_id_foreign` FOREIGN KEY (`chef_profile_id`) REFERENCES `chef_profiles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `reviews_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reviews_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

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

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

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

--
-- Constraints for table `user_documents`
--
ALTER TABLE `user_documents`
  ADD CONSTRAINT `user_documents_chef_category_id_foreign` FOREIGN KEY (`chef_category_id`) REFERENCES `chef_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_documents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

