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

START TRANSACTION;



--
-- Database: `surat`
--

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(255) NOT NULL DEFAULT 'admin',
  `kantor_id` bigint UNSIGNED DEFAULT NULL,
  `bagian_id` bigint UNSIGNED DEFAULT NULL,
  `kategori_surat_id` bigint UNSIGNED DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `role`, `kantor_id`, `bagian_id`, `kategori_surat_id`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 'superadmin@example.com', '2025-10-29 21:59:29', '$2y$12$9McpWEioauzj2Byc06r19OvJlYkwe8NSO8Sz7.aeYLzYzwAjOGgBK', 'superadmin', NULL, NULL, NULL, 'q9FW6jRQUtKpSiZ5Dxg8JO76Lf4iraBfoYpvZSzLpV4DnXrUVnu74kRv7NHZ', '2025-10-29 21:59:30', '2025-10-29 21:59:30'),
(4, 'VINA', 'vina@gmail.com', NULL, '$2y$12$C0FbspZOx.a3qdKpJj19H.f/y.EpNfvP7AZ8gcCObQhQ8T/Fz303C', 'admin', 1, 13, 5, NULL, '2025-10-30 18:25:33', '2025-10-30 19:27:10'),
(5, 'REHAN', 'rehan@gmail.com', NULL, '$2y$12$xMQ0Zl0.d2AcfJSs1Ag7XOPzm1BaeTsqVpKFZJFY73DaepRVERKp6', 'admin', 1, 16, 6, NULL, '2025-10-30 18:25:51', '2025-10-30 19:27:02'),
(6, 'GITA', 'gita@gmail.com', NULL, '$2y$12$sFLW0BEqF4Pz4sAQZcOsLe0hVZ6rOxDwpccUDNyTVJaD6YWUdLPua', 'admin', 3, 15, 8, NULL, '2025-10-30 19:34:44', '2025-10-30 19:37:48');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`),
  ADD KEY `users_kantor_id_foreign` (`kantor_id`),
  ADD KEY `users_bagian_id_foreign` (`bagian_id`),
  ADD KEY `users_kategori_surat_id_foreign` (`kategori_surat_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_bagian_id_foreign` FOREIGN KEY (`bagian_id`) REFERENCES `bagians` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_kantor_id_foreign` FOREIGN KEY (`kantor_id`) REFERENCES `kantors` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_kategori_surat_id_foreign` FOREIGN KEY (`kategori_surat_id`) REFERENCES `kategori_surats` (`id`) ON DELETE SET NULL;
COMMIT;

