-- phpMyAdmin SQL Dump -- version 5.2.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3308 -- Generation Time: Aug 17, 2026 at 04:32 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 `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, `country` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- 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 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_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(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 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- 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=4 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'); -- -------------------------------------------------------- -- -- 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 `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 NOT NULL, `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci NOT NULL, `duration` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `price` decimal(12,2) NOT NULL, `capacity` int UNSIGNED 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 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- 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, `status` tinyint UNSIGNED NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL, `updated_at` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 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 `comments` -- ALTER TABLE `comments` ADD CONSTRAINT `fk1_ comments` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `fk2_ comments` FOREIGN KEY (`commentable_id`) REFERENCES `comments` (`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, ADD CONSTRAINT `fk2_favorites` FOREIGN KEY (`favoritable_id`) REFERENCES `favorites` (`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 */;