text: -- phpMyAdmin SQL Dump
  -- version 4.9.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Czas generowania: 26 Lis 2019, 20:26
  -- Wersja serwera: 10.4.8-MariaDB
  -- Wersja PHP: 7.3.10
  
  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 */;
  
  --
  -- Baza danych: `ksiegarnia123`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `authors`
  --
  
  CREATE TABLE `authors` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(100) 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;
  
  --
  -- Zrzut danych tabeli `authors`
  --
  
  INSERT INTO `authors` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Mickiewicz', '2019-11-25 21:45:03', '2019-11-25 21:45:03'),
  (2, 'Jan Kowalski', '2019-11-25 21:56:10', '2019-11-25 21:56:10'),
  (4, 'Nowak Jan', '2019-11-25 23:16:16', '2019-11-25 23:16:16');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `books`
  --
  
  CREATE TABLE `books` (
    `id` int(10) UNSIGNED NOT NULL,
    `author_id` int(10) UNSIGNED NOT NULL,
    `category_id` int(10) UNSIGNED NOT NULL,
    `isbn` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `date_of_publication` varchar(100) 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;
  
  --
  -- Zrzut danych tabeli `books`
  --
  
  INSERT INTO `books` (`id`, `author_id`, `category_id`, `isbn`, `title`, `date_of_publication`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, '12456', 'Jakaś fajna ksiazka', 'Tue Nov 19 2019 00:00:00 GMT+0100 (czas środkowoeuropejski standardowy)', '2019-11-25 21:46:03', '2019-11-25 21:46:03'),
  (2, 1, 1, '123456', 'Super ksiazka', 'Wed Nov 20 2019 00:00:00 GMT+0100 (czas środkowoeuropejski standardowy)', '2019-11-25 22:10:38', '2019-11-25 22:10:38');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `borrows`
  --
  
  CREATE TABLE `borrows` (
    `id` int(10) UNSIGNED NOT NULL,
    `book_id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `date_issued` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `date_due_for_return` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `date_return` varchar(100) 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;
  
  --
  -- Zrzut danych tabeli `borrows`
  --
  
  INSERT INTO `borrows` (`id`, `book_id`, `user_id`, `date_issued`, `date_due_for_return`, `date_return`, `created_at`, `updated_at`) VALUES
  (1, 2, 1, '2019-10-31T23:00:00.000Z', '2019-11-29T23:00:00.000Z', NULL, '2019-11-26 14:59:27', '2019-11-26 14:59:27');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `categories`
  --
  
  CREATE TABLE `categories` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(100) 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;
  
  --
  -- Zrzut danych tabeli `categories`
  --
  
  INSERT INTO `categories` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Polska', '2019-11-25 21:44:53', '2019-11-25 21:44:53'),
  (3, 'Niemcy', '2019-11-26 14:25:21', '2019-11-26 14:25:21'),
  (4, 'Francja', '2019-11-26 14:25:40', '2019-11-26 14:25:40'),
  (5, 'Anglia', '2019-11-26 14:25:47', '2019-11-26 14:25:47'),
  (6, 'Rosja', '2019-11-26 14:25:51', '2019-11-26 14:25:51'),
  (7, 'Hiszpania', '2019-11-26 14:25:56', '2019-11-26 14:25:56');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Zrzut danych tabeli `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, '2016_06_01_000001_create_oauth_auth_codes_table', 1),
  (4, '2016_06_01_000002_create_oauth_access_tokens_table', 1),
  (5, '2016_06_01_000003_create_oauth_refresh_tokens_table', 1),
  (6, '2016_06_01_000004_create_oauth_clients_table', 1),
  (7, '2016_06_01_000005_create_oauth_personal_access_clients_table', 1),
  (8, '2019_01_01_020714_create_authors_table', 1),
  (9, '2019_01_01_020801_create_categories_table', 1),
  (10, '2019_01_01_020834_create_books_table', 1),
  (11, '2019_01_01_020906_create_borrows_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `oauth_access_tokens`
  --
  
  CREATE TABLE `oauth_access_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` int(11) DEFAULT NULL,
    `client_id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `oauth_auth_codes`
  --
  
  CREATE TABLE `oauth_auth_codes` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` int(11) NOT NULL,
    `client_id` int(10) UNSIGNED NOT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `oauth_clients`
  --
  
  CREATE TABLE `oauth_clients` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(11) DEFAULT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `secret` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `personal_access_client` tinyint(1) NOT NULL,
    `password_client` tinyint(1) NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `oauth_personal_access_clients`
  --
  
  CREATE TABLE `oauth_personal_access_clients` (
    `id` int(10) UNSIGNED NOT NULL,
    `client_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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `oauth_refresh_tokens`
  --
  
  CREATE TABLE `oauth_refresh_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(191) 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
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Zrzut danych tabeli `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, 'Paweł', 'pawel540@o2.pl', NULL, '$2y$10$rsJPUMyzd/VvPEiBxc/r6eDCnilx/cs4AWT3ekt.h9LcV7JkXtCTO', 'Ev8Qb0604SxhUrm1F8imzULG5Adt3q2kbM49db0Ktj4czrRsuJlS5vdk8W12', '2019-11-25 21:44:38', '2019-11-25 21:44:38'),
  (2, 'Kasia', 'kasia@gmail.com', NULL, '$2y$10$yiu1mUOdyyoP4cj4HpE7JeI0tdTKqWsvqyueCU2S2dP4K0jRgxCKW', NULL, '2019-11-26 16:05:07', '2019-11-26 16:05:07');
  
  --
  -- Indeksy dla zrzutów tabel
  --
  
  --
  -- Indeksy dla tabeli `authors`
  --
  ALTER TABLE `authors`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeksy dla tabeli `books`
  --
  ALTER TABLE `books`
    ADD PRIMARY KEY (`id`),
    ADD KEY `books_author_id_foreign` (`author_id`),
    ADD KEY `books_category_id_foreign` (`category_id`);
  
  --
  -- Indeksy dla tabeli `borrows`
  --
  ALTER TABLE `borrows`
    ADD PRIMARY KEY (`id`),
    ADD KEY `borrows_book_id_foreign` (`book_id`),
    ADD KEY `borrows_user_id_foreign` (`user_id`);
  
  --
  -- Indeksy dla tabeli `categories`
  --
  ALTER TABLE `categories`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeksy dla tabeli `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeksy dla tabeli `oauth_access_tokens`
  --
  ALTER TABLE `oauth_access_tokens`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_access_tokens_user_id_index` (`user_id`);
  
  --
  -- Indeksy dla tabeli `oauth_auth_codes`
  --
  ALTER TABLE `oauth_auth_codes`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeksy dla tabeli `oauth_clients`
  --
  ALTER TABLE `oauth_clients`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_clients_user_id_index` (`user_id`);
  
  --
  -- Indeksy dla tabeli `oauth_personal_access_clients`
  --
  ALTER TABLE `oauth_personal_access_clients`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_personal_access_clients_client_id_index` (`client_id`);
  
  --
  -- Indeksy dla tabeli `oauth_refresh_tokens`
  --
  ALTER TABLE `oauth_refresh_tokens`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);
  
  --
  -- Indeksy dla tabeli `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indeksy dla tabeli `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT dla tabeli `authors`
  --
  ALTER TABLE `authors`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT dla tabeli `books`
  --
  ALTER TABLE `books`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT dla tabeli `borrows`
  --
  ALTER TABLE `borrows`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT dla tabeli `categories`
  --
  ALTER TABLE `categories`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  
  --
  -- AUTO_INCREMENT dla tabeli `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
  
  --
  -- AUTO_INCREMENT dla tabeli `oauth_clients`
  --
  ALTER TABLE `oauth_clients`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT dla tabeli `oauth_personal_access_clients`
  --
  ALTER TABLE `oauth_personal_access_clients`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT dla tabeli `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- Ograniczenia dla zrzutów tabel
  --
  
  --
  -- Ograniczenia dla tabeli `books`
  --
  ALTER TABLE `books`
    ADD CONSTRAINT `books_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `authors` (`id`),
    ADD CONSTRAINT `books_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);
  
  --
  -- Ograniczenia dla tabeli `borrows`
  --
  ALTER TABLE `borrows`
    ADD CONSTRAINT `borrows_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`),
    ADD CONSTRAINT `borrows_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 */;
  