-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2019 at 06:19 PM
-- Server version: 10.3.12-MariaDB
-- PHP Version: 7.2.9

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: `webbbco`
--

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

--
-- Table structure for table `webbbco_addons`
--

CREATE TABLE `webbbco_addons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED DEFAULT NULL,
  `creator_by` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_addons_packages`
--

CREATE TABLE `webbbco_addons_packages` (
  `addon_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_migrations`
--

CREATE TABLE `webbbco_migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `webbbco_migrations`
--

INSERT INTO `webbbco_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_07_29_144447_create_websites_table', 1),
(4, '2019_08_02_095012_create_roles_table', 1),
(5, '2019_08_02_110529_create_permissions_table', 1),
(6, '2019_08_02_110545_create_roles_permissions_table', 1),
(7, '2019_08_02_111132_create_packages_table', 1),
(8, '2019_08_02_111859_create_users_detail_table', 1),
(9, '2019_08_02_113436_create_addons_table', 1),
(10, '2019_08_02_114327_create_websites_packages_table', 1),
(11, '2019_08_02_114725_create_addons_packages_table', 1);

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

--
-- Table structure for table `webbbco_packages`
--

CREATE TABLE `webbbco_packages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `creator_by` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `price` decimal(8,2) DEFAULT NULL,
  `package_duration` int(11) DEFAULT NULL,
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `content` text COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_password_resets`
--

CREATE TABLE `webbbco_password_resets` (
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_permissions`
--

CREATE TABLE `webbbco_permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `creator_by` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_roles`
--

CREATE TABLE `webbbco_roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `creator_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT 0,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_roles_permissions`
--

CREATE TABLE `webbbco_roles_permissions` (
  `role_id` bigint(20) UNSIGNED DEFAULT NULL,
  `permission_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_users`
--

CREATE TABLE `webbbco_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `website_id` bigint(20) UNSIGNED DEFAULT NULL,
  `first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `role` tinyint(4) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_users_detail`
--

CREATE TABLE `webbbco_users_detail` (
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `phone` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mobile` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address_line_1` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address_line_2` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `webbbco_websites`
--

CREATE TABLE `webbbco_websites` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `creator_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `domain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `company_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `phone` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mobile` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address_line_1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address_line_2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` tinyint(4) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `webbbco_websites`
--

INSERT INTO `webbbco_websites` (`id`, `creator_by`, `deleted_by`, `name`, `slug`, `domain`, `company_name`, `email`, `phone`, `mobile`, `address_line_1`, `address_line_2`, `city`, `state`, `country`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, NULL, NULL, 'Arslan Arif', 'arslan-arif', 'lsms.ac', 'adfasdf', 'arslan.arif@virtualforce.io', '+923224796879', 'sdasfasdfas', 's1, s2', 's2', 'lhr', NULL, 'Pakistan', 0, '2019-08-02 11:02:06', '2019-08-02 11:02:06', NULL),
(2, NULL, NULL, 'Hello Dunia', 'hello-dunia', 'abc.com', 'adfasdf', 'arslan@gmail.com', '+923224796879', 'sdasfasdfas', 's1, s2', 's2', 'lhr', NULL, 'Pakistan', 0, '2019-08-02 11:14:15', '2019-08-02 11:14:15', NULL);

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

--
-- Table structure for table `webbbco_websites_packages`
--

CREATE TABLE `webbbco_websites_packages` (
  `website_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `webbbco_addons`
--
ALTER TABLE `webbbco_addons`
  ADD PRIMARY KEY (`id`),
  ADD KEY `webbbco_addons_package_id_foreign` (`package_id`),
  ADD KEY `webbbco_addons_creator_by_foreign` (`creator_by`);

--
-- Indexes for table `webbbco_addons_packages`
--
ALTER TABLE `webbbco_addons_packages`
  ADD KEY `webbbco_addons_packages_addon_id_foreign` (`addon_id`),
  ADD KEY `webbbco_addons_packages_package_id_foreign` (`package_id`);

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

--
-- Indexes for table `webbbco_packages`
--
ALTER TABLE `webbbco_packages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `webbbco_packages_creator_by_foreign` (`creator_by`);

--
-- Indexes for table `webbbco_password_resets`
--
ALTER TABLE `webbbco_password_resets`
  ADD KEY `webbbco_password_resets_email_index` (`email`);

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

--
-- Indexes for table `webbbco_roles`
--
ALTER TABLE `webbbco_roles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `webbbco_roles_creator_by_foreign` (`creator_by`),
  ADD KEY `webbbco_roles_deleted_by_foreign` (`deleted_by`);

--
-- Indexes for table `webbbco_roles_permissions`
--
ALTER TABLE `webbbco_roles_permissions`
  ADD KEY `webbbco_roles_permissions_role_id_foreign` (`role_id`),
  ADD KEY `webbbco_roles_permissions_permission_id_foreign` (`permission_id`);

--
-- Indexes for table `webbbco_users`
--
ALTER TABLE `webbbco_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `webbbco_users_email_unique` (`email`);

--
-- Indexes for table `webbbco_users_detail`
--
ALTER TABLE `webbbco_users_detail`
  ADD KEY `webbbco_users_detail_user_id_foreign` (`user_id`);

--
-- Indexes for table `webbbco_websites`
--
ALTER TABLE `webbbco_websites`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `webbbco_websites_slug_unique` (`slug`),
  ADD KEY `webbbco_websites_creator_by_foreign` (`creator_by`),
  ADD KEY `webbbco_websites_deleted_by_foreign` (`deleted_by`);

--
-- Indexes for table `webbbco_websites_packages`
--
ALTER TABLE `webbbco_websites_packages`
  ADD KEY `webbbco_websites_packages_website_id_foreign` (`website_id`),
  ADD KEY `webbbco_websites_packages_package_id_foreign` (`package_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `webbbco_addons`
--
ALTER TABLE `webbbco_addons`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `webbbco_migrations`
--
ALTER TABLE `webbbco_migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `webbbco_packages`
--
ALTER TABLE `webbbco_packages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `webbbco_permissions`
--
ALTER TABLE `webbbco_permissions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `webbbco_roles`
--
ALTER TABLE `webbbco_roles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `webbbco_users`
--
ALTER TABLE `webbbco_users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `webbbco_addons`
--
ALTER TABLE `webbbco_addons`
  ADD CONSTRAINT `webbbco_addons_creator_by_foreign` FOREIGN KEY (`creator_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_addons_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `webbbco_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_addons_packages`
--
ALTER TABLE `webbbco_addons_packages`
  ADD CONSTRAINT `webbbco_addons_packages_addon_id_foreign` FOREIGN KEY (`addon_id`) REFERENCES `webbbco_addons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_addons_packages_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `webbbco_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_packages`
--
ALTER TABLE `webbbco_packages`
  ADD CONSTRAINT `webbbco_packages_creator_by_foreign` FOREIGN KEY (`creator_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_roles`
--
ALTER TABLE `webbbco_roles`
  ADD CONSTRAINT `webbbco_roles_creator_by_foreign` FOREIGN KEY (`creator_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_roles_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_roles_permissions`
--
ALTER TABLE `webbbco_roles_permissions`
  ADD CONSTRAINT `webbbco_roles_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `webbbco_permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_roles_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `webbbco_roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_users_detail`
--
ALTER TABLE `webbbco_users_detail`
  ADD CONSTRAINT `webbbco_users_detail_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_websites`
--
ALTER TABLE `webbbco_websites`
  ADD CONSTRAINT `webbbco_websites_creator_by_foreign` FOREIGN KEY (`creator_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_websites_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `webbbco_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `webbbco_websites_packages`
--
ALTER TABLE `webbbco_websites_packages`
  ADD CONSTRAINT `webbbco_websites_packages_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `webbbco_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `webbbco_websites_packages_website_id_foreign` FOREIGN KEY (`website_id`) REFERENCES `webbbco_websites` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
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 */;
