diff --git a/database/backup/airline_agency7.sql b/database/backup/airline_agency7.sql new file mode 100644 index 0000000..460e8f2 --- /dev/null +++ b/database/backup/airline_agency7.sql @@ -0,0 +1,538 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.3 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3308 +-- Generation Time: Aug 22, 2026 at 07:47 AM +-- Server version: 8.4.7 +-- PHP Version: 8.3.28 + +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: `airline_agency` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `admins` +-- + +DROP TABLE IF EXISTS `admins`; +CREATE TABLE IF NOT EXISTS `admins` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `full_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `username` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '1' COMMENT '0:disable 1:enable', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `admins` +-- + +INSERT INTO `admins` (`id`, `full_name`, `username`, `email`, `mobile`, `password`, `status`, `created_at`, `updated_at`) VALUES +(2, 'شهرزاد زندی', 'shahrzad', 'shahrzad.zandi@gmail.com', '09359359350', '$2y$12$KpHLJK1kIz/TxVUOn4FV7udVA3xGLLDtEknPZyfh13Z2WPkRmHwni', 1, '2026-08-17 07:24:19', '2026-08-17 07:24:19'), +(3, 'مدیر سیستم', 'admin', 'admin@gmail.com', '09123456789', '$2y$12$ElsUA1CqyK6euG6adWhXRuayR/Jzcq1zH28eoN3ypfeVrmTIr/zAe', 1, '2026-08-17 07:44:25', '2026-08-17 09:12:14'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `admin_permission` +-- + +DROP TABLE IF EXISTS `admin_permission`; +CREATE TABLE IF NOT EXISTS `admin_permission` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `admin_id` bigint UNSIGNED NOT NULL, + `permission_id` bigint UNSIGNED NOT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `fk1_admin_permission` (`permission_id`), + KEY `fk2_admin_permission` (`admin_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `airports` +-- + +DROP TABLE IF EXISTS `airports`; +CREATE TABLE IF NOT EXISTS `airports` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `city` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `province` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `airports` +-- + +INSERT INTO `airports` (`id`, `name`, `city`, `province`, `code`, `created_at`, `updated_at`) VALUES +(1, 'فرودگاه بین‌المللی اهواز', 'اهواز', 'خوزستان', 'AWZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `bookings` +-- + +DROP TABLE IF EXISTS `bookings`; +CREATE TABLE IF NOT EXISTS `bookings` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` bigint UNSIGNED NOT NULL, + `tour_id` bigint UNSIGNED DEFAULT NULL, + `flight_id` bigint UNSIGNED DEFAULT NULL, + `booking_code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, + `first_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `last_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `national_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `passengers` int UNSIGNED NOT NULL DEFAULT '1', + `price` decimal(15,2) NOT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '0', + `payment_status` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `notes` text COLLATE utf8mb4_unicode_ci, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `fk1_bookings` (`user_id`), + KEY `fk2_bookings` (`tour_id`), + KEY `fk3_bookings` (`flight_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cities` +-- + +DROP TABLE IF EXISTS `cities`; +CREATE TABLE IF NOT EXISTS `cities` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `province_id` bigint UNSIGNED NOT NULL, + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `fk1_cities` (`province_id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `cities` +-- + +INSERT INTO `cities` (`id`, `province_id`, `name`, `created_at`, `updated_at`) VALUES +(7, 2, 'ساری', NULL, NULL), +(8, 1, 'تهران', NULL, NULL), +(9, 5, 'شیراز', NULL, NULL), +(10, 4, 'اصفهان', NULL, NULL), +(11, 1, 'ری', NULL, NULL), +(12, 2, 'آمل', NULL, NULL), +(13, 9, 'کرمان', '2026-08-22 04:57:54', '2026-08-22 04:57:54'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `comments` +-- + +DROP TABLE IF EXISTS `comments`; +CREATE TABLE IF NOT EXISTS `comments` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` bigint UNSIGNED NOT NULL, + `commentable_id` bigint UNSIGNED NOT NULL, + `commentable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `body` text COLLATE utf8mb4_unicode_ci NOT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '0', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `fk1_ comments` (`user_id`), + KEY `fk2_ comments` (`commentable_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `comments` +-- + +INSERT INTO `comments` (`id`, `user_id`, `commentable_id`, `commentable_type`, `body`, `status`, `created_at`, `updated_at`) VALUES +(2, 1, 3, 'App\\Models\\Tour', 'بسیار خوب بود', 1, '2026-08-20 10:15:43', '2026-08-20 10:15:43'), +(3, 1, 3, 'App\\Models\\Tour', 'خیلی هم عالی', 1, '2026-08-20 10:17:07', '2026-08-20 10:17:07'), +(4, 1, 3, 'App\\Models\\Tour', 'من این تور را پسندیدم.', 1, '2026-08-20 13:15:04', '2026-08-20 13:15:04'), +(5, 1, 6, 'App\\Models\\Tour', 'بسیار سفر خوبی بود با این تور', 1, '2026-08-22 06:47:37', '2026-08-22 06:47:37'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `favorites` +-- + +DROP TABLE IF EXISTS `favorites`; +CREATE TABLE IF NOT EXISTS `favorites` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` bigint UNSIGNED NOT NULL, + `favoritable_id` bigint UNSIGNED NOT NULL, + `favoritable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `fk1_favorites` (`user_id`), + KEY `fk2_favorites` (`favoritable_id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `favorites` +-- + +INSERT INTO `favorites` (`id`, `user_id`, `favoritable_id`, `favoritable_type`, `created_at`, `updated_at`) VALUES +(3, 1, 3, 'App\\Models\\Tour', '2026-08-19 16:05:52', '2026-08-19 16:05:52'), +(6, 1, 6, 'App\\Models\\Tour', '2026-08-22 06:39:47', '2026-08-22 06:39:47'), +(7, 1, 8, 'App\\Models\\Tour', '2026-08-22 06:48:01', '2026-08-22 06:48:01'), +(8, 1, 5, 'App\\Models\\Tour', '2026-08-22 07:37:20', '2026-08-22 07:37:20'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `files` +-- + +DROP TABLE IF EXISTS `files`; +CREATE TABLE IF NOT EXISTS `files` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `fileable_id` bigint DEFAULT NULL, + `fileable_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, + `extension` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `size` bigint UNSIGNED NOT NULL, + `original_name` varchar(350) COLLATE utf8mb4_unicode_ci NOT NULL, + `path` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `flights` +-- + +DROP TABLE IF EXISTS `flights`; +CREATE TABLE IF NOT EXISTS `flights` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `travel_type_id` bigint UNSIGNED NOT NULL, + `flight_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `airline_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `origin` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `destination` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `departure_date` date NOT NULL, + `departure_time` time NOT NULL, + `arrival_date` date NOT NULL, + `arrival_time` time NOT NULL, + `duration` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `price` decimal(12,2) NOT NULL, + `capacity` int UNSIGNED NOT NULL, + `status` tinyint NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `flights` +-- + +INSERT INTO `flights` (`id`, `travel_type_id`, `flight_number`, `airline_name`, `origin`, `destination`, `departure_date`, `departure_time`, `arrival_date`, `arrival_time`, `duration`, `price`, `capacity`, `status`, `created_at`, `updated_at`) VALUES +(1, 2, 'IR-725', 'ایران ایر', 'تهران', 'مشهد', '1405-06-03', '14:30:00', '1405-06-03', '16:00:00', '1 ساعت و 30 دقیقه', 2500000.00, 180, 0, '2026-08-17 13:52:44', '2026-08-17 13:56:00'), +(2, 3, 'TK-182', 'ترکیش ایرلاینز', 'تهران', 'استانبول', '2026-08-28', '20:00:00', '2026-08-29', '07:31:00', '11 ساعت و 31', 18500000.00, 220, 1, '2026-08-17 14:01:19', '2026-08-17 14:01:19'), +(3, 4, 'CH-401', 'وارش', 'تهران', 'کیش', '2026-09-01', '10:30:00', '2026-09-01', '20:33:00', '10 ساعت و3 دقیقه', 4200000.00, 160, 1, '2026-08-17 14:04:34', '2026-08-17 14:04:34'), +(4, 2, 'ia33', 'test', 'test', 'test', '1405-05-06', '20:12:00', '1405-05-06', '22:06:00', '2', 850000.00, 2, 1, '2026-08-19 13:38:25', '2026-08-19 13:38:25'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `payments` +-- + +DROP TABLE IF EXISTS `payments`; +CREATE TABLE IF NOT EXISTS `payments` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` bigint UNSIGNED NOT NULL, + `payable_id` bigint UNSIGNED NOT NULL, + `amount` decimal(12,2) NOT NULL, + `authority` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `status` tinyint NOT NULL COMMENT 'pending:0 | success:1| failed:2 | canceled:3', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `permissions` +-- + +DROP TABLE IF EXISTS `permissions`; +CREATE TABLE IF NOT EXISTS `permissions` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `slug` (`slug`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `provinces` +-- + +DROP TABLE IF EXISTS `provinces`; +CREATE TABLE IF NOT EXISTS `provinces` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `provinces` +-- + +INSERT INTO `provinces` (`id`, `name`, `created_at`, `updated_at`) VALUES +(1, 'تهران', NULL, NULL), +(2, 'مازندران', NULL, NULL), +(3, 'گیلان', NULL, NULL), +(4, 'اصفهان', NULL, NULL), +(5, 'فارس', NULL, NULL), +(6, 'یزد', NULL, NULL), +(7, 'آذربایجان غربی', NULL, NULL), +(8, 'آذربایجان شرقی', NULL, NULL), +(9, 'کرمان', '2026-08-22 04:57:33', '2026-08-22 04:57:33'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `settings` +-- + +DROP TABLE IF EXISTS `settings`; +CREATE TABLE IF NOT EXISTS `settings` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `value` text COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tours` +-- + +DROP TABLE IF EXISTS `tours`; +CREATE TABLE IF NOT EXISTS `tours` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `travel_type_id` bigint UNSIGNED DEFAULT NULL, + `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, + `slug` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `duration` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `start_date` date DEFAULT NULL, + `end_date` date DEFAULT NULL, + `price` decimal(12,2) NOT NULL, + `capacity` int UNSIGNED DEFAULT NULL, + `views_count` int NOT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `fk1_tours` (`travel_type_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `tours` +-- + +INSERT INTO `tours` (`id`, `travel_type_id`, `title`, `slug`, `image`, `description`, `duration`, `start_date`, `end_date`, `price`, `capacity`, `views_count`, `status`, `created_at`, `updated_at`) VALUES +(3, NULL, 'تور سه‌روزه اصفهان با راهنمای تخصصی', 'tor-shrozh-asfhan-ba-rahnmay-tkhssy', 'tours/1787037667.tour-image56011.jpg', NULL, NULL, NULL, NULL, 2850000.00, NULL, 80, 1, '2026-08-18 07:21:07', '2026-08-22 06:35:20'), +(4, NULL, 'تور لوکس پنج‌روزه کیش با پرواز مستقیم', 'tor-loks-pngrozh-kysh-ba-proaz-mstkym', 'tours/1787037718.tour-image49479.jpg', NULL, NULL, NULL, NULL, 12500000.00, NULL, 41, 1, '2026-08-18 07:21:58', '2026-08-21 15:21:22'), +(5, NULL, 'تور خانوادگی پنج‌روزه قشم و هرمز', 'tor-khanoadgy-pngrozh-kshm-o-hrmz', 'tours/1787138709.tour-image35820.jpg', NULL, NULL, NULL, NULL, 9750000.00, NULL, 4, 1, '2026-08-19 11:25:09', '2026-08-22 07:37:20'), +(6, NULL, 'تور شش‌روزه رم و فلورانس', 'tor-shshrozh-rm-o-florans', 'tours/1787138776.tour-image35964.jpg', NULL, NULL, NULL, NULL, 76500000.00, NULL, 5, 1, '2026-08-19 11:26:16', '2026-08-22 06:47:38'), +(7, NULL, 'تور لوکس هفت‌روزه پاریس', 'tor-loks-hftrozh-parys', 'tours/1787138834.tour-image66216.jpg', NULL, NULL, NULL, NULL, 89000000.00, NULL, 0, 0, '2026-08-19 11:27:14', '2026-08-22 05:54:45'), +(8, NULL, 'تور اقتصادی چهارروزه باکو', 'tor-aktsady-chharrozh-bako', 'tours/1787138868.tour-image42665.jpg', NULL, NULL, NULL, NULL, 15800000.00, NULL, 2, 1, '2026-08-19 11:27:48', '2026-08-22 06:48:01'), +(9, NULL, 'test', 'test', 'tours/1787146812.tour-image88373.jpg', NULL, NULL, NULL, NULL, 2000000.00, NULL, 0, 0, '2026-08-19 13:40:12', '2026-08-22 05:55:01'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tour_flights` +-- + +DROP TABLE IF EXISTS `tour_flights`; +CREATE TABLE IF NOT EXISTS `tour_flights` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `tour_id` bigint UNSIGNED NOT NULL, + `flight_id` bigint UNSIGNED NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + KEY `fk1_tour_flights` (`flight_id`), + KEY `fk2_tour_flights` (`tour_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `travel_types` +-- + +DROP TABLE IF EXISTS `travel_types`; +CREATE TABLE IF NOT EXISTS `travel_types` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `slug` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `slug` (`slug`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `travel_types` +-- + +INSERT INTO `travel_types` (`id`, `title`, `slug`, `status`, `created_at`, `updated_at`) VALUES +(2, 'تور داخلی', 'domestic-tour', 1, '2026-08-17 11:36:22', '2026-08-17 11:36:22'), +(3, 'تور خارجی', 'international-tour', 1, '2026-08-17 11:46:33', '2026-08-17 11:46:33'), +(4, 'تور چارتر', 'charter-tour', 1, '2026-08-17 11:46:59', '2026-08-17 11:46:59'), +(5, 'تور ترکیبی', 'combined-tour', 1, '2026-08-17 11:47:41', '2026-08-17 11:47:41'), +(6, 'پرواز خارجی', 'international-flight', 1, '2026-08-17 11:48:19', '2026-08-17 11:48:19'), +(7, 'پرواز داخلی', 'domestic-flight', 1, '2026-08-17 11:48:44', '2026-08-17 11:48:44'), +(8, 'تور لحظه آخری', 'last-minute', 1, '2026-08-17 11:49:11', '2026-08-17 11:49:11'), +(9, 'پیشنویس نمونه', 'draft-sample', 0, '2026-08-17 11:49:33', '2026-08-17 11:56:13'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +CREATE TABLE IF NOT EXISTS `users` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `first_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `last_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `national_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `birth_date` date DEFAULT NULL, + `gender` tinyint(1) NOT NULL COMMENT '1:Male | 2:Female', + `marital_status` tinyint(1) NOT NULL COMMENT '1:Single | 2:Married | 3:Divorced/Separated', + `spouse_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `province_id` bigint UNSIGNED NOT NULL, + `city_id` bigint UNSIGNED DEFAULT NULL, + `status` tinyint UNSIGNED NOT NULL DEFAULT '1', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `users` +-- + +INSERT INTO `users` (`id`, `first_name`, `last_name`, `email`, `mobile`, `password`, `national_code`, `birth_date`, `gender`, `marital_status`, `spouse_name`, `image`, `username`, `province_id`, `city_id`, `status`, `created_at`, `updated_at`) VALUES +(1, 'شهرزاد', 'زندی', 'shahrzad2020@gmail.com', '09118909120', '$2y$12$exJ7bGMeL8lsMJvdJXYhl.pDRg2tT7tRr.cVstjx0rbQuw04dWgNC', '2080706640', NULL, 2, 1, NULL, 'avatars/FevHjQ0JjviBzlNOGXiI0k1JmshmUIxrDXF3xBAC.jpg', 'shahrzad011', 2, NULL, 1, '2026-08-19 01:09:30', '2026-08-22 06:48:45'), +(2, 'حاتمه', 'اندرزا', 'hatame19@gmail.com', '09119533286', '$2y$12$6AxXNTIpJAK0czNU78PeAObgC.Nl0dTbqKyyMHSGTUrr0GynKyfhq', '2081391693', NULL, 2, 1, NULL, 'users/MU5t6XmUmS558EO4EPQUdO2kDL7XSeDEtoeP83LD.jpg', 'hatame19', 2, NULL, 1, '2026-08-19 06:23:09', '2026-08-19 06:23:09'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `admin_permission` +-- +ALTER TABLE `admin_permission` + ADD CONSTRAINT `fk1_admin_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + ADD CONSTRAINT `fk2_admin_permission` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `bookings` +-- +ALTER TABLE `bookings` + ADD CONSTRAINT `fk1_bookings` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + ADD CONSTRAINT `fk2_bookings` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + ADD CONSTRAINT `fk3_bookings` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `cities` +-- +ALTER TABLE `cities` + ADD CONSTRAINT `fk1_cities` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `comments` +-- +ALTER TABLE `comments` + ADD CONSTRAINT `fk1_ comments` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `favorites` +-- +ALTER TABLE `favorites` + ADD CONSTRAINT `fk1_favorites` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `tours` +-- +ALTER TABLE `tours` + ADD CONSTRAINT `fk1_tours` FOREIGN KEY (`travel_type_id`) REFERENCES `travel_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `tour_flights` +-- +ALTER TABLE `tour_flights` + ADD CONSTRAINT `fk1_tour_flights` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + ADD CONSTRAINT `fk2_tour_flights` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; +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 */;