-- phpMyAdmin SQL Dump -- version 5.2.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Aug 18, 2026 at 07:23 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 `airlines` -- DROP TABLE IF EXISTS `airlines`; CREATE TABLE IF NOT EXISTS `airlines` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `country` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `mobile` varchar(11) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `airlines` -- INSERT INTO `airlines` (`id`, `name`, `country`, `mobile`, `status`, `created_at`, `updated_at`) VALUES (2, 'delta', 'iran', '09025347788', 1, '2026-08-16 11:06:00', '2026-08-16 11:06:00'); -- -------------------------------------------------------- -- -- 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` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `country` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `airports` -- INSERT INTO `airports` (`id`, `name`, `city`, `country`, `created_at`, `updated_at`) VALUES (1, 'mehrabad', 'تهران', 'iran', '2026-08-16 11:06:56', '2026-08-16 11:06:56'), (2, 'emam', 'مشهد', 'iran', '2026-08-16 11:07:38', '2026-08-16 11:07:38'); -- -------------------------------------------------------- -- -- 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_persian_ci NOT NULL, `status` tinyint(1) NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `province` (`province_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -------------------------------------------------------- -- -- 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(150) COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `favorites_unique_combo` (`user_id`,`favoritable_id`,`favoritable_type`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `favorites` -- INSERT INTO `favorites` (`id`, `user_id`, `favoritable_id`, `favoritable_type`, `created_at`, `updated_at`) VALUES (12, 4, 1, 'App\\Models\\Tour', '2026-08-18 03:38:11', '2026-08-18 03:38:11'), (13, 4, 3, 'App\\Models\\Flight', '2026-08-18 03:43:20', '2026-08-18 03:43:20'); -- -------------------------------------------------------- -- -- 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `size` int NOT NULL, `original_name` varchar(350) 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 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -------------------------------------------------------- -- -- Table structure for table `flights` -- DROP TABLE IF EXISTS `flights`; CREATE TABLE IF NOT EXISTS `flights` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `flight_number` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `airline_id` bigint UNSIGNED NOT NULL, `origin_airports_id` bigint UNSIGNED NOT NULL, `destination_airports_id` bigint UNSIGNED NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime NOT NULL, `price` bigint NOT NULL, `capacity` int NOT NULL, `status` tinyint NOT NULL COMMENT '0:available|1:full|2:cancelled|3:draft|4:deleyd', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`), KEY `airline_fk1` (`airline_id`), KEY `origin_fk1` (`origin_airports_id`), KEY `destination_fk1` (`destination_airports_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `flights` -- INSERT INTO `flights` (`id`, `flight_number`, `airline_id`, `origin_airports_id`, `destination_airports_id`, `start_time`, `end_time`, `price`, `capacity`, `status`, `created_at`, `updated_at`) VALUES (1, '123456789', 2, 2, 1, '2026-06-10 03:30:00', '2026-08-20 04:30:00', 2000000, 20, 1, '2026-08-16 11:08:26', '2026-08-16 11:08:26'), (2, '987654321', 2, 1, 2, '2026-08-17 14:55:00', '2026-08-18 14:33:00', 2000000, 10, 0, '2026-08-17 11:25:47', '2026-08-17 11:25:47'), (3, '987654321', 2, 1, 2, '2026-08-17 14:55:00', '2026-08-18 14:33:00', 2000000, 10, 0, '2026-08-17 11:28:20', '2026-08-17 11:28:20'); -- -------------------------------------------------------- -- -- 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(128) COLLATE utf8mb4_persian_ci NOT NULL, `status` tinyint(1) 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_persian_ci; -- -- Dumping data for table `provinces` -- INSERT INTO `provinces` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES (1, 'مازندران', 0, '2026-08-16 05:54:31', '2026-08-16 05:54:31'); -- -------------------------------------------------------- -- -- 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(150) COLLATE utf8mb4_persian_ci NOT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `tour_type` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci NOT NULL, `summary` varchar(200) COLLATE utf8mb4_persian_ci NOT NULL, `description` text COLLATE utf8mb4_persian_ci NOT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `origin_airports_id` bigint UNSIGNED NOT NULL, `destination_airports_id` bigint UNSIGNED NOT NULL, PRIMARY KEY (`id`), KEY `file_fk2` (`file_id`), KEY `origin_fk2` (`origin_airports_id`), KEY `destination_fk2` (`destination_airports_id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `tours` -- INSERT INTO `tours` (`id`, `title`, `file_id`, `tour_type`, `summary`, `description`, `created_at`, `updated_at`, `origin_airports_id`, `destination_airports_id`) VALUES (1, 'تور شیراز', NULL, 'تاریخی', 'در اینجا ما خوش میگذرانیم', 'شیسبیسایتغسلبدلیالبرظیذطبسلس', '2026-08-16 12:12:51', '2026-08-16 12:12:51', 1, 2); -- -------------------------------------------------------- -- -- Table structure for table `tour_details` -- DROP TABLE IF EXISTS `tour_details`; CREATE TABLE IF NOT EXISTS `tour_details` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `tour_id` bigint UNSIGNED DEFAULT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `price` int NOT NULL, `capacity` int NOT NULL, `status` tinyint NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `days` int UNSIGNED NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `tour_id` (`tour_id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `tour_details` -- INSERT INTO `tour_details` (`id`, `tour_id`, `start_date`, `end_date`, `price`, `capacity`, `status`, `created_at`, `updated_at`, `days`) VALUES (1, 1, '2026-08-05', '2026-08-19', 2000000, 20, 1, '2026-08-16 11:35:28', '2026-08-16 11:35:28', 5); -- -------------------------------------------------------- -- -- 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(150) COLLATE utf8mb4_persian_ci NOT NULL, `last_name` varchar(150) COLLATE utf8mb4_persian_ci NOT NULL, `national_code` varchar(10) COLLATE utf8mb4_persian_ci NOT NULL, `gender` tinyint(1) NOT NULL COMMENT '1:male | 0:female', `marital_status` tinyint UNSIGNED NOT NULL COMMENT '0:single | 1:married | 2:divorced', `spouse_name` varchar(250) COLLATE utf8mb4_persian_ci DEFAULT NULL, `file_id` bigint UNSIGNED DEFAULT NULL, `mobile` varchar(11) COLLATE utf8mb4_persian_ci NOT NULL, `email` varchar(500) COLLATE utf8mb4_persian_ci NOT NULL, `user_name` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `password` varchar(100) COLLATE utf8mb4_persian_ci NOT NULL, `user_province` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `user_city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_persian_ci DEFAULT NULL, `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `file_fk1` (`file_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `first_name`, `last_name`, `national_code`, `gender`, `marital_status`, `spouse_name`, `file_id`, `mobile`, `email`, `user_name`, `password`, `user_province`, `user_city`, `created_at`, `updated_at`, `deleted_at`) VALUES (4, 'کیارش', 'مصطفی پور', '2081573830', 1, 0, NULL, NULL, '09025347788', 'masomewewe12@gmail.com', 'Kiarash56', '$2y$12$zfGjkwpxVVvpy15.dX9Zjupt54F07Hprgsecz253Hj8vCC60mSZ5i', NULL, NULL, '2026-08-16 02:59:49', '2026-08-17 12:04:38', NULL), (5, 'مینا', 'اسمعیل نژاد', '2110932325', 0, 0, NULL, NULL, '09036097643', 'mina@email.com', 'mina1313', '$2y$12$tB2CHigq23QLCafwZcLTf.tE.lGHZlxmz.u8MtHNRH5rqWr2bAGga', NULL, NULL, '2026-08-16 03:07:54', '2026-08-16 03:07:54', NULL); -- -- Constraints for dumped tables -- -- -- Constraints for table `cities` -- ALTER TABLE `cities` ADD CONSTRAINT `province` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `flights` -- ALTER TABLE `flights` ADD CONSTRAINT `airline_fk1` FOREIGN KEY (`airline_id`) REFERENCES `airlines` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `destination_fk1` FOREIGN KEY (`destination_airports_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `origin_fk1` FOREIGN KEY (`origin_airports_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `tours` -- ALTER TABLE `tours` ADD CONSTRAINT `destination_fk2` FOREIGN KEY (`destination_airports_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `file_fk2` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `origin_fk2` FOREIGN KEY (`origin_airports_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `tour_details` -- ALTER TABLE `tour_details` ADD CONSTRAINT `tour_fk1` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; -- -- Constraints for table `users` -- ALTER TABLE `users` ADD CONSTRAINT `file_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`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 */;