Files
hatame.andarza09/database/backup/airline_agency (3).sql
T
2026-08-20 17:00:48 +03:30

583 lines
26 KiB
SQL

-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 20, 2026 at 01:29 PM
-- 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 `activity_logs`
--
DROP TABLE IF EXISTS `activity_logs`;
CREATE TABLE IF NOT EXISTS `activity_logs` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` bigint UNSIGNED DEFAULT NULL,
`action` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`model` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`model_id` bigint UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `admin_id` (`admin_id`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `activity_logs`
--
INSERT INTO `activity_logs` (`id`, `admin_id`, `action`, `model`, `model_id`, `description`, `created_at`, `updated_at`) VALUES
(1, 2, 'create', 'Flight', 5, 'ثبت پرواز جدید', '2026-08-19 11:06:42', '2026-08-19 11:06:42'),
(2, 2, 'create', 'Tour', 7, 'ثبت تور جدید', '2026-08-19 15:48:20', '2026-08-19 15:48:20'),
(3, 2, 'create', 'Flight', 6, 'ثبت پرواز جدید', '2026-08-19 15:53:31', '2026-08-19 15:53:31'),
(4, 2, 'create', 'Flight', 7, 'ثبت پرواز جدید', '2026-08-20 05:25:06', '2026-08-20 05:25:06'),
(5, 2, 'create', 'Tour', 7, 'ویرایش تور', '2026-08-20 05:31:43', '2026-08-20 05:31:43'),
(6, 2, 'update', 'Flight', 3, 'ویرایش اطلاعات پرواز', '2026-08-20 06:01:46', '2026-08-20 06:01:46'),
(7, 2, 'update', 'Flight', 2, 'ویرایش اطلاعات پرواز', '2026-08-20 06:45:23', '2026-08-20 06:45:23'),
(8, 2, 'update', 'Flight', 1, 'ویرایش اطلاعات پرواز', '2026-08-20 06:50:12', '2026-08-20 06:50:12'),
(9, 2, 'create', 'Tour', 3, 'ویرایش تور', '2026-08-20 06:50:38', '2026-08-20 06:50:38'),
(10, 2, 'create', 'Tour', 4, 'ویرایش تور', '2026-08-20 06:50:51', '2026-08-20 06:50:51'),
(11, 2, 'create', 'Tour', 5, 'حذف تور', '2026-08-20 06:52:02', '2026-08-20 06:52:02'),
(12, 2, 'create', 'Tour', 5, 'ویرایش تور', '2026-08-20 06:52:48', '2026-08-20 06:52:48'),
(13, 2, 'create', 'Tour', 3, 'ویرایش تور', '2026-08-20 11:36:16', '2026-08-20 11:36:16');
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
DROP TABLE IF EXISTS `admins`;
CREATE TABLE IF NOT EXISTS `admins` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`mobile` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint NOT NULL DEFAULT '1' COMMENT 'Status: Inactive=0, Active=1, Blocked=2',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admins`
--
INSERT INTO `admins` (`id`, `first_name`, `last_name`, `username`, `email`, `mobile`, `password`, `image`, `status`, `created_at`, `updated_at`) VALUES
(2, 'hatame', 'andarza', 'hatame14', 'hatame14@gmail.com', '09119533286', '$2y$12$3ms35N3wjROPUQkTL9hYA.Gd7V4qZqKkKimkWbhApqoZFA7w/UDmy', NULL, 1, '2026-08-18 08:03:58', '2026-08-18 09:14:58'),
(3, 'melika', 'ghobadi', 'melika14', 'hatame@gmail.com', '09119533278', '$2y$12$K9m6JWglserBUoJYg233wupQTIRmP066QQ3jUzSYmCxwJgU3qo.CS', NULL, 1, '2026-08-18 10:23:53', '2026-08-20 11:34:39'),
(4, 'کمند', 'گرزین', 'kamand20', 'kamand20@gmail.com', '09119533234', '$2y$12$cT7u.C0PVgDTnKa6jHRdeO78.rh3HtMuAe9awkElF8WHJ28nP7MeG', NULL, 1, '2026-08-20 11:33:12', '2026-08-20 11:33:12');
-- --------------------------------------------------------
--
-- Table structure for table `admin_roles`
--
DROP TABLE IF EXISTS `admin_roles`;
CREATE TABLE IF NOT EXISTS `admin_roles` (
`admin_id` bigint UNSIGNED NOT NULL,
`role_id` bigint UNSIGNED NOT NULL,
PRIMARY KEY (`admin_id`,`role_id`),
KEY `fk_admin_roles_role` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_roles`
--
INSERT INTO `admin_roles` (`admin_id`, `role_id`) VALUES
(2, 1),
(3, 2);
-- --------------------------------------------------------
--
-- 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(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`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 `cities`
--
INSERT INTO `cities` (`id`, `province_id`, `name`, `created_at`, `updated_at`) VALUES
(3, 3, 'گرگان', '2026-08-20 13:26:22', '2026-08-20 13:26:22');
-- --------------------------------------------------------
--
-- 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 DEFAULT NULL,
`tour_id` bigint UNSIGNED DEFAULT NULL,
`flight_id` bigint UNSIGNED DEFAULT NULL,
`rating` tinyint NOT NULL,
`comment` text COLLATE utf8mb4_unicode_ci,
`status` tinyint NOT NULL DEFAULT '0' COMMENT 'Status: 0=Pending, 1=Approved, 2=Rejected',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `tour_id` (`tour_id`),
KEY `user_id` (`user_id`),
KEY `comments_ibfk_3` (`flight_id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `comments`
--
INSERT INTO `comments` (`id`, `user_id`, `tour_id`, `flight_id`, `rating`, `comment`, `status`, `created_at`, `updated_at`) VALUES
(17, NULL, 2, NULL, 5, 'عالیی', 0, '2026-08-18 04:38:26', '2026-08-18 04:38:26'),
(19, NULL, 5, NULL, 5, 'خیلی تور خوبی بود', 0, '2026-08-18 08:37:10', '2026-08-18 08:37:10'),
(20, 6, NULL, 2, 5, 'asggsz', 0, '2026-08-18 12:03:38', '2026-08-18 12:03:38'),
(22, 8, 2, NULL, 3, NULL, 0, '2026-08-20 08:14:57', '2026-08-20 08:14:57'),
(23, 8, 2, NULL, 4, 'شسیبل', 0, '2026-08-20 08:15:02', '2026-08-20 08:15:02'),
(24, 8, NULL, 5, 3, 'ظطزرذدذرز', 0, '2026-08-20 08:16:22', '2026-08-20 08:16:22'),
(25, 8, 2, NULL, 4, 'سیبلا', 0, '2026-08-20 08:16:45', '2026-08-20 08:16:45'),
(26, 8, 2, NULL, 3, 'asdvbnm', 0, '2026-08-20 08:26:12', '2026-08-20 08:26:12'),
(27, NULL, 5, NULL, 4, 'سیسمنسشت', 0, '2026-08-20 13:11:52', '2026-08-20 13:11:52');
-- --------------------------------------------------------
--
-- 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_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`favoritable_id` bigint UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_favorite` (`user_id`,`favoritable_type`,`favoritable_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `favorites`
--
INSERT INTO `favorites` (`id`, `user_id`, `favoritable_type`, `favoritable_id`, `created_at`) VALUES
(6, 6, 'App\\Models\\Tour', 2, '2026-08-18 11:59:38'),
(7, 6, 'App\\Models\\Tour', 5, '2026-08-18 12:11:45'),
(8, 6, 'App\\Models\\Tour', 3, '2026-08-18 15:09:57');
-- --------------------------------------------------------
--
-- Table structure for table `files`
--
DROP TABLE IF EXISTS `files`;
CREATE TABLE IF NOT EXISTS `files` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`extension` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`size` bigint UNSIGNED NOT NULL,
`original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`path` varchar(255) 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,
`airline` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`flight_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`origin` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`destination` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`departure_date` date DEFAULT NULL,
`departure_time` time DEFAULT NULL,
`arrival_time` time DEFAULT NULL,
`flight_class` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`capacity` int DEFAULT NULL,
`price` decimal(10,2) DEFAULT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`views` int DEFAULT NULL,
`type` int NOT NULL COMMENT 'internal=0\r\n,external=2\r\n,charter=3',
`status` tinyint DEFAULT NULL COMMENT 'Status: 0=Draft, 1=Active, 2=Inactive, 3=Finished, 4=Cancelled',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `flights`
--
INSERT INTO `flights` (`id`, `airline`, `flight_number`, `origin`, `destination`, `departure_date`, `departure_time`, `arrival_time`, `flight_class`, `capacity`, `price`, `image`, `views`, `type`, `status`, `created_at`, `updated_at`) VALUES
(1, 'ایران ایر', 'IR123', 'تهران', 'مشهد', '2026-08-20', '00:20:00', '01:20:00', 'Economy', 150, 2500000.00, 'flights/U8vTS1peDLs2HdwhOjm8eEmSQwdc6BpucTjcTUiy.jpg', 52, 0, 1, '2026-08-17 04:29:53', '2026-08-20 07:28:17'),
(2, 'کیش ایر', 'QR450', 'تهران', 'دوحه', '2026-09-05', '10:17:00', '01:15:00', 'Business', 100, 12000000.00, 'flights/VGSEaXD3bkSu3cR566HNm5CgwMQuTWGlrKRrlrjZ.webp', 48, 0, 1, '2026-08-17 04:32:47', '2026-08-20 08:26:34'),
(5, 'کیش ایر', 'QR432', 'گیلان', 'مازندران', '1405-12-06', '18:36:00', '14:39:00', 'Economy', 3, 1234567.00, 'flights/qiTv8UbV9xsHJH79Ia91gzcTx8RPkFwWqxc6i2ek.jpg', 79, 0, 1, '2026-08-19 11:06:42', '2026-08-20 13:12:20');
-- --------------------------------------------------------
--
-- 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 CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_permissions_name` (`name`),
UNIQUE KEY `uq_permissions_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `permissions`
--
INSERT INTO `permissions` (`id`, `name`, `slug`, `description`, `created_at`, `updated_at`) VALUES
(1, ' درج پرواز\r\n \r\n', ' flight_create \r\n', ' اجازه ثبت پرواز\r\n', '2026-08-18 10:04:41', '2026-08-18 10:04:41'),
(2, 'مدیریت نقش‌ها', 'roles.manage', 'اجازه مدیریت نقش‌ها', '2026-08-20 10:18:50', '2026-08-20 10:18:50');
-- --------------------------------------------------------
--
-- 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(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `provinces`
--
INSERT INTO `provinces` (`id`, `name`, `created_at`, `updated_at`) VALUES
(2, 'تهران', NULL, NULL),
(3, 'گلستان', NULL, NULL),
(5, 'مشهد', NULL, NULL),
(6, 'کردستان', '2026-08-19 14:42:37', '2026-08-19 14:44:33'),
(7, 'کاشان', '2026-08-20 11:41:29', '2026-08-20 11:41:29');
-- --------------------------------------------------------
--
-- Table structure for table `reservations`
--
DROP TABLE IF EXISTS `reservations`;
CREATE TABLE IF NOT EXISTS `reservations` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint UNSIGNED NOT NULL,
`reservable_id` bigint UNSIGNED NOT NULL,
`reservable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` int NOT NULL,
`status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `reservations_user_id_foreign` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `reservations`
--
INSERT INTO `reservations` (`id`, `user_id`, `reservable_id`, `reservable_type`, `price`, `status`, `created_at`, `updated_at`) VALUES
(7, 6, 2, 'App\\Models\\Flight', 12000000, 'pending', '2026-08-18 12:00:15', '2026-08-18 12:00:15'),
(8, 6, 2, 'App\\Models\\Flight', 12000000, 'pending', '2026-08-18 12:03:56', '2026-08-18 12:03:56'),
(9, 6, 1, 'App\\Models\\Flight', 2500000, 'pending', '2026-08-18 12:11:58', '2026-08-18 12:11:58'),
(11, 8, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-20 08:03:49', '2026-08-20 08:03:49'),
(12, 8, 5, 'App\\Models\\Flight', 1234567, 'pending', '2026-08-20 08:04:45', '2026-08-20 08:04:45'),
(13, 8, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-20 08:24:24', '2026-08-20 08:24:24');
-- --------------------------------------------------------
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
CREATE TABLE IF NOT EXISTS `roles` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `roles`
--
INSERT INTO `roles` (`id`, `name`, `slug`, `description`, `created_at`, `updated_at`) VALUES
(1, 'مدیر پرواز', 'flight_manager', 'مدیریت بخش پرواز', '2026-08-18 10:03:15', '2026-08-18 10:03:15'),
(2, 'مدیر تور', 'Tour_management', 'مدیریت بخش تور', '2026-08-18 10:25:58', '2026-08-18 10:25:58'),
(3, 'مدیر کل', 'super_admin', '', '2026-08-20 10:21:57', '2026-08-20 10:21:57');
-- --------------------------------------------------------
--
-- Table structure for table `role_permissions`
--
DROP TABLE IF EXISTS `role_permissions`;
CREATE TABLE IF NOT EXISTS `role_permissions` (
`role_id` bigint UNSIGNED NOT NULL,
`permission_id` bigint UNSIGNED NOT NULL,
PRIMARY KEY (`role_id`,`permission_id`),
KEY `fk_role_permissions_permission` (`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `role_permissions`
--
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(1, 2),
(2, 2),
(3, 2);
-- --------------------------------------------------------
--
-- 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(150) 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=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `settings`
--
INSERT INTO `settings` (`id`, `code`, `value`, `created_at`, `updated_at`) VALUES
(1, 'phone', '02146621888', '2026-08-20 09:26:34', '2026-08-20 09:26:34'),
(2, 'address', 'تهران – فرودگاه مهرآباد – ساختمان مرکزی هواپیمائی جمهوری اسلامی ایران', '2026-08-20 09:31:05', '2026-08-20 09:36:00');
-- --------------------------------------------------------
--
-- Table structure for table `tours`
--
DROP TABLE IF EXISTS `tours`;
CREATE TABLE IF NOT EXISTS `tours` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`summary` text COLLATE utf8mb4_unicode_ci NOT NULL,
`description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`travel_type_id` tinyint UNSIGNED NOT NULL,
`price` decimal(12,2) NOT NULL,
`views` int DEFAULT NULL,
`departure_date` date NOT NULL,
`status` tinyint NOT NULL COMMENT 'Draft=0|Active=1|Inactive=2|Finished=3||Cancelled=4',
`created_by` bigint UNSIGNED DEFAULT NULL,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tours`
--
INSERT INTO `tours` (`id`, `title`, `summary`, `description`, `image`, `travel_type_id`, `price`, `views`, `departure_date`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(2, 'تور 7 روزه مشهد', 'سفر زیارتی به مشهد مقدس با هتل 4 ستاره', 'تور کامل مشهد شامل اقامت، ترانسفر و خدمات گردشگری', 'tours/NcrkjkGosjkeFyPVxlCZo7SW9MgX8BT3AoSMiixl.jpg', 1, 4500000.00, 101, '1405-05-28', 1, NULL, '2026-08-17 07:13:38', '2026-08-20 13:06:11'),
(3, 'تور کیش 5 روزه', 'تور تفریحی کیش با هتل نزدیک دریا', 'سفر به جزیره کیش همراه با اقامت و خدمات ویژه', 'tours/l1z71Rl5OGYigG8RZaCjAHhf2bVRp2cIxxPb6XHb.jpg', 2, 6500000.00, 13, '2026-09-05', 1, NULL, '2026-08-17 07:13:38', '2026-08-20 11:36:16'),
(4, 'تور استانبول 6 روزه', 'تور خارجی استانبول با پرواز رفت و برگشت', 'اقامت در هتل، ترانسفر فرودگاهی و گشت شهری', 'tours/FFofZClobebiouLjQw7nyv5W2h1k4xsgg4URsy3A.webp', 1, 18500000.00, 1, '2026-09-15', 1, NULL, '2026-08-17 07:13:38', '2026-08-20 06:50:51'),
(5, 'تور شمال 3 روزه', 'سفر طبیعت گردی به شمال ایران', 'اقامت در ویلا و بازدید از جاذبه های گردشگری شمال', 'tours/LfCfrtyGvxmx4odwxj4H9qYCbzdEYeJMeZqsry4R.jpg', 1, 2800000.00, 4, '2026-08-28', 1, NULL, '2026-08-17 07:13:38', '2026-08-20 13:11:53');
-- --------------------------------------------------------
--
-- Table structure for table `tour_flights`
--
DROP TABLE IF EXISTS `tour_flights`;
CREATE TABLE IF NOT EXISTS `tour_flights` (
`id` bigint NOT NULL AUTO_INCREMENT,
`tour_id` bigint NOT NULL,
`flight_id` bigint NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `tour_id` (`tour_id`),
KEY `flight_id` (`flight_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,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` tinyint NOT NULL DEFAULT '1' COMMENT 'Status: 0=Inactive, 1=Active',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- 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(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`national_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`gender` tinyint NOT NULL COMMENT 'male:0 | famale:1',
`marital_status` tinyint NOT NULL COMMENT 'single:0|Married:1|Separated:2',
`spouse_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`profile_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`province_id` bigint UNSIGNED DEFAULT NULL,
`city_id` bigint UNSIGNED DEFAULT NULL,
`status` tinyint NOT NULL COMMENT 'Draft=0|Active=1|Inactive=2|Expired=3|Cancelled=4',
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`),
KEY `city_id` (`city_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `first_name`, `last_name`, `national_code`, `gender`, `marital_status`, `spouse_name`, `mobile`, `email`, `profile_image`, `username`, `password`, `province_id`, `city_id`, `status`, `created_at`, `updated_at`) VALUES
(1, 'حاتمه', 'اندرزا', '2081391694', 1, 0, NULL, '09119533286', 'hatame@gmail.com', NULL, 'hatame14', '$2y$12$6OqCJMCgK3I3bckMWzVFse8xmHcsaIzqAE/GULjX74iT.FoZjqaJO', NULL, NULL, 0, '2026-08-16 05:18:26', '2026-08-16 05:18:26'),
(2, 'شهرزاد', 'زندی', '2080706640', 1, 0, NULL, '09112345678', 'shahrzad@gmail.com', NULL, 'shahrzad', '$2y$12$X5fVgkc3d/aYaLnDl6g3lOp5vjJiB0ZEl.1eepjr2e34DnuZQ9fZa', NULL, NULL, 0, '2026-08-16 05:56:30', '2026-08-16 05:56:30'),
(3, 'مینا', 'اسمعیلی', '2011093232', 1, 1, 'مهدی', '09013921486', 'mina@gmail.com', NULL, 'mina14', '$2y$12$7MKYeFaQi0PC1g8q4jQYSe6mVMpPrmGMPLsKvHVVq6Q2Q7Xx4a6qe', NULL, NULL, 0, '2026-08-16 06:38:10', '2026-08-16 06:38:10'),
(6, 'سوگند', 'اصغری', '2150788772', 1, 0, NULL, '09032097811', 'sogand@gmail.com', '1787054360.jpg', 'sogand12', '$2y$12$595f7ziX9RVnQoLen4P11e6PSixIt02WAAi8oQRKGte0JuLN4FPBG', 1, NULL, 0, '2026-08-18 11:59:21', '2026-08-18 11:59:21'),
(8, 'کمند', 'گرزین', '2081391672', 1, 0, NULL, '09119533288', 'kamand19@gmail.com', NULL, 'kamand19', '$2y$12$bkZd2M8RMbGRxl3Naq1UmOmKe5warTAh8SRhE8NK6MwrkmpJHo8ze', 1, NULL, 0, '2026-08-20 07:59:23', '2026-08-20 07:59:23'),
(9, 'کمند', 'گرزین', '2081391623', 1, 0, NULL, '09119533234', 'kamand20@gmail.com', NULL, 'kamand20', '$2y$12$qkQJnRAQ4GdwOF4v8FpZV./zbSRAm8kw0b0JPm1FTd7lKCQ9AUW4q', 6, NULL, 0, '2026-08-20 10:54:47', '2026-08-20 10:54:47');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `admin_roles`
--
ALTER TABLE `admin_roles`
ADD CONSTRAINT `fk_admin_roles_admin` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_admin_roles_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `favorites`
--
ALTER TABLE `favorites`
ADD CONSTRAINT `favorites_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `reservations`
--
ALTER TABLE `reservations`
ADD CONSTRAINT `reservations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `role_permissions`
--
ALTER TABLE `role_permissions`
ADD CONSTRAINT `fk_role_permissions_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_role_permissions_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`city_id`) REFERENCES `cities` (`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 */;