Skip to content

Instantly share code, notes, and snippets.

@azamuddin
Created December 15, 2020 04:11
Show Gist options
  • Save azamuddin/854588b9995a6dba66d0b0cf87c6bb0d to your computer and use it in GitHub Desktop.
Save azamuddin/854588b9995a6dba66d0b0cf87c6bb0d to your computer and use it in GitHub Desktop.
sql file untuk ebook Laravel Vue versi Laravel 8
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: mysql
-- Generation Time: Dec 15, 2020 at 04:11 AM
-- Server version: 8.0.22
-- PHP Version: 7.4.8
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: `larashop-l8`
--
-- --------------------------------------------------------
--
-- Table structure for table `books`
--
CREATE TABLE `books` (
`id` bigint UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`author` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`publisher` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`cover` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` double(8,2) NOT NULL,
`views` int UNSIGNED NOT NULL DEFAULT '0',
`stock` int UNSIGNED NOT NULL DEFAULT '0',
`status` enum('PUBLISH','DRAFT') COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` int NOT NULL,
`updated_by` int DEFAULT NULL,
`deleted_by` int DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `books`
--
INSERT INTO `books` (`id`, `title`, `slug`, `description`, `author`, `publisher`, `cover`, `price`, `views`, `stock`, `status`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'The Book I', 'the-book', 'Description about the book', 'Muhammad Azamuddin', 'Indie', 'book-covers/YvYWJP3oMxFFoljkhaXSiPJ4m2ghKhKdSSr9rwrC.jpg', 199000.00, 0, 190, 'PUBLISH', 1, 1, NULL, '2020-12-15 02:22:07', '2020-12-15 02:39:57', NULL),
(2, 'How to be Ninja Developer', 'how-to-be-ninja-developer', 'The description', 'Muhammad Azamuddin', 'Indie', 'book-covers/jHkDYpgdlYWTuBWzrlFEIs40RvYAtZHE5V0Hdi6J.jpg', 299000.00, 0, 1, 'PUBLISH', 1, NULL, NULL, '2020-12-15 03:44:34', '2020-12-15 03:44:34', NULL),
(4, 'How to be Rockstar Developer', 'how-to-be-rockstar-developer', 'The description about the book', 'Muhammad Azamuddin', 'Indie', 'book-covers/jEo54rhjbb8tCIXqzB5Hfu8XxAjORN2iEj1nVJSi.jpg', 290000.00, 0, 99, 'PUBLISH', 1, 4, NULL, '2020-12-15 03:46:40', '2020-12-15 04:04:45', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `book_category`
--
CREATE TABLE `book_category` (
`id` bigint UNSIGNED NOT NULL,
`book_id` bigint UNSIGNED DEFAULT NULL,
`category_id` bigint UNSIGNED 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 `book_order`
--
CREATE TABLE `book_order` (
`id` bigint UNSIGNED NOT NULL,
`order_id` bigint UNSIGNED NOT NULL,
`book_id` bigint UNSIGNED NOT NULL,
`quantity` bigint 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 `book_order`
--
INSERT INTO `book_order` (`id`, `order_id`, `book_id`, `quantity`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 1, NULL, NULL),
(2, 2, 4, 2, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'berisi nama file image saja tanpa path',
`created_by` int DEFAULT NULL,
`updated_by` int DEFAULT NULL,
`deleted_by` int DEFAULT NULL,
`deleted_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;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`id`, `name`, `slug`, `image`, `created_by`, `updated_by`, `deleted_by`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Sepatu', 'sepatu', 'category_images/eXPOcxhWmf5amVnVeCpTTktFxowCr6hSnqx3KbGU.png', 1, 1, NULL, NULL, '2020-12-14 09:46:08', '2020-12-14 10:01:38');
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint 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 UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int 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_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2020_12_14_021856_penyesuaian_table_users', 2),
(6, '2020_12_14_092710_create_categories', 3),
(7, '2020_12_14_115414_create_books_table', 4),
(10, '2020_12_14_115606_create_book_category_table', 5),
(11, '2020_12_15_031924_create_orders_table', 6),
(12, '2020_12_15_032159_create_book_order_table', 7);
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`id` bigint UNSIGNED NOT NULL,
`user_id` bigint UNSIGNED NOT NULL,
`total_price` double(8,2) UNSIGNED NOT NULL,
`invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('SUBMIT','PROCESS','FINISH','CANCEL') 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 for table `orders`
--
INSERT INTO `orders` (`id`, `user_id`, `total_price`, `invoice_number`, `status`, `created_at`, `updated_at`) VALUES
(1, 4, 299000.00, '202012140001', 'FINISH', '2020-12-12 11:01:50', NULL),
(2, 5, 580000.00, '202012250002', 'PROCESS', '2020-12-25 11:01:57', NULL);
-- --------------------------------------------------------
--
-- 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 `users`
--
CREATE TABLE `users` (
`id` bigint 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,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`roles` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` text COLLATE utf8mb4_unicode_ci,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL
) 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`, `username`, `roles`, `address`, `phone`, `avatar`, `status`) VALUES
(1, 'Site Administrator', 'administrator@larashop.test', NULL, '$2y$10$bVkzcLNUybkPB/87HSAhAundk.pqAv3u8t4jPeEX96ucKL9BR92hO', NULL, '2020-12-14 02:29:07', '2020-12-14 03:29:39', 'administrator', '[\"ADMIN\"]', 'Sarmili, Bintaro, Tangerang Selatan', NULL, 'avatars/qJGsiLBKtiiMzf8pVguTODjVYWu9C9yx0ThBwy8P.jpg', 'ACTIVE'),
(2, 'Muhammad Azamuddin', 'mas.azamuddin@gmail.com', NULL, '$2y$10$P7zYNFgcKVip77/.5k/dTup5mMCRq7cm7qg6nBWLOP7YLaIaYSDzG', NULL, '2020-12-14 03:20:07', '2020-12-14 03:20:07', 'azamuddin', '[\"CUSTOMER\"]', 'Jl Cempaka Sari III Jakarta Pusat\r\nKemayoran', '085781107766', 'avatars/ExQyuIf0FYhyhgbLt9aRbtxWdGHrlGgxcON1nMSs.jpg', 'ACTIVE'),
(4, 'Nadia N M', 'nadia.nm@gmail.com', NULL, '$2y$10$C3TgyddwCXcoca.m676Y9Osm//Qdc91FmK2nG8/3d9JULdEEYTOSq', NULL, '2020-12-15 03:48:42', '2020-12-15 03:48:42', 'nadia.nm', '[\"CUSTOMER\"]', NULL, '085781107755', 'avatars/CXMSjPe3bFp2jN10ShRsMDlUJNYmwQRPLcsrSLoO.jpg', 'ACTIVE'),
(5, 'Johan Z D', 'johan.zd@gmail.com', NULL, '$2y$10$AKuoCook1Fuka8x10TyZwuLpxV4kB2I0JXPyFE0cpfQsqjgZQ1Pji', NULL, '2020-12-15 03:49:51', '2020-12-15 03:49:51', 'johan.zd', '[\"CUSTOMER\"]', NULL, '08578110744', 'avatars/85LkryUePYWOIUmu0xw9QBG9Z6xNIFbXs3wZleEi.jpg', 'ACTIVE');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `books`
--
ALTER TABLE `books`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `book_category`
--
ALTER TABLE `book_category`
ADD PRIMARY KEY (`id`),
ADD KEY `book_category_book_id_foreign` (`book_id`),
ADD KEY `book_category_category_id_foreign` (`category_id`);
--
-- Indexes for table `book_order`
--
ALTER TABLE `book_order`
ADD PRIMARY KEY (`id`),
ADD KEY `book_order_order_id_foreign` (`order_id`),
ADD KEY `book_order_book_id_foreign` (`book_id`);
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `categories_slug_unique` (`slug`);
--
-- 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 `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`),
ADD KEY `orders_user_id_foreign` (`user_id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`),
ADD UNIQUE KEY `users_username_unique` (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `books`
--
ALTER TABLE `books`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `book_category`
--
ALTER TABLE `book_category`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `book_order`
--
ALTER TABLE `book_order`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `book_category`
--
ALTER TABLE `book_category`
ADD CONSTRAINT `book_category_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`),
ADD CONSTRAINT `book_category_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);
--
-- Constraints for table `book_order`
--
ALTER TABLE `book_order`
ADD CONSTRAINT `book_order_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`),
ADD CONSTRAINT `book_order_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`);
--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
ADD CONSTRAINT `orders_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 */;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment