-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------



-- Dumping database structure for kursa
CREATE DATABASE IF NOT EXISTS `kursa` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `kursa`;

-- Dumping structure for table kursa.drivers
CREATE TABLE IF NOT EXISTS `drivers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(50) NOT NULL COMMENT 'user email adress',
  `login_id` bigint(20) unsigned NOT NULL COMMENT 'login table id',
  `id_driver_truck` bigint(20) unsigned NOT NULL COMMENT 'driver truck table id',
  `id_place` bigint(20) unsigned NOT NULL COMMENT 'driver place',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping structure for table kursa.failed_jobs
CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.logins: ~0 rows (approximately)

-- Dumping structure for table kursa.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.migrations: ~12 rows (approximately)
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
	(1, '2014_10_12_000000_create_users_table', 1),
	(2, '2014_10_12_100000_create_password_resets_table', 1),
	(3, '2019_08_19_000000_create_failed_jobs_table', 1),
	(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
	(5, '2023_12_09_151130_create_driver_trucks_table', 1),
	(6, '2023_12_09_160938_create_drivers_table', 1),
	(7, '2023_12_09_165750_create_logins_table', 1),
	(8, '2023_12_09_170035_create_places_table', 1),
	(9, '2023_12_09_170426_create_note_tables_table', 1),
	(10, '2023_12_09_170724_create_times_table', 1),
	(11, '2014_10_12_200000_add_two_factor_columns_to_users_table', 2),
	(12, '2024_04_08_161932_create_sessions_table', 2);

-- Dumping structure for table kursa.note_tables
CREATE TABLE IF NOT EXISTS `note_tables` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `id_driver` bigint(20) unsigned NOT NULL COMMENT 'id from table driver',
  `id_time` bigint(20) unsigned NOT NULL COMMENT 'id from table time',
  `id_place` bigint(20) unsigned NOT NULL COMMENT 'id from table place',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.personal_access_tokens: ~0 rows (approximately)

-- Dumping structure for table kursa.places
CREATE TABLE IF NOT EXISTS `places` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ramp_name` varchar(20) NOT NULL COMMENT 'unloading or loading place in company',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.places: ~4 rows (approximately)
INSERT INTO `places` (`id`, `ramp_name`) VALUES
	(1, 'ramp1'),
	(2, 'ramp2'),
	(3, 'ramp3'),
	(4, 'ramp18');

-- Dumping structure for table kursa.sessions
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.sessions: ~4 rows (approximately)
INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
	('De13JkdHd8w4jZ6JarYzWkXztvbKS6zkKRDBBiV1', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiV014SldFTDhaY2t0RHMycjRQUUluWlN2MW4xVFhDcW9BODJIUzFhaCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9sb2dpbiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1717142569),
	('LDzC6Shy6eZSDtWTAxsrtGhrMrDIdU1NIZG6MqwE', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiVFJDdjlDMjJrZnZ6cXVwSzRsODBjdXdsbWI5WUE5eVIzSHdmRHNxUSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9sb2dpbiI7fX0=', 1717069092),
	('SAbx4ejhhJHEmJstde6Dpz6C3gq8BRobVGbVZiFh', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiUks1TG5CVnJ5WFRXbTZ0SzZTRHN5WHlTZDJXMHZBYWRTdzdCOWRKdCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9sb2dpbiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1717142567),
	('TZAaY0n24Qbw0shjir9fvluiJY86ke3bgJbjG5di', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiUGVXdk5GU3NBS2IxNXNleHIyNTl5MFFMMkdFaFJBYXJIVm5oSjY0UiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzA6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9yZWdpc3RlciI7fX0=', 1717143070);

-- Dumping structure for table kursa.times
CREATE TABLE IF NOT EXISTS `times` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `start_time` time NOT NULL COMMENT 'time when driver arrival',
  `end_time` time NOT NULL DEFAULT '08:40:00' COMMENT 'time when finish',
  `date` date NOT NULL COMMENT 'date when driber arrival',
  `driver_id` bigint(20) NOT NULL,
  `place_id` bigint(20) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `driver_id` (`driver_id`),
  KEY `place_id` (`place_id`),
  CONSTRAINT `FK_times_places` FOREIGN KEY (`place_id`) REFERENCES `places` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_times_users` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table kursa.times: ~48 rows (approximately)
INSERT INTO `times` (`id`, `start_time`, `end_time`, `date`, `driver_id`, `place_id`, `created_at`, `updated_at`) VALUES
	(6, '09:35:00', '10:20:00', '2024-04-17', 3, 1, '2024-04-10 05:35:51', '2024-04-10 05:35:51'),
	(7, '09:41:00', '10:26:00', '2024-04-03', 3, 2, '2024-04-10 05:41:06', '2024-04-10 05:41:06'),
	(8, '10:43:00', '11:28:00', '2024-04-10', 3, 4, '2024-04-10 05:43:43', '2024-04-10 05:43:43'),
	(9, '16:55:00', '17:40:00', '2024-05-01', 4, 1, '2024-04-10 13:50:56', '2024-04-10 13:50:56'),
	(10, '18:55:00', '19:40:00', '2024-04-11', 4, 2, '2024-04-10 13:53:52', '2024-04-10 13:53:52'),
	(11, '18:55:00', '19:40:00', '2024-04-11', 4, 1, '2024-04-10 13:54:31', '2024-04-10 13:54:31'),
	(12, '20:19:00', '21:04:00', '2024-04-11', 4, 3, '2024-04-10 14:19:28', '2024-04-10 14:19:28'),
	(13, '16:44:00', '17:29:00', '2024-04-15', 3, 4, '2024-04-15 18:40:04', '2024-04-15 18:40:04'),
	(14, '13:27:00', '14:12:00', '2024-05-24', 5, NULL, '2024-05-24 09:25:34', '2024-05-24 09:25:34'),
	(15, '13:27:00', '14:12:00', '2024-05-24', 5, NULL, '2024-05-24 09:25:36', '2024-05-24 09:25:36'),
	(16, '13:37:00', '14:22:00', '2024-05-24', 5, NULL, '2024-05-24 09:37:50', '2024-05-24 09:37:50'),
	(17, '13:37:00', '14:22:00', '2024-05-24', 5, NULL, '2024-05-24 09:38:00', '2024-05-24 09:38:00'),
	(18, '13:37:00', '14:22:00', '2024-05-24', 5, NULL, '2024-05-24 09:38:05', '2024-05-24 09:38:05'),
	(19, '12:42:00', '13:27:00', '2024-05-16', 5, NULL, '2024-05-24 09:41:36', '2024-05-24 09:41:36'),
	(20, '12:42:00', '13:27:00', '2024-05-16', 5, NULL, '2024-05-24 09:41:52', '2024-05-24 09:41:52'),
	(21, '12:42:00', '13:27:00', '2024-05-24', 5, NULL, '2024-05-24 09:42:04', '2024-05-24 09:42:04'),
	(26, '12:55:00', '13:40:00', '2024-05-08', 5, NULL, '2024-05-24 09:55:00', '2024-05-24 09:55:00'),
	(27, '12:55:00', '13:40:00', '2024-05-08', 5, NULL, '2024-05-24 09:57:09', '2024-05-24 09:57:09'),
	(28, '12:55:00', '13:40:00', '2024-05-08', 5, NULL, '2024-05-24 09:57:20', '2024-05-24 09:57:20'),
	(29, '12:55:00', '13:40:00', '2024-05-08', 5, NULL, '2024-05-24 09:59:06', '2024-05-24 09:59:06'),
	(30, '12:00:00', '12:45:00', '2024-04-30', 5, NULL, '2024-05-24 09:59:19', '2024-05-24 09:59:19'),
	(31, '12:00:00', '12:45:00', '2024-04-30', 5, NULL, '2024-05-24 10:00:45', '2024-05-24 10:00:45'),
	(32, '16:29:00', '17:14:00', '2024-05-25', 5, NULL, '2024-05-24 10:01:09', '2024-05-24 10:01:09'),
	(33, '13:08:00', '13:53:00', '2024-05-17', 5, 1, '2024-05-24 10:06:11', '2024-05-24 10:06:11'),
	(34, '16:09:00', '16:54:00', '2024-05-24', 5, 4, '2024-05-24 10:09:19', '2024-05-24 10:09:19'),
	(35, '13:14:00', '13:59:00', '2024-05-24', 5, 3, '2024-05-24 10:12:33', '2024-05-24 10:12:33'),
	(36, '16:29:00', '17:14:00', '2024-05-25', 5, 1, '2024-05-25 12:05:48', '2024-05-25 12:05:48'),
	(37, '16:29:00', '17:14:00', '2024-05-25', 5, 1, '2024-05-25 12:05:49', '2024-05-25 12:05:49'),
	(38, '18:11:00', '18:56:00', '2024-05-25', 5, 4, '2024-05-25 12:09:26', '2024-05-25 12:57:53'),
	(39, '07:14:00', '07:59:00', '2024-05-25', 5, 1, '2024-05-25 12:14:43', '2024-05-25 12:14:43'),
	(40, '02:25:00', '03:10:00', '2024-05-25', 5, 3, '2024-05-25 12:23:34', '2024-05-25 12:23:34'),
	(41, '02:25:00', '03:10:00', '2024-05-25', 5, 3, '2024-05-25 12:26:37', '2024-05-25 12:26:37'),
	(42, '14:34:00', '15:19:00', '2024-05-25', 5, 3, '2024-05-25 12:26:51', '2024-05-25 12:57:40'),
	(43, '18:06:00', '18:51:00', '2024-05-25', 6, 3, '2024-05-25 13:07:03', '2024-05-25 13:07:03'),
	(44, '13:14:00', '13:59:00', '2024-05-26', 5, 3, '2024-05-26 08:14:17', '2024-05-26 08:14:17'),
	(45, '16:10:00', '16:55:00', '2024-05-26', 5, 1, '2024-05-26 09:10:56', '2024-05-26 09:10:56'),
	(46, '16:10:00', '16:55:00', '2024-05-26', 5, 1, '2024-05-26 09:10:57', '2024-05-26 09:10:57'),
	(51, '13:42:00', '14:27:00', '2024-05-27', 5, 1, '2024-05-27 10:42:40', '2024-05-27 10:42:40'),
	(53, '07:41:00', '08:26:00', '2024-05-28', 5, 3, '2024-05-28 07:37:35', '2024-05-28 07:37:35'),
	(54, '16:19:00', '17:04:00', '2024-05-28', 5, 1, '2024-05-28 13:19:20', '2024-05-28 13:19:20'),
	(55, '13:03:00', '13:48:00', '2024-05-31', 5, 1, '2024-05-31 08:03:49', '2024-05-31 08:03:49'),
	(56, '16:15:00', '17:00:00', '2024-05-31', 5, 1, '2024-05-31 08:04:25', '2024-05-31 08:04:25'),
	(57, '08:15:00', '09:00:00', '2024-05-31', 6, 4, '2024-05-31 08:04:59', '2024-05-31 08:04:59'),
	(58, '16:10:00', '16:55:00', '2024-05-31', 6, 4, '2024-05-31 08:05:17', '2024-05-31 08:05:17'),
	(59, '13:06:00', '13:51:00', '2024-06-01', 6, 3, '2024-05-31 08:06:42', '2024-05-31 08:06:42'),
	(60, '16:06:00', '16:51:00', '2024-06-01', 6, 3, '2024-05-31 08:07:32', '2024-05-31 08:07:32'),
	(61, '21:06:00', '21:51:00', '2024-06-01', 6, 3, '2024-05-31 08:09:00', '2024-05-31 08:09:00'),
	(62, '14:09:00', '14:54:00', '2024-06-02', 6, 1, '2024-05-31 08:09:25', '2024-05-31 08:09:25');

