-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `pgim_leave`
--

-- --------------------------------------------------------

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `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()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `leave_models`
--

CREATE TABLE `leave_models` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL,
  `leave_from` varchar(255) NOT NULL,
  `leave_to` varchar(255) NOT NULL,
  `department` varchar(255) DEFAULT NULL,
  `acting_officer` bigint(20) UNSIGNED NOT NULL,
  `acting_status` varchar(255) NOT NULL DEFAULT 'pending',
  `approve_officer` varchar(255) NOT NULL,
  `approve_status` varchar(255) NOT NULL DEFAULT 'pending',
  `reason` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_models`
--

INSERT INTO `leave_models` (`id`, `user_name`, `type`, `category`, `leave_from`, `leave_to`, `department`, `acting_officer`, `acting_status`, `approve_officer`, `approve_status`, `reason`, `created_at`, `updated_at`) VALUES
(1, NULL, 'Casual', 'Full Day', '2023-08-16', '2023-08-16', NULL, 1, 'rejected', 'Samantha Nanayakkara', 'pending', 'ss', '2023-08-15 23:12:44', '2023-08-15 23:15:27'),
(2, NULL, 'Casual', 'Full Day', '2023-08-16', '2023-08-17', NULL, 1, 'rejected', 'Samantha Nanayakkara', 'pending', NULL, '2023-08-15 23:13:20', '2023-08-15 23:15:28'),
(3, 'Manasha Savindi', 'Casual', 'Full Day', '2023-08-17', '2023-08-17', NULL, 1, 'approved', 'Samantha Nanayakkara', 'pending', NULL, '2023-08-15 23:15:00', '2023-08-15 23:15:29'),
(4, 'Vimukthi', 'Casual', 'Full Day', '2023-08-16', '2023-08-17', NULL, 2, 'approved', 'Samantha Nanayakkara', 'pending', NULL, '2023-08-15 23:16:27', '2023-08-15 23:16:32'),
(5, NULL, 'Casual', 'Full Day', '2023-08-17', '2023-08-17', 'Academic', 1, 'rejected', 'Samantha Nanayakkara', 'pending', 'ddd', '2023-08-15 23:19:27', '2023-08-15 23:24:14'),
(6, 'Manasha Savindi', 'Casual', 'Half Day', '2023-08-17', '2023-08-18', 'Academic', 1, 'approved', 'Yuraji Mahindadasa', 'pending', NULL, '2023-08-15 23:21:41', '2023-08-15 23:24:17'),
(7, 'Manasha Savindi', 'Casual', 'Full Day', '2023-08-19', '2023-08-20', 'Academic', 1, 'approved', 'Samantha Nanayakkara', 'pending', NULL, '2023-08-15 23:24:03', '2023-08-15 23:24:18');

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2019_08_19_000000_create_failed_jobs_table', 1),
(5, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(6, '2023_08_11_054201_create_leave_models_table', 1),
(7, '2023_08_11_074302_create_leave_applications_table', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `leave_models`
--
ALTER TABLE `leave_models`
  ADD PRIMARY KEY (`id`),
  ADD KEY `leave_models_acting_officer_foreign` (`acting_officer`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `leave_models`
--
ALTER TABLE `leave_models`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `leave_models`
--
ALTER TABLE `leave_models`
  ADD CONSTRAINT `leave_models_acting_officer_foreign` FOREIGN KEY (`acting_officer`) REFERENCES `users` (`id`);
COMMIT;

