-- phpMyAdmin SQL Dump -- version 5.2.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Aug 22, 2026 at 04:05 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, `first_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `last_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `role` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:admin | 1:super-admin', `status` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:active |1:inactive', `last_login_at` datetime DEFAULT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `admins_fk1` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `admins` -- INSERT INTO `admins` (`id`, `first_name`, `last_name`, `username`, `email`, `mobile`, `password`, `file_id`, `role`, `status`, `last_login_at`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'مینا', 'اسمعیل نژاد', 'admin1234', NULL, NULL, '$2y$12$PP8Ej5s.jevwrTamfsX/nOs0Z/vrGBVbsm2I/BmZIp9ZtQRB/RBGG', NULL, 1, 0, '2026-08-20 23:31:43', '2026-08-19 04:48:52', '2026-08-20 20:01:43', NULL), (4, 'بهار', 'رضایی', 'baharrezaee', NULL, NULL, '$2y$12$SuLiVUCqG6P2mcOzz.E1LuKuSfA6T0GZYJqSropHjdtiv6GVezC/2', NULL, 0, 0, '2026-08-19 19:17:44', '2026-08-19 15:33:41', '2026-08-19 15:47:44', NULL), (5, 'منصوره', 'سالاری', 'msalary1355', NULL, NULL, '$2y$12$WUNExDa80eSIModDHjvcQuwt7HNs2zoLkLo1SNUrdmdRSRUejMbDO', NULL, 0, 0, NULL, '2026-08-19 15:57:56', '2026-08-19 15:57:56', NULL), (11, 'غزاله', 'طلایی', 'ahootalaee', NULL, NULL, '$2y$12$cQjLjVvd1sybptCldabc3eyKpBMurILV5mw1fVBE8ETTVi9VTlq.O', NULL, 0, 0, NULL, '2026-08-19 16:08:39', '2026-08-20 04:49:44', NULL), (13, 'ابوالفضل', 'اسمعیل نژاد', 'abolfazl1234', NULL, '09113774953', '$2y$12$in2r2zuxup3aUULE8uK0VOtS.C534bEvo7esmStCRdRoB77QuNUom', NULL, 0, 0, NULL, '2026-08-20 04:35:26', '2026-08-20 04:53:34', NULL); -- -------------------------------------------------------- -- -- Table structure for table `admin_avatars` -- DROP TABLE IF EXISTS `admin_avatars`; CREATE TABLE IF NOT EXISTS `admin_avatars` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `file_id` bigint UNSIGNED DEFAULT NULL, `admin_id` bigint UNSIGNED NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `admin_avatars_fk1` (`admin_id`), KEY `admin_avatars_fk2` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `admin_avatars` -- INSERT INTO `admin_avatars` (`id`, `file_id`, `admin_id`, `created_at`, `updated_at`) VALUES (1, 11, 11, '2026-08-19 16:08:39', '2026-08-20 04:51:06'), (2, 9, 13, '2026-08-20 04:35:26', '2026-08-20 04:35:26'), (3, 12, 1, '2026-08-20 04:52:19', '2026-08-20 04:52:19'); -- -------------------------------------------------------- -- -- Table structure for table `admin_permissions` -- DROP TABLE IF EXISTS `admin_permissions`; CREATE TABLE IF NOT EXISTS `admin_permissions` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` bigint UNSIGNED NOT NULL, `permission` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `admin_permission_unique` (`admin_id`,`permission`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `admin_permissions` -- INSERT INTO `admin_permissions` (`id`, `admin_id`, `permission`, `created_at`, `updated_at`) VALUES (1, 2, 'manage-tours', '2026-08-19 11:10:17', '2026-08-19 11:10:17'), (2, 2, 'manage-flights', '2026-08-19 11:10:17', '2026-08-19 11:10:17'), (3, 2, 'manage-comments', '2026-08-19 11:10:17', '2026-08-19 11:10:17'), (4, 2, 'manage-users', '2026-08-19 11:10:17', '2026-08-19 11:10:17'), (5, 2, 'manage-settings', '2026-08-19 11:10:17', '2026-08-19 11:10:17'), (6, 3, 'manage-users', '2026-08-19 14:35:14', '2026-08-19 14:35:14'), (7, 4, 'manage-tours', '2026-08-19 15:33:41', '2026-08-19 15:33:41'), (8, 4, 'manage-flights', '2026-08-19 15:33:41', '2026-08-19 15:33:41'), (9, 5, 'manage-admins', '2026-08-19 15:57:56', '2026-08-19 15:57:56'), (10, 5, 'manage-tours', '2026-08-19 15:57:56', '2026-08-19 15:57:56'), (11, 5, 'manage-flights', '2026-08-19 15:57:56', '2026-08-19 15:57:56'), (12, 5, 'manage-comments', '2026-08-19 15:57:56', '2026-08-19 15:57:56'), (13, 11, 'manage-tours', '2026-08-19 16:08:39', '2026-08-19 16:08:39'), (14, 11, 'manage-flights', '2026-08-19 16:08:39', '2026-08-19 16:08:39'), (15, 12, 'manage-tours', '2026-08-19 16:26:08', '2026-08-19 16:26:08'), (16, 13, 'manage-tours', '2026-08-20 04:35:26', '2026-08-20 04:35:26'), (17, 13, 'manage-flights', '2026-08-20 04:35:26', '2026-08-20 04:35:26'); -- -------------------------------------------------------- -- -- Table structure for table `airlines` -- DROP TABLE IF EXISTS `airlines`; CREATE TABLE IF NOT EXISTS `airlines` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `country_id` bigint UNSIGNED NOT NULL, `phone` varchar(11) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `airlines_fk1` (`country_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `airlines` -- INSERT INTO `airlines` (`id`, `name`, `country_id`, `phone`, `status`, `created_at`, `updated_at`) VALUES (1, 'ماهان', 1, '', 1, '2026-08-16 11:22:55', '2026-08-16 11:22:55'), (3, 'ایرانایر', 1, '', 1, '2026-08-16 11:23:26', '2026-08-16 11:23:26'); -- -------------------------------------------------------- -- -- 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(100) COLLATE utf8mb4_persian_ci NOT NULL, `city_id` bigint UNSIGNED NOT NULL, `status` tinyint NOT NULL DEFAULT '0' COMMENT '0:active | 1:inactive', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `airports_fk1` (`city_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `airports` -- INSERT INTO `airports` (`id`, `name`, `city_id`, `status`, `created_at`, `updated_at`) VALUES (3, 'مهرآباد', 2, 0, '2026-08-16 11:33:52', '2026-08-16 11:33:52'), (4, 'امام خمینی', 1, 0, '2026-08-16 11:33:52', '2026-08-16 11:33:52'), (5, 'شهید بهشتی', 3, 0, '2026-08-16 11:36:53', '2026-08-16 11:36:53'); -- -------------------------------------------------------- -- -- Table structure for table `booking` -- DROP TABLE IF EXISTS `booking`; CREATE TABLE IF NOT EXISTS `booking` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` bigint UNSIGNED NOT NULL, `flight_id` bigint UNSIGNED DEFAULT NULL, `tour_departure_id` bigint UNSIGNED DEFAULT NULL, `total_price` int UNSIGNED NOT NULL, `status` tinyint NOT NULL DEFAULT '0' COMMENT '0:open | 1:Full', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `booking_type` varchar(20) COLLATE utf8mb4_persian_ci NOT NULL, PRIMARY KEY (`id`), KEY `booking_fk1` (`user_id`), KEY `booking_fk2` (`tour_departure_id`), KEY `booking_fk3` (`flight_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -------------------------------------------------------- -- -- Table structure for table `booking_passengers` -- DROP TABLE IF EXISTS `booking_passengers`; CREATE TABLE IF NOT EXISTS `booking_passengers` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `booking_id` bigint UNSIGNED NOT NULL, `passenger_id` bigint UNSIGNED NOT NULL, `passenger_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:adult | 1:child ', `seat_number` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `ticket_number` varchar(30) COLLATE utf8mb4_persian_ci NOT NULL, `price` int UNSIGNED NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:reserved | 1:issued | 2:cancelled', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -------------------------------------------------------- -- -- Table structure for table `cities` -- DROP TABLE IF EXISTS `cities`; CREATE TABLE IF NOT EXISTS `cities` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `county_id` bigint UNSIGNED NOT NULL, `province_id` bigint UNSIGNED DEFAULT NULL, `name` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint NOT NULL DEFAULT '1' COMMENT '0:disable | 1:enable', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `cities_fk1` (`county_id`), KEY `cities_fk2` (`province_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `cities` -- INSERT INTO `cities` (`id`, `county_id`, `province_id`, `name`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, 1, 'ساری', 1, '2026-08-16 05:28:05', '2026-08-16 05:28:05', NULL), (2, 1, 2, 'تهران', 1, '2026-08-16 11:32:54', '2026-08-16 11:32:54', NULL), (3, 1, 3, 'اصفهان', 1, '2026-08-16 11:34:51', '2026-08-16 11:34:51', NULL), (4, 1, 4, 'بوشهر', 1, '2026-08-17 12:29:45', '2026-08-17 12:29:45', NULL), (5, 1, 1, 'بابل', 1, '2026-08-18 04:49:52', '2026-08-18 04:49:52', NULL), (6, 1, 5, 'مشهد', 1, '2026-08-20 05:11:41', '2026-08-20 05:11:41', NULL), (7, 1, 5, 'گلبهار', 1, '2026-08-20 05:11:41', '2026-08-20 05:11:41', NULL), (8, 2, NULL, 'استانبول', 1, '2026-08-20 06:15:36', '2026-08-20 06:15:36', NULL), (9, 2, NULL, 'آنتالیا', 1, '2026-08-20 06:15:36', '2026-08-20 06:15:36', NULL); -- -------------------------------------------------------- -- -- 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, `admin_id` bigint UNSIGNED DEFAULT NULL, `tour_id` bigint UNSIGNED DEFAULT NULL, `flight_id` bigint UNSIGNED DEFAULT NULL, `parent_id` bigint UNSIGNED DEFAULT NULL, `guest_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `guest_email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:pending | 1:confirmed | 2:rejected', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `comments_fk1` (`flight_id`), KEY `comments_fk2` (`tour_id`), KEY `comments_fk3` (`user_id`), KEY `comments_fk4` (`admin_id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`id`, `user_id`, `admin_id`, `tour_id`, `flight_id`, `parent_id`, `guest_name`, `guest_email`, `content`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 2, NULL, NULL, 4, NULL, NULL, NULL, 'خوب بود', 0, '2026-08-18 07:59:40', '2026-08-18 07:59:40', NULL), (2, NULL, NULL, NULL, 3, NULL, 'مینا', 'mina@gmail.com', 'عالی بود', 0, '2026-08-18 08:42:19', '2026-08-18 08:42:19', NULL), (3, NULL, NULL, NULL, 4, NULL, 'مینا', 'mina@gmail.com', 'راضی بودم', 0, '2026-08-18 10:53:37', '2026-08-18 10:53:37', NULL), (4, NULL, NULL, NULL, 3, NULL, 'علی', 'ali@gamil.com', 'خوب نبود', 0, '2026-08-18 11:14:29', '2026-08-18 11:14:29', NULL), (5, NULL, NULL, NULL, 3, NULL, 'عسل', 'asal@gamil.com', 'خوب است', 0, '2026-08-18 11:21:47', '2026-08-18 11:21:47', NULL), (6, 2, NULL, NULL, 4, NULL, NULL, NULL, 'افتضاح بود', 0, '2026-08-18 12:16:38', '2026-08-18 12:16:38', NULL), (7, 2, NULL, 4, NULL, NULL, NULL, NULL, 'بد بود', 0, '2026-08-18 12:25:19', '2026-08-18 12:25:19', NULL), (8, NULL, NULL, 4, NULL, NULL, 'زهرا', 'zahra@gmail.com', 'من راضی بودم', 0, '2026-08-18 12:28:49', '2026-08-18 12:28:49', NULL), (9, NULL, NULL, 11, NULL, NULL, 'مینا', 'mina@gmail.com', 'خوب بود', 0, '2026-08-20 13:22:18', '2026-08-20 13:22:18', NULL), (10, NULL, NULL, 11, NULL, NULL, 'مجید', 'majid@gamil.com', 'خوب نبود', 0, '2026-08-20 13:25:27', '2026-08-20 13:25:27', NULL); -- -------------------------------------------------------- -- -- Table structure for table `countries` -- DROP TABLE IF EXISTS `countries`; CREATE TABLE IF NOT EXISTS `countries` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint UNSIGNED NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `countries` -- INSERT INTO `countries` (`id`, `name`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'iran', 0, '2026-08-16 05:27:45', '2026-08-16 05:27:45', NULL), (2, 'ترکیه', 0, '2026-08-20 06:13:59', '2026-08-20 06:13:59', NULL), (3, 'دبی', 0, '2026-08-20 06:13:59', '2026-08-20 06:13:59', NULL); -- -------------------------------------------------------- -- -- Table structure for table `daily_site_views` -- DROP TABLE IF EXISTS `daily_site_views`; CREATE TABLE IF NOT EXISTS `daily_site_views` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `view_date` date NOT NULL, `views_count` bigint UNSIGNED NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `view_date` (`view_date`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `daily_site_views` -- INSERT INTO `daily_site_views` (`id`, `view_date`, `views_count`, `created_at`, `updated_at`) VALUES (1, '2026-08-20', 33, '2026-08-20 12:39:51', '2026-08-20 20:05:44'), (2, '2026-08-21', 6, '2026-08-21 10:06:07', '2026-08-21 10:08:36'); -- -------------------------------------------------------- -- -- 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, `tour_id` bigint UNSIGNED DEFAULT NULL, `flight_id` bigint UNSIGNED DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `favorites_user_id_foreign` (`user_id`), KEY `favorites_tour_id_foreign` (`tour_id`), KEY `favorites_flight_id_foreign` (`flight_id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `favorites` -- INSERT INTO `favorites` (`id`, `user_id`, `tour_id`, `flight_id`, `created_at`, `updated_at`) VALUES (4, 2, NULL, 4, '2026-08-18 15:09:20', '2026-08-18 15:09:20'), (5, 2, 4, NULL, '2026-08-18 15:09:30', '2026-08-18 15:09:30'), (6, 2, 2, NULL, '2026-08-18 15:09:34', '2026-08-18 15:09:34'), (7, 2, 3, NULL, '2026-08-18 15:09:38', '2026-08-18 15:09:38'); -- -------------------------------------------------------- -- -- 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_persian_ci NOT NULL, `extension` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `size` bigint UNSIGNED NOT NULL, `original_name` varchar(255) COLLATE utf8mb4_persian_ci NOT NULL, `path` varchar(255) COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `files` -- INSERT INTO `files` (`id`, `name`, `extension`, `size`, `original_name`, `path`, `created_at`, `updated_at`) VALUES (1, '1786862535_73435.jpg', 'jpg', 25289, 'images (1).jpg', 'user_avatar/1786862535_73435.jpg', '2026-08-16 06:42:15', '2026-08-16 06:42:15'), (8, '11_1787155719_74743.jpg', 'jpg', 30953, 'images.jpg', 'admin_avatars/11_1787155719_74743.jpg', '2026-08-19 16:08:39', '2026-08-19 16:08:39'), (9, '13_1787200526_86051.jpg', 'jpg', 30953, 'images.jpg', 'admin_avatars/13_1787200526_86051.jpg', '2026-08-20 04:35:26', '2026-08-20 04:35:26'), (11, '11_178720146657526.jpg', 'jpg', 25289, 'images (1).jpg', 'admin_avatars/11_178720146657526.jpg', '2026-08-20 04:51:06', '2026-08-20 04:51:06'), (12, '1_178720153930823.webp', 'webp', 25940, 'irs01_s3old_1616608645393781483.webp', 'admin_avatars/1_178720153930823.webp', '2026-08-20 04:52:19', '2026-08-20 04:52:19'), (13, '6_178720429060270.jpg', 'jpg', 220707, 'single-1.jpg', 'tour_images/6_178720429060270.jpg', '2026-08-20 05:38:10', '2026-08-20 05:38:10'), (14, '6_178720429088871.jpg', 'jpg', 175429, 'single-2.jpg', 'tour_images/6_178720429088871.jpg', '2026-08-20 05:38:10', '2026-08-20 05:38:10'), (15, '8_178720517117865.jpg', 'jpg', 175429, 'single-2.jpg', 'tour_images/8_178720517117865.jpg', '2026-08-20 05:52:51', '2026-08-20 05:52:51'), (16, '9_178720688952113.jpg', 'jpg', 184436, 'single-3.jpg', 'tour_images/9_178720688952113.jpg', '2026-08-20 06:21:29', '2026-08-20 06:21:29'), (17, '10_178721145781765.jpg', 'jpg', 175429, 'single-2.jpg', 'tour_images/10_178721145781765.jpg', '2026-08-20 07:37:37', '2026-08-20 07:37:37'), (18, '12_178721289783346.jpg', 'jpg', 175429, 'single-2.jpg', 'tour_images/12_178721289783346.jpg', '2026-08-20 08:01:37', '2026-08-20 08:01:37'); -- -------------------------------------------------------- -- -- Table structure for table `flights` -- DROP TABLE IF EXISTS `flights`; CREATE TABLE IF NOT EXISTS `flights` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `airline_id` bigint UNSIGNED NOT NULL, `origin_airport_id` bigint UNSIGNED NOT NULL, `destination_airport_id` bigint UNSIGNED NOT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `flight_number` varchar(20) COLLATE utf8mb4_persian_ci NOT NULL, `trip_type` tinyint NOT NULL DEFAULT '0' COMMENT '0:One-way | 1:round-trip', `departure_time` datetime NOT NULL, `arrival_time` datetime NOT NULL, `price` int UNSIGNED NOT NULL, `capacity` int UNSIGNED NOT NULL, `status` tinyint NOT NULL DEFAULT '0' COMMENT '0:available| 1:full|\r\n2:cancelled| 3:draft| 4:Delayed ', `views_count` int UNSIGNED NOT NULL DEFAULT '0', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `flights_fk1` (`airline_id`), KEY `flights_fk2` (`origin_airport_id`), KEY `flights_fk3` (`destination_airport_id`), KEY `flights_fk4` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `flights` -- INSERT INTO `flights` (`id`, `airline_id`, `origin_airport_id`, `destination_airport_id`, `file_id`, `flight_number`, `trip_type`, `departure_time`, `arrival_time`, `price`, `capacity`, `status`, `views_count`, `created_at`, `updated_at`) VALUES (3, 1, 4, 5, NULL, '1122334455', 0, '2026-08-17 05:08:14', '2026-08-17 05:08:14', 100000000, 100, 0, 12, '2026-08-17 05:08:38', '2026-08-20 13:05:27'), (4, 3, 5, 3, NULL, '123456789', 1, '2026-08-17 07:42:51', '2026-08-17 07:42:51', 200000000, 200, 0, 0, '2026-08-17 07:43:28', '2026-08-17 07:43:28'); -- -------------------------------------------------------- -- -- Table structure for table `flight_images` -- DROP TABLE IF EXISTS `flight_images`; CREATE TABLE IF NOT EXISTS `flight_images` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `flight_id` bigint UNSIGNED NOT NULL, `file_id` bigint UNSIGNED NOT NULL, `sort_order` int DEFAULT '0', `is_default` tinyint(1) DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `flight_id` (`flight_id`), KEY `file_id` (`file_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -------------------------------------------------------- -- -- Table structure for table `passengers` -- DROP TABLE IF EXISTS `passengers`; CREATE TABLE IF NOT EXISTS `passengers` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` bigint UNSIGNED NOT NULL, `first_name` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `last_name` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `national_code` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `passport_number` varchar(20) COLLATE utf8mb4_persian_ci NOT NULL, `gender` tinyint UNSIGNED NOT NULL, `birth_date` date DEFAULT NULL, `mobile` varchar(11) COLLATE utf8mb4_persian_ci NOT NULL, `email` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `nationality` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `passengers_fk1` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_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(64) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint NOT NULL DEFAULT '1' COMMENT '0:disable | 1:enable', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `provinces` -- INSERT INTO `provinces` (`id`, `name`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'مازندران', 1, '2026-08-16 05:27:10', '2026-08-16 05:27:10', NULL), (2, 'تهران', 1, '2026-08-16 11:32:42', '2026-08-16 11:32:42', NULL), (3, 'اصفهان', 1, '2026-08-16 11:34:36', '2026-08-16 11:34:36', NULL), (4, 'بوشهر', 1, '2026-08-17 12:29:24', '2026-08-17 12:29:24', NULL), (5, 'خراسان رضوی', 1, '2026-08-20 05:11:15', '2026-08-20 05:11:15', NULL); -- -------------------------------------------------------- -- -- 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(100) COLLATE utf8mb4_persian_ci NOT NULL, `summary` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci, `origin_city_id` bigint UNSIGNED NOT NULL, `destination_city_id` bigint UNSIGNED NOT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `tour_type` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:RECREATIONAL | 1:TOURISM | 2:PILGRIMAGE | 3:ECO_TOURISM ', `tour_scope` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:domestic | 1:international', `tour_mode` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:air | 1:land', `views_count` int UNSIGNED NOT NULL DEFAULT '0', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tours_fk2` (`origin_city_id`), KEY `tours_fk3` (`destination_city_id`), KEY `tours_fk1` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `tours` -- INSERT INTO `tours` (`id`, `title`, `summary`, `description`, `origin_city_id`, `destination_city_id`, `file_id`, `tour_type`, `tour_scope`, `tour_mode`, `views_count`, `created_at`, `updated_at`, `deleted_at`) VALUES (2, 'تور شمال', 'تور طبیعت گردی', 'تجربه سفر به [نام مقصد]؛ اقامت، تفریحات و گشت‌وگذار در سفری برنامه‌ریزی‌شده و مطمئن. همین حالا رزرو کنید!', 2, 1, NULL, 0, 0, 0, 0, '2026-08-17 04:47:45', '2026-08-17 04:47:45', NULL), (3, 'تور کویر', 'کویر', 'تجربه سفر به [نام مقصد]؛ اقامت، تفریحات و گشت‌وگذار در سفری برنامه‌ریزی‌شده و مطمئن. همین حالا رزرو کنید!', 2, 3, NULL, 0, 0, 0, 0, '2026-08-17 12:11:41', '2026-08-17 12:11:41', NULL), (4, 'تور اصفهان', 'تور گردشگری', 'تجربه سفر به [نام مقصد]؛ اقامت، تفریحات و گشت‌وگذار در سفری برنامه‌ریزی‌شده و مطمئن. همین حالا رزرو کنید!', 1, 3, NULL, 0, 0, 0, 14, '2026-08-17 12:28:15', '2026-08-20 05:33:20', NULL), (5, 'تور جنوب', 'تور جنوب', 'تجربه سفر به [نام مقصد]؛ اقامت، تفریحات و گشت‌وگذار در سفری برنامه‌ریزی‌شده و مطمئن. همین حالا رزرو کنید!', 1, 4, NULL, 0, 0, 0, 0, '2026-08-17 12:30:30', '2026-08-17 12:30:30', NULL), (6, 'تور مشهد', 'تور زیارتی مشهد را با ما تجربه کنید', NULL, 1, 6, NULL, 2, 0, 0, 0, '2026-08-20 05:38:10', '2026-08-20 05:38:10', NULL), (7, 'تور مشهد', 'تور زیارتی را با ما تجربه کنید', NULL, 1, 6, NULL, 2, 0, 0, 0, '2026-08-20 05:47:28', '2026-08-20 05:47:28', NULL), (8, 'تور تهران', 'تور تهران', NULL, 2, 1, NULL, 0, 0, 0, 0, '2026-08-20 05:52:51', '2026-08-20 05:52:51', NULL), (9, 'تور استانبول', 'تور آنتالیا را با ما تجربه کنید', NULL, 2, 8, NULL, 0, 1, 0, 0, '2026-08-20 06:21:29', '2026-08-20 06:21:29', NULL), (10, 'تور ساری', 'تور ساری لذت ببرید', NULL, 2, 1, NULL, 3, 0, 0, 0, '2026-08-20 07:37:37', '2026-08-20 07:37:37', NULL), (11, 'تور بابل', 'تور بابل', NULL, 1, 5, NULL, 0, 0, 0, 14, '2026-08-20 07:40:15', '2026-08-20 13:27:32', NULL), (12, 'تور نوروزی', 'تور نوروزی برای ثبت خاطرات', NULL, 6, 1, NULL, 0, 0, 0, 0, '2026-08-20 07:55:39', '2026-08-20 08:17:44', NULL), (13, 'تور بهاره', 'تور بهاره', NULL, 1, 5, NULL, 0, 0, 0, 1, '2026-08-20 09:20:00', '2026-08-20 09:20:33', NULL); -- -------------------------------------------------------- -- -- Table structure for table `tour_departures` -- DROP TABLE IF EXISTS `tour_departures`; CREATE TABLE IF NOT EXISTS `tour_departures` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `tour_id` bigint UNSIGNED NOT NULL, `start_date` datetime NOT NULL, `end_date` datetime NOT NULL, `price` bigint UNSIGNED NOT NULL, `capacity` int UNSIGNED NOT NULL, `status` tinyint NOT NULL DEFAULT '0' COMMENT '0:active | 1:sold out | 2:canceled', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `tour_departures_fk1` (`tour_id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `tour_departures` -- INSERT INTO `tour_departures` (`id`, `tour_id`, `start_date`, `end_date`, `price`, `capacity`, `status`, `created_at`, `updated_at`) VALUES (1, 2, '2026-08-17 04:52:54', '2026-08-17 04:52:54', 10000000, 20, 0, '2026-08-17 04:53:23', '2026-08-17 04:53:23'), (2, 3, '2026-08-17 12:12:07', '2026-08-17 12:12:07', 6000000, 40, 0, '2026-08-17 12:12:27', '2026-08-17 12:12:27'), (4, 4, '2026-08-17 12:28:31', '2026-08-17 12:28:31', 2000000, 20, 0, '2026-08-17 12:28:45', '2026-08-17 12:28:45'), (5, 5, '2026-08-17 12:30:46', '2026-08-17 12:30:46', 5000000, 20, 0, '2026-08-17 12:31:05', '2026-08-17 12:31:05'), (6, 6, '2026-08-21 09:00:00', '2026-08-22 11:00:00', 20000000, 30, 1, '2026-08-20 05:38:10', '2026-08-20 05:38:10'), (7, 7, '2026-08-22 12:00:00', '2026-08-22 16:00:00', 50000000, 50, 1, '2026-08-20 05:47:28', '2026-08-20 05:47:28'), (8, 8, '2026-08-22 09:21:00', '2026-08-23 09:21:00', 100000000, 20, 1, '2026-08-20 05:52:51', '2026-08-20 05:52:51'), (9, 9, '2026-08-24 15:00:00', '2026-09-10 17:00:00', 150000000, 30, 1, '2026-08-20 06:21:29', '2026-08-20 06:21:29'), (10, 9, '2026-08-20 06:34:33', '2026-08-20 06:34:33', 400000000, 30, 0, '2026-08-20 06:34:51', '2026-08-20 06:34:51'), (11, 10, '2026-08-21 11:06:00', '2026-08-26 11:06:00', 20000000, 10, 1, '2026-08-20 07:37:37', '2026-08-20 07:37:37'), (12, 11, '2026-08-22 11:08:00', '2026-08-23 11:08:00', 392000000, 40, 1, '2026-08-20 07:40:15', '2026-08-20 07:40:15'), (13, 12, '2026-07-27 11:32:00', '2026-09-01 14:24:00', 100000000, 10, 1, '2026-08-20 07:55:39', '2026-08-20 08:02:29'), (14, 13, '2026-08-21 12:48:00', '2026-08-23 12:48:00', 50000000, 20, 1, '2026-08-20 09:20:00', '2026-08-20 09:20:00'); -- -------------------------------------------------------- -- -- Table structure for table `tour_images` -- DROP TABLE IF EXISTS `tour_images`; CREATE TABLE IF NOT EXISTS `tour_images` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `tour_id` bigint UNSIGNED NOT NULL, `file_id` bigint UNSIGNED NOT NULL, `sort_order` int DEFAULT '0', `is_default` tinyint(1) DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `tour_id` (`tour_id`), KEY `file_id` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `tour_images` -- INSERT INTO `tour_images` (`id`, `tour_id`, `file_id`, `sort_order`, `is_default`, `created_at`, `updated_at`) VALUES (3, 8, 15, 1, 1, '2026-08-20 05:52:51', '2026-08-20 05:52:51'), (4, 9, 16, 1, 1, '2026-08-20 06:21:29', '2026-08-20 06:21:29'), (5, 10, 17, 1, 1, '2026-08-20 07:37:37', '2026-08-20 07:37:37'), (6, 12, 18, 1, 1, '2026-08-20 08:01:37', '2026-08-20 08:01:37'); -- -------------------------------------------------------- -- -- 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(64) COLLATE utf8mb4_persian_ci NOT NULL, `last_name` varchar(64) COLLATE utf8mb4_persian_ci NOT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `city_id` bigint UNSIGNED DEFAULT NULL, `province_id` bigint UNSIGNED DEFAULT NULL, `national_code` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `gender` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT 'unknown:0 | male:1 | female:2', `marital_status` tinyint UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:single | 1:married | divorced:2', `spouse_name` varchar(255) COLLATE utf8mb4_persian_ci DEFAULT NULL, `mobile` varchar(11) COLLATE utf8mb4_persian_ci NOT NULL, `email` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `username` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0:disable | 1:enable', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_fk1` (`file_id`), KEY `users_fk2` (`province_id`), KEY `users_fk3` (`city_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `first_name`, `last_name`, `file_id`, `city_id`, `province_id`, `national_code`, `gender`, `marital_status`, `spouse_name`, `mobile`, `email`, `username`, `password`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'مینا', 'اسمعیل نژاد', 1, NULL, NULL, '2110932325', 2, 0, NULL, '09036097643', 'mina.esmaeilnezhad@gmail.com', 'mina1380', '$2y$12$UkwtoQHohaO6i9hcbxlQSeryVq/BS8CzFV0EzfY8/oeQYSsrf.rAC', 1, '2026-08-16 06:42:15', '2026-08-19 10:12:32', NULL), (2, 'کیارش', 'مصطفی پور', NULL, 2, 2, '2110932324', 1, 0, NULL, '09366554264', 'kia@gmail.com', 'Kiarash1389', '$2y$12$K8tdWW.qApv9JF2bHwwHEuT7iU3Q2y8N2IG2nuoPbw2p4SnCOW5qq', 1, '2026-08-16 07:24:44', '2026-08-18 05:40:50', NULL); -- -- Constraints for dumped tables -- -- -- Constraints for table `admins` -- ALTER TABLE `admins` ADD CONSTRAINT `admins_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `admin_avatars` -- ALTER TABLE `admin_avatars` ADD CONSTRAINT `admin_avatars_fk1` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `admin_avatars_fk2` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `airlines` -- ALTER TABLE `airlines` ADD CONSTRAINT `airlines_fk1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `airports` -- ALTER TABLE `airports` ADD CONSTRAINT `airports_fk1` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `booking` -- ALTER TABLE `booking` ADD CONSTRAINT `booking_fk1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `booking_fk2` FOREIGN KEY (`tour_departure_id`) REFERENCES `tour_departures` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `booking_fk3` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `cities` -- ALTER TABLE `cities` ADD CONSTRAINT `cities_fk1` FOREIGN KEY (`county_id`) REFERENCES `countries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `cities_fk2` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `comments` -- ALTER TABLE `comments` ADD CONSTRAINT `comments_fk1` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `comments_fk2` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `comments_fk3` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `comments_fk4` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `flights` -- ALTER TABLE `flights` ADD CONSTRAINT `flights_fk1` FOREIGN KEY (`airline_id`) REFERENCES `airlines` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `flights_fk2` FOREIGN KEY (`origin_airport_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `flights_fk3` FOREIGN KEY (`destination_airport_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `flights_fk4` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `passengers` -- ALTER TABLE `passengers` ADD CONSTRAINT `passengers_fk1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `tours` -- ALTER TABLE `tours` ADD CONSTRAINT `tours_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `tours_fk2` FOREIGN KEY (`origin_city_id`) REFERENCES `cities` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `tours_fk3` FOREIGN KEY (`destination_city_id`) REFERENCES `cities` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `tour_departures` -- ALTER TABLE `tour_departures` ADD CONSTRAINT `tour_departures_fk1` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `users` -- ALTER TABLE `users` ADD CONSTRAINT `users_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `users_fk2` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `users_fk3` 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 */;