-- https://www.phpmyadmin.net/
--

START TRANSACTION;



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

--
-- Table structure for table `departments`
--

CREATE TABLE `departments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `dep_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` tinyint(4) NOT NULL,
  `status` tinyint(4) NOT NULL COMMENT '1=active, 2=de-active',
  `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 `departments`
--

INSERT INTO `departments` (`id`, `dep_name`, `priority`, `status`, `created_at`, `updated_at`) VALUES
(1, 'computer & it', 1, 1, '2022-09-13 04:41:25', '2022-09-13 04:41:25');

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

--
-- Table structure for table `designations`
--

CREATE TABLE `designations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `deg_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dep_id` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL COMMENT '1=active, 2=de-active',
  `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 `designations`
--

INSERT INTO `designations` (`id`, `deg_name`, `dep_id`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Programmer', 1, 1, '2022-09-13 04:41:41', '2022-09-13 04:41:41');

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

--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthday` date NOT NULL,
  `gender` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mobile` int(11) NOT NULL,
  `nid` bigint(20) DEFAULT NULL,
  `dep_id` int(11) NOT NULL,
  `deg_id` int(11) NOT NULL,
  `nationality` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `religion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `img` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `admin_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `employees`
--

INSERT INTO `employees` (`id`, `name`, `email`, `birthday`, `gender`, `mobile`, `nid`, `dep_id`, `deg_id`, `nationality`, `religion`, `img`, `created_at`, `updated_at`, `admin_id`) VALUES
(1, 'labib', 'labibkg@gmail.com', '2022-09-14', 'male', 1796038482, 33033030303, 1, 1, 'bangladesh', 'islam', '/Storage/employee/profile/mdsiddiqulislamlabib.jpg', '2022-09-13 04:55:00', '2022-09-13 04:55:00', 6);

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED 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
(99, '2014_10_12_000000_create_users_table', 1),
(100, '2014_10_12_100000_create_password_resets_table', 1),
(101, '2019_08_19_000000_create_failed_jobs_table', 1),
(102, '2020_07_24_184706_create_permission_tables', 1),
(103, '2020_09_12_043205_create_admins_table', 1),
(104, '2022_09_04_045904_create_departments_table', 1),
(105, '2022_09_05_055149_create_designations_table', 1);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\Models\\Admin', 1),
(2, 'App\\Models\\Admin', 2),
(2, 'App\\Models\\Admin', 3),
(2, 'App\\Models\\Admin', 4),
(2, 'App\\Models\\Admin', 5),
(2, 'App\\Models\\Admin', 6);

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

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

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `group_name` varchar(255) 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 for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `group_name`, `created_at`, `updated_at`) VALUES
(1, 'dashboard.view', 'admin', 'dashboard', '2022-09-13 04:36:39', '2022-09-13 04:36:39'),
(2, 'dashboard.edit', 'admin', 'dashboard', '2022-09-13 04:36:39', '2022-09-13 04:36:39'),
(3, 'blog.create', 'admin', 'blog', '2022-09-13 04:36:39', '2022-09-13 04:36:39'),
(4, 'blog.view', 'admin', 'blog', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(5, 'blog.edit', 'admin', 'blog', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(6, 'blog.delete', 'admin', 'blog', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(7, 'blog.approve', 'admin', 'blog', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(8, 'admin.create', 'admin', 'admin', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(9, 'admin.view', 'admin', 'admin', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(10, 'admin.edit', 'admin', 'admin', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(11, 'admin.delete', 'admin', 'admin', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(12, 'admin.approve', 'admin', 'admin', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(13, 'role.create', 'admin', 'role', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(14, 'role.view', 'admin', 'role', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(15, 'role.edit', 'admin', 'role', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(16, 'role.delete', 'admin', 'role', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(17, 'role.approve', 'admin', 'role', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(18, 'profile.view', 'admin', 'profile', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(19, 'profile.edit', 'admin', 'profile', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(20, 'employee.create', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(21, 'employee.view', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(22, 'employee.edit', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(23, 'employee.delete', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(24, 'employee.approve', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(25, 'employee.designation', 'admin', 'employee', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(26, 'department.create', 'admin', 'department', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(27, 'department.view', 'admin', 'department', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(28, 'department.edit', 'admin', 'department', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(29, 'department.delete', 'admin', 'department', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(30, 'project.create', 'admin', 'project', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(31, 'project.view', 'admin', 'project', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(32, 'project.edit', 'admin', 'project', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(33, 'project.delete', 'admin', 'project', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(34, 'designation.create', 'admin', 'designation', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(35, 'designation.view', 'admin', 'designation', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(36, 'designation.edit', 'admin', 'designation', '2022-09-13 04:36:40', '2022-09-13 04:36:40'),
(37, 'designation.delete', 'admin', 'designation', '2022-09-13 04:36:40', '2022-09-13 04:36:40');

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

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

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) 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 `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'superadmin', 'admin', '2022-09-13 04:36:39', '2022-09-13 04:36:39'),
(2, 'employee', 'admin', '2022-09-13 04:41:01', '2022-09-13 04:41:01');

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

--
-- Table structure for table `role_has_permissions`
--

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

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(1, 2),
(2, 1),
(2, 2),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(18, 2),
(19, 1),
(19, 2),
(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);

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

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

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

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

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

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

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

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

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

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

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

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

--
-- 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=106;

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
COMMIT;

