text: -- phpMyAdmin SQL Dump
  -- version 4.8.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Waktu pembuatan: 08 Feb 2019 pada 07.27
  -- Versi server: 10.1.37-MariaDB
  -- Versi PHP: 7.3.0
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  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: `assignment_online`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `assignment`
  --
  
  CREATE TABLE `assignment` (
    `id` int(10) UNSIGNED NOT NULL,
    `project_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `io_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `assignment_class` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `assignment_tittle` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `assignment_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `assignment_report`
  --
  
  CREATE TABLE `assignment_report` (
    `id` int(10) UNSIGNED NOT NULL,
    `dispose_assignment_id` int(10) UNSIGNED NOT NULL,
    `assignment_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `time_record_id` int(10) UNSIGNED NOT NULL,
    `customer_info_id` int(10) UNSIGNED NOT NULL,
    `sppd_status` tinyint(1) NOT NULL DEFAULT '0',
    `day_number` int(11) NOT NULL,
    `brief_work` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `bai` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `tnc` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `photos` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `other` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `result` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `customer_info`
  --
  
  CREATE TABLE `customer_info` (
    `id` int(10) UNSIGNED NOT NULL,
    `company` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `address` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `cp` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `pic` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `dispose_assignment`
  --
  
  CREATE TABLE `dispose_assignment` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `assignment_id` int(10) UNSIGNED NOT NULL,
    `rating` double(8,2) NOT NULL DEFAULT '0.00',
    `is_leader` tinyint(1) NOT NULL DEFAULT '0',
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `history`
  --
  
  CREATE TABLE `history` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `assignment_id` int(10) UNSIGNED NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `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 untuk tabel `migrations`
  --
  
  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_02_06_040253_create_role_table', 1),
  (4, '2019_02_06_041534_update_users_table', 1),
  (5, '2019_02_07_070655_create_dispose_assignment_table', 1),
  (6, '2019_02_07_071527_create_assignment_table', 1),
  (7, '2019_02_07_071905_create_assignment_report_table', 1),
  (8, '2019_02_07_072925_create_time_record_table', 1),
  (9, '2019_02_07_074705_create_customer_info_table', 1),
  (10, '2019_02_07_074851_create_history_table', 1),
  (11, '2019_02_07_075441_update_dispose_assignment_table_for_relation', 1),
  (12, '2019_02_07_075900_update_assignment_report_table_for_relation', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `role`
  --
  
  CREATE TABLE `role` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci 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 untuk tabel `role`
  --
  
  INSERT INTO `role` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Manager', NULL, NULL),
  (2, 'SPV', NULL, NULL),
  (3, 'PLT', NULL, NULL),
  (4, 'Field Engineer', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `time_record`
  --
  
  CREATE TABLE `time_record` (
    `id` int(10) UNSIGNED NOT NULL,
    `date_work` date NOT NULL,
    `time_start` time NOT NULL,
    `time_at` time NOT NULL,
    `time_job_finish` time NOT NULL,
    `time_end` time NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `full_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token_api` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role_id` int(10) UNSIGNED NOT NULL,
    `picture` varchar(191) COLLATE utf8mb4_unicode_ci 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 untuk tabel `users`
  --
  
  INSERT INTO `users` (`id`, `username`, `email`, `password`, `full_name`, `token_api`, `role_id`, `picture`, `created_at`, `updated_at`) VALUES
  (1, 'user', 'user@example.com', '$2y$10$8dJuQGeOismM1HVAscT8zukV4XnqYerteoSFhbMNwJkgaaDcN3FRe', 'User Aman', '$2y$10$D12NVP.9bRpeVma1hhlGZOILb4drQ67rwT2y2Urb9AQ7d6TlKAP4K', 1, NULL, NULL, NULL);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indeks untuk tabel `assignment`
  --
  ALTER TABLE `assignment`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `assignment_report`
  --
  ALTER TABLE `assignment_report`
    ADD PRIMARY KEY (`id`),
    ADD KEY `assignment_report_dispose_assignment_id_foreign` (`dispose_assignment_id`),
    ADD KEY `assignment_report_time_record_id_foreign` (`time_record_id`),
    ADD KEY `assignment_report_customer_info_id_foreign` (`customer_info_id`);
  
  --
  -- Indeks untuk tabel `customer_info`
  --
  ALTER TABLE `customer_info`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `dispose_assignment`
  --
  ALTER TABLE `dispose_assignment`
    ADD PRIMARY KEY (`id`),
    ADD KEY `dispose_assignment_user_id_foreign` (`user_id`),
    ADD KEY `dispose_assignment_assignment_id_foreign` (`assignment_id`);
  
  --
  -- Indeks untuk tabel `history`
  --
  ALTER TABLE `history`
    ADD PRIMARY KEY (`id`),
    ADD KEY `history_user_id_foreign` (`user_id`),
    ADD KEY `history_assignment_id_foreign` (`assignment_id`);
  
  --
  -- Indeks untuk tabel `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indeks untuk tabel `role`
  --
  ALTER TABLE `role`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `time_record`
  --
  ALTER TABLE `time_record`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`),
    ADD KEY `users_role_id_foreign` (`role_id`);
  
  --
  -- AUTO_INCREMENT untuk tabel yang dibuang
  --
  
  --
  -- AUTO_INCREMENT untuk tabel `assignment`
  --
  ALTER TABLE `assignment`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `assignment_report`
  --
  ALTER TABLE `assignment_report`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `customer_info`
  --
  ALTER TABLE `customer_info`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `dispose_assignment`
  --
  ALTER TABLE `dispose_assignment`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `history`
  --
  ALTER TABLE `history`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
  --
  -- AUTO_INCREMENT untuk tabel `role`
  --
  ALTER TABLE `role`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT untuk tabel `time_record`
  --
  ALTER TABLE `time_record`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
  --
  
  --
  -- Ketidakleluasaan untuk tabel `assignment_report`
  --
  ALTER TABLE `assignment_report`
    ADD CONSTRAINT `assignment_report_customer_info_id_foreign` FOREIGN KEY (`customer_info_id`) REFERENCES `customer_info` (`id`),
    ADD CONSTRAINT `assignment_report_dispose_assignment_id_foreign` FOREIGN KEY (`dispose_assignment_id`) REFERENCES `dispose_assignment` (`id`),
    ADD CONSTRAINT `assignment_report_time_record_id_foreign` FOREIGN KEY (`time_record_id`) REFERENCES `time_record` (`id`);
  
  --
  -- Ketidakleluasaan untuk tabel `dispose_assignment`
  --
  ALTER TABLE `dispose_assignment`
    ADD CONSTRAINT `dispose_assignment_assignment_id_foreign` FOREIGN KEY (`assignment_id`) REFERENCES `assignment` (`id`),
    ADD CONSTRAINT `dispose_assignment_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Ketidakleluasaan untuk tabel `history`
  --
  ALTER TABLE `history`
    ADD CONSTRAINT `history_assignment_id_foreign` FOREIGN KEY (`assignment_id`) REFERENCES `assignment` (`id`),
    ADD CONSTRAINT `history_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Ketidakleluasaan untuk tabel `users`
  --
  ALTER TABLE `users`
    ADD CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`);
  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 */;
  