text: -- phpMyAdmin SQL Dump
  -- version 5.1.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Feb 09, 2022 at 02:18 AM
  -- Server version: 10.4.22-MariaDB
  -- PHP Version: 8.1.1
  
  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: `challenge`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `failed_jobs`
  --
  
  CREATE TABLE `failed_jobs` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci 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
  (45, '2014_10_12_000000_create_users_table', 1),
  (46, '2014_10_12_100000_create_password_resets_table', 1),
  (47, '2019_08_19_000000_create_failed_jobs_table', 1),
  (48, '2019_12_14_000001_create_personal_access_tokens_table', 1),
  (49, '2022_02_08_134338_create_payments_table', 1),
  (50, '2022_02_08_134434_create_pembagian_buruhs_table', 1),
  (51, '2022_02_09_002035_add_role_to_user_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `payments`
  --
  
  CREATE TABLE `payments` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `total` int(11) NOT NULL,
    `user_id` bigint(20) UNSIGNED NOT 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 `payments`
  --
  
  INSERT INTO `payments` (`id`, `nama`, `total`, `user_id`, `created_at`, `updated_at`) VALUES
  (6, '2022-02-09 01:14:36', 100000, 1, '2022-02-08 17:14:36', '2022-02-08 17:14:36');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pembagian_buruhs`
  --
  
  CREATE TABLE `pembagian_buruhs` (
    `id_payment` bigint(20) UNSIGNED NOT NULL,
    `no_buruh` int(11) NOT NULL,
    `persentasi` int(11) NOT NULL,
    `bonus` int(11) NOT 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 `pembagian_buruhs`
  --
  
  INSERT INTO `pembagian_buruhs` (`id_payment`, `no_buruh`, `persentasi`, `bonus`, `created_at`, `updated_at`) VALUES
  (6, 1, 50, 50000, '2022-02-08 17:14:36', '2022-02-08 17:14:36'),
  (6, 2, 20, 20000, '2022-02-08 17:14:36', '2022-02-08 17:14:36'),
  (6, 3, 20, 20000, '2022-02-08 17:14:36', '2022-02-08 17:14:36');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `personal_access_tokens`
  --
  
  CREATE TABLE `personal_access_tokens` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `tokenable_id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
    `abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `last_used_at` timestamp NULL DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `role` tinyint(1) NOT NULL DEFAULT 0
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `role`) VALUES
  (1, 'alfianizzah', 'alfianizzah6@gmail.com', NULL, '$2y$10$IH2lfNHb8mlqGUJMgXbBm.kFspeUcnD7pHZDhgxuY4w3FlHj7PvAC', NULL, '2022-02-08 17:02:31', '2022-02-08 17:02:31', 0);
  
  --
  -- 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 `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indexes for table `payments`
  --
  ALTER TABLE `payments`
    ADD PRIMARY KEY (`id`),
    ADD KEY `payments_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `pembagian_buruhs`
  --
  ALTER TABLE `pembagian_buruhs`
    ADD KEY `pembagian_buruhs_id_payment_foreign` (`id_payment`);
  
  --
  -- Indexes for table `personal_access_tokens`
  --
  ALTER TABLE `personal_access_tokens`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
    ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- 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 `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52;
  
  --
  -- AUTO_INCREMENT for table `payments`
  --
  ALTER TABLE `payments`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `personal_access_tokens`
  --
  ALTER TABLE `personal_access_tokens`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `payments`
  --
  ALTER TABLE `payments`
    ADD CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `pembagian_buruhs`
  --
  ALTER TABLE `pembagian_buruhs`
    ADD CONSTRAINT `pembagian_buruhs_id_payment_foreign` FOREIGN KEY (`id_payment`) REFERENCES `payments` (`id`) ON DELETE CASCADE;
  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 */;
  