-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 11, 2021 at 12:35 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4

SET FOREIGN_KEY_CHECKS=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: `happy_grains_lucky_draw_2022_v3`
--

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

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci 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 `permissions`
--

INSERT INTO `permissions` (`id`, `title`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'user_management_access', NULL, NULL, NULL),
(2, 'permission_create', NULL, NULL, NULL),
(3, 'permission_edit', NULL, NULL, NULL),
(4, 'permission_show', NULL, NULL, NULL),
(5, 'permission_delete', NULL, NULL, NULL),
(6, 'permission_access', NULL, NULL, NULL),
(7, 'role_create', NULL, NULL, NULL),
(8, 'role_edit', NULL, NULL, NULL),
(9, 'role_show', NULL, NULL, NULL),
(10, 'role_delete', NULL, NULL, NULL),
(11, 'role_access', NULL, NULL, NULL),
(12, 'user_create', NULL, NULL, NULL),
(13, 'user_edit', NULL, NULL, NULL),
(14, 'user_show', NULL, NULL, NULL),
(15, 'user_delete', NULL, NULL, NULL),
(16, 'user_access', NULL, NULL, NULL),
(17, 'audit_log_show', NULL, NULL, NULL),
(18, 'audit_log_access', NULL, NULL, NULL),
(19, 'product_management_access', NULL, NULL, NULL),
(20, 'product_category_create', NULL, NULL, NULL),
(21, 'product_category_edit', NULL, NULL, NULL),
(22, 'product_category_show', NULL, NULL, NULL),
(23, 'product_category_delete', NULL, NULL, NULL),
(24, 'product_category_access', NULL, NULL, NULL),
(25, 'product_tag_create', NULL, NULL, NULL),
(26, 'product_tag_edit', NULL, NULL, NULL),
(27, 'product_tag_show', NULL, NULL, NULL),
(28, 'product_tag_delete', NULL, NULL, NULL),
(29, 'product_tag_access', NULL, NULL, NULL),
(30, 'product_create', NULL, NULL, NULL),
(31, 'product_edit', NULL, NULL, NULL),
(32, 'product_show', NULL, NULL, NULL),
(33, 'product_delete', NULL, NULL, NULL),
(34, 'product_access', NULL, NULL, NULL),
(35, 'master_management_access', NULL, NULL, NULL),
(36, 'state_create', NULL, NULL, NULL),
(37, 'state_edit', NULL, NULL, NULL),
(38, 'state_show', NULL, NULL, NULL),
(39, 'state_delete', NULL, NULL, NULL),
(40, 'state_access', NULL, NULL, NULL),
(41, 'city_create', NULL, NULL, NULL),
(42, 'city_edit', NULL, NULL, NULL),
(43, 'city_show', NULL, NULL, NULL),
(44, 'city_delete', NULL, NULL, NULL),
(45, 'city_access', NULL, NULL, NULL),
(46, 'lucky_draw_management_access', NULL, NULL, NULL),
(47, 'lucky_draw_item_create', NULL, NULL, NULL),
(48, 'lucky_draw_item_edit', NULL, NULL, NULL),
(49, 'lucky_draw_item_show', NULL, NULL, NULL),
(50, 'lucky_draw_item_delete', NULL, NULL, NULL),
(51, 'lucky_draw_item_access', NULL, NULL, NULL),
(52, 'customer_create', NULL, NULL, NULL),
(53, 'customer_edit', NULL, NULL, NULL),
(54, 'customer_show', NULL, NULL, NULL),
(55, 'customer_delete', NULL, NULL, NULL),
(56, 'customer_access', NULL, NULL, NULL),
(57, 'employee_create', NULL, NULL, NULL),
(58, 'employee_edit', NULL, NULL, NULL),
(59, 'employee_show', NULL, NULL, NULL),
(60, 'employee_delete', NULL, NULL, NULL),
(61, 'employee_access', NULL, NULL, NULL),
(62, 'survey_management_access', NULL, NULL, NULL),
(63, 'survey_create', NULL, NULL, NULL),
(64, 'survey_edit', NULL, NULL, NULL),
(65, 'survey_show', NULL, NULL, NULL),
(66, 'survey_delete', NULL, NULL, NULL),
(67, 'survey_access', NULL, NULL, NULL),
(68, 'shipping_clerk_create', NULL, NULL, NULL),
(69, 'shipping_clerk_edit', NULL, NULL, NULL),
(70, 'shipping_clerk_show', NULL, NULL, NULL),
(71, 'shipping_clerk_delete', NULL, NULL, NULL),
(72, 'shipping_clerk_access', NULL, NULL, NULL),
(73, 'luck_draw_data_create', NULL, NULL, NULL),
(74, 'luck_draw_data_edit', NULL, NULL, NULL),
(75, 'luck_draw_data_show', NULL, NULL, NULL),
(76, 'luck_draw_data_delete', NULL, NULL, NULL),
(77, 'luck_draw_data_access', NULL, NULL, NULL),
(78, 'customer_luck_draw_data_create', NULL, NULL, NULL),
(79, 'customer_luck_draw_data_edit', NULL, NULL, NULL),
(80, 'customer_luck_draw_data_show', NULL, NULL, NULL),
(81, 'customer_luck_draw_data_delete', NULL, NULL, NULL),
(82, 'customer_luck_draw_data_approve', NULL, NULL, NULL),
(83, 'customer_luck_draw_data_reject', NULL, NULL, NULL),
(84, 'customer_luck_draw_data_access', NULL, NULL, NULL),
(85, 'shipping_management_access', NULL, NULL, NULL),
(86, 'shipping_lucky_draw_create', NULL, NULL, NULL),
(87, 'shipping_lucky_draw_edit', NULL, NULL, NULL),
(88, 'shipping_lucky_draw_update', NULL, NULL, NULL),
(89, 'shipping_lucky_draw_show', NULL, NULL, NULL),
(90, 'shipping_lucky_draw_delete', NULL, NULL, NULL),
(91, 'shipping_lucky_draw_access', NULL, NULL, NULL),
(92, 'shipped_lucky_draw_create', NULL, NULL, NULL),
(93, 'shipped_lucky_draw_edit', NULL, NULL, NULL),
(94, 'shipped_lucky_draw_update', NULL, NULL, NULL),
(95, 'shipped_lucky_draw_show', NULL, NULL, NULL),
(96, 'shipped_lucky_draw_delete', NULL, NULL, NULL),
(97, 'shipped_lucky_draw_access', NULL, NULL, NULL),
(98, 'reject_customer_luck_draw_data_create', NULL, NULL, NULL),
(99, 'reject_customer_luck_draw_data_edit', NULL, NULL, NULL),
(100, 'reject_customer_luck_draw_data_show', NULL, NULL, NULL),
(101, 'reject_customer_luck_draw_data_delete', NULL, NULL, NULL),
(102, 'reject_customer_luck_draw_data_access', NULL, NULL, NULL),
(103, 'profile_password_edit', NULL, NULL, NULL),
(104, 'courier_create', NULL, NULL, NULL),
(105, 'courier_edit', NULL, NULL, NULL),
(106, 'courier_show', NULL, NULL, NULL),
(107, 'courier_delete', NULL, NULL, NULL),
(108, 'courier_access', NULL, NULL, NULL);

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

--
-- Table structure for table `permission_role`
--

DROP TABLE IF EXISTS `permission_role`;
CREATE TABLE `permission_role` (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `permission_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permission_role`
--

INSERT INTO `permission_role` (`role_id`, `permission_id`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(1, 7),
(1, 8),
(1, 9),
(1, 10),
(1, 11),
(1, 17),
(1, 18),
(1, 19),
(1, 20),
(1, 21),
(1, 22),
(1, 23),
(1, 24),
(1, 25),
(1, 26),
(1, 27),
(1, 28),
(1, 29),
(1, 30),
(1, 31),
(1, 32),
(1, 33),
(1, 34),
(1, 35),
(1, 36),
(1, 37),
(1, 38),
(1, 39),
(1, 40),
(1, 41),
(1, 42),
(1, 43),
(1, 44),
(1, 45),
(1, 46),
(1, 47),
(1, 48),
(1, 49),
(1, 50),
(1, 51),
(1, 52),
(1, 53),
(1, 54),
(1, 55),
(1, 56),
(1, 57),
(1, 58),
(1, 59),
(1, 60),
(1, 61),
(1, 62),
(1, 63),
(1, 64),
(1, 65),
(1, 66),
(1, 67),
(1, 68),
(1, 69),
(1, 70),
(1, 71),
(1, 72),
(1, 73),
(1, 74),
(1, 75),
(1, 76),
(1, 77),
(1, 78),
(1, 79),
(1, 80),
(1, 81),
(1, 82),
(1, 83),
(1, 84),
(1, 85),
(1, 86),
(1, 87),
(1, 88),
(1, 89),
(1, 90),
(1, 91),
(1, 92),
(1, 93),
(1, 94),
(1, 95),
(1, 96),
(1, 97),
(1, 98),
(1, 99),
(1, 100),
(1, 101),
(1, 102),
(1, 103),
(1, 104),
(1, 105),
(1, 106),
(1, 107),
(1, 108),
(2, 1),
(2, 2),
(2, 3),
(2, 4),
(2, 5),
(2, 6),
(2, 7),
(2, 8),
(2, 9),
(2, 10),
(2, 11),
(2, 17),
(2, 18),
(2, 19),
(2, 20),
(2, 21),
(2, 22),
(2, 23),
(2, 24),
(2, 25),
(2, 26),
(2, 27),
(2, 28),
(2, 29),
(2, 30),
(2, 31),
(2, 32),
(2, 33),
(2, 34),
(2, 35),
(2, 36),
(2, 37),
(2, 38),
(2, 39),
(2, 40),
(2, 41),
(2, 42),
(2, 43),
(2, 44),
(2, 45),
(2, 46),
(2, 47),
(2, 48),
(2, 49),
(2, 50),
(2, 51),
(2, 52),
(2, 53),
(2, 54),
(2, 55),
(2, 56),
(2, 57),
(2, 58),
(2, 59),
(2, 60),
(2, 61),
(2, 62),
(2, 63),
(2, 64),
(2, 65),
(2, 66),
(2, 67),
(2, 68),
(2, 69),
(2, 70),
(2, 71),
(2, 72),
(2, 73),
(2, 74),
(2, 75),
(2, 76),
(2, 77),
(2, 78),
(2, 79),
(2, 80),
(2, 81),
(2, 82),
(2, 83),
(2, 84),
(2, 85),
(2, 86),
(2, 87),
(2, 88),
(2, 89),
(2, 90),
(2, 91),
(2, 92),
(2, 93),
(2, 94),
(2, 95),
(2, 96),
(2, 97),
(2, 98),
(2, 99),
(2, 100),
(2, 101),
(2, 102),
(2, 103),
(2, 104),
(2, 105),
(2, 106),
(2, 107),
(2, 108),
(3, 46),
(3, 79),
(3, 80),
(3, 82),
(3, 83),
(3, 84),
(4, 103);

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

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci 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 `roles`
--

INSERT INTO `roles` (`id`, `title`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Admin', NULL, NULL, NULL),
(2, 'Employee', NULL, NULL, NULL),
(3, 'Customer Service', NULL, NULL, NULL),
(4, 'Customer', NULL, NULL, NULL),
(5, 'User', NULL, NULL, NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `permission_role`
--
ALTER TABLE `permission_role`
  ADD KEY `role_id_fk_5099837` (`role_id`),
  ADD KEY `permission_id_fk_5099837` (`permission_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=109;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `permission_role`
--
ALTER TABLE `permission_role`
  ADD CONSTRAINT `permission_id_fk_5099837` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_id_fk_5099837` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
SET FOREIGN_KEY_CHECKS=1;
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 */;
