-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 26, 2020 at 02:24 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.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: `khuzela2`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`cody` int(11) NOT 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 `cities`
--
CREATE TABLE `cities` (
`id` bigint(20) UNSIGNED NOT NULL,
`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 `cities`
--
INSERT INTO `cities` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Maputo Cidade', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(2, 'Maputo Provincia', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(3, 'Gaza', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(4, 'Inhambane', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(5, 'Sofala', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(6, 'Nampula', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(7, 'Tete', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(8, 'Zambézia', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(9, 'Sofala', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(10, 'Cabo Delgado', '2020-07-25 21:50:50', '2020-07-25 21:50:50'),
(11, 'Quelimane', '2020-07-25 21:50:50', '2020-07-25 21:50:50');
-- --------------------------------------------------------
--
-- Table structure for table `clubs`
--
CREATE TABLE `clubs` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nuit` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`picture` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`responsible_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`responsible_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`responsible_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`users_id` int(10) UNSIGNED NOT NULL,
`cities_id` bigint(20) UNSIGNED NOT 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 `colors`
--
CREATE TABLE `colors` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` 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;
-- --------------------------------------------------------
--
-- Table structure for table `compras`
--
CREATE TABLE `compras` (
`id` bigint(20) UNSIGNED NOT NULL,
`codigo_compra` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quantTotal` int(11) NOT NULL,
`precoTotal` int(11) NOT NULL,
`meio_pagamento` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`meios_pagamentos_id` bigint(20) UNSIGNED NOT NULL,
`statuses_id` bigint(20) UNSIGNED NOT 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 `documents`
--
CREATE TABLE `documents` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- Table structure for table `estados`
--
CREATE TABLE `estados` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- 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 `images`
--
CREATE TABLE `images` (
`id` bigint(20) UNSIGNED NOT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`products_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;
-- --------------------------------------------------------
--
-- Table structure for table `item_compras`
--
CREATE TABLE `item_compras` (
`id` bigint(20) UNSIGNED NOT NULL,
`quantidade` int(11) NOT NULL,
`price` int(11) NOT NULL,
`products_id` bigint(20) UNSIGNED NOT NULL,
`compras_id` bigint(20) UNSIGNED NOT 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 `meios_pagamentos`
--
CREATE TABLE `meios_pagamentos` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- Table structure for table `members`
--
CREATE TABLE `members` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`member_number` bigint(20) NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` bigint(20) NOT NULL,
`photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`document_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status_user` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quotas_id` int(10) UNSIGNED NOT NULL,
`code` int(11) DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`documents_id` bigint(20) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT NULL,
`cities_id` bigint(20) UNSIGNED NOT 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 `member_clubs`
--
CREATE TABLE `member_clubs` (
`id` bigint(20) UNSIGNED NOT NULL,
`nr_quotas_em_divida` bigint(20) DEFAULT NULL,
`next_payment_date` date DEFAULT NULL,
`members_id` bigint(20) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT 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 `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
(1, '2014_02_12_000000_create_documents_table', 1),
(2, '2014_10_12_000000_create_users_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2016_06_01_000001_create_oauth_auth_codes_table', 1),
(5, '2016_06_01_000002_create_oauth_access_tokens_table', 1),
(6, '2016_06_01_000003_create_oauth_refresh_tokens_table', 1),
(7, '2016_06_01_000004_create_oauth_clients_table', 1),
(8, '2016_06_01_000005_create_oauth_personal_access_clients_table', 1),
(9, '2019_08_19_000000_create_failed_jobs_table', 1),
(10, '2019_09_25_182323_create_roles_table', 1),
(11, '2019_09_25_183138_create_role_user_table', 1),
(12, '2020_04_30_150270_create_categories_table', 1),
(13, '2020_04_30_150301_create_subcategorias_table', 1),
(14, '2020_04_30_150360_create_colors_table', 1),
(15, '2020_05_09_222554_create_cities_table', 1),
(16, '2020_05_09_222573_create_estados_table', 1),
(17, '2020_05_09_222600_create_percentagems_table', 1),
(18, '2020_05_09_222648_create_clubs_table', 1),
(19, '2020_05_09_222854_create_quotas_table', 1),
(20, '2020_05_09_222932_create_members_table', 1),
(21, '2020_05_09_223009_create_member_clubs_table', 1),
(22, '2020_05_09_223134_create_partners_table', 1),
(23, '2020_05_09_223160_create_meios_pagamentos_table', 1),
(24, '2020_05_09_223180_create_tamanhos_table', 1),
(25, '2020_05_09_223230_create_producto_categorias_table', 1),
(26, '2020_05_09_223360_create_producto_subcategorias_table', 1),
(27, '2020_05_09_223442_create_services_table', 1),
(28, '2020_05_09_223500_create_statuses_table', 1),
(29, '2020_05_09_223516_create_products_table', 1),
(30, '2020_05_09_223533_create_compras_table', 1),
(31, '2020_05_22_110712_create_partner_clubs_table', 1),
(32, '2020_05_22_110720_create_service_clubs_table', 1),
(33, '2020_05_26_15452_create_images_table', 1),
(35, '2020_06_02_043936_create_periods_table', 1),
(36, '2020_06_11_045954_create_post_khuzelas_table', 1),
(37, '2020_06_24_154927_create_product_colors_table', 1),
(38, '2020_06_28_193359_add_soft_deletes_to_post_khuzela_table', 1),
(39, '2020_07_01_220301_create_product_items_table', 1),
(40, '2020_07_01_221917_create_product_item_images_table', 1),
(41, '2020_07_07_095030_create_stocks_table', 1),
(42, '2020_07_07_162317_create_item_compras_table', 1),
(43, '2020_05_28_084059_create_posts_table', 2);
-- --------------------------------------------------------
--
-- Table structure for table `oauth_access_tokens`
--
CREATE TABLE `oauth_access_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`client_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) 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;
-- --------------------------------------------------------
--
-- Table structure for table `oauth_auth_codes`
--
CREATE TABLE `oauth_auth_codes` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`client_id` bigint(20) 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;
-- --------------------------------------------------------
--
-- Table structure for table `oauth_clients`
--
CREATE TABLE `oauth_clients` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 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;
--
-- Dumping data for table `oauth_clients`
--
INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES
(1, NULL, 'Laravel Personal Access Client', '5dDv0nz31uwat97lFOboIyrLuhFEclmq3dpDLvT0', NULL, 'http://localhost', 1, 0, 0, '2020-07-25 22:03:41', '2020-07-25 22:03:41'),
(2, NULL, 'Laravel Password Grant Client', 'vEUrLMQlpQbaw7VyThJV8Xxjni9ZPOeNXhN9dQir', 'users', 'http://localhost', 0, 1, 0, '2020-07-25 22:03:41', '2020-07-25 22:03:41');
-- --------------------------------------------------------
--
-- Table structure for table `oauth_personal_access_clients`
--
CREATE TABLE `oauth_personal_access_clients` (
`id` bigint(20) UNSIGNED NOT NULL,
`client_id` bigint(20) 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 `oauth_personal_access_clients`
--
INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES
(1, 1, '2020-07-25 22:03:41', '2020-07-25 22:03:41');
-- --------------------------------------------------------
--
-- Table structure for table `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;
-- --------------------------------------------------------
--
-- Table structure for table `partners`
--
CREATE TABLE `partners` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`partner_description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` bigint(20) NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nuit` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`picture` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`responsible_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`responsible_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`responsible_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cities_id` bigint(20) UNSIGNED NOT 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 `partner_clubs`
--
CREATE TABLE `partner_clubs` (
`id` bigint(20) UNSIGNED NOT NULL,
`destription` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`clubs_id` bigint(20) UNSIGNED NOT NULL,
`partners_id` bigint(20) UNSIGNED NOT NULL,
`users_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;
-- --------------------------------------------------------
--
-- 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 `percentagems`
--
CREATE TABLE `percentagems` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` 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;
-- --------------------------------------------------------
--
-- Table structure for table `periods`
--
CREATE TABLE `periods` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE `posts` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`photo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`estados_id` int(10) UNSIGNED NOT NULL,
`users_id` int(10) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT 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 `post_khuzelas`
--
CREATE TABLE `post_khuzelas` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`photo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`estados_id` int(10) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT 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;
-- --------------------------------------------------------
--
-- Table structure for table `producto_categorias`
--
CREATE TABLE `producto_categorias` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- Table structure for table `producto_subcategorias`
--
CREATE TABLE `producto_subcategorias` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`producto_categorias_id` bigint(20) UNSIGNED NOT 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 `products`
--
CREATE TABLE `products` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quantMin` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`price` int(11) NOT NULL,
`product_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`statuses_id` int(10) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT NULL,
`colors_id` int(10) UNSIGNED NOT NULL,
`tamanhos_id` int(10) UNSIGNED NOT NULL,
`subcategorias_id` bigint(20) UNSIGNED NOT 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 `product_colors`
--
CREATE TABLE `product_colors` (
`id` bigint(20) UNSIGNED NOT NULL,
`colors_id` int(10) UNSIGNED NOT NULL,
`products_id` bigint(20) UNSIGNED NOT 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 `product_items`
--
CREATE TABLE `product_items` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`product_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`quant_min` int(11) NOT NULL,
`quant_total` int(11) NOT NULL,
`price` int(11) NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`color_id` int(10) UNSIGNED DEFAULT NULL,
`product_id` int(10) UNSIGNED NOT NULL,
`size_id` int(10) 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 `product_item_images`
--
CREATE TABLE `product_item_images` (
`id` bigint(20) UNSIGNED NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`product_item_id` int(10) 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 `quotas`
--
CREATE TABLE `quotas` (
`id` bigint(20) UNSIGNED NOT NULL,
`quota_description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quota_value` bigint(20) NOT NULL,
`payment_date` int(11) NOT NULL,
`periods_id` int(10) UNSIGNED NOT NULL,
`clubs_id` bigint(20) UNSIGNED NOT 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 `roles`
--
CREATE TABLE `roles` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` 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`, `description`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'Administrador Khuzela', '2020-07-25 21:56:16', '2020-07-25 21:56:16'),
(2, 'manager', 'Administrador Clube', '2020-07-25 21:56:16', '2020-07-25 21:56:16'),
(3, 'user', 'Utilizador Khuzela', '2020-07-25 21:56:16', '2020-07-25 21:56:16'),
(4, 'userClube', 'Utilizador Clube', '2020-07-25 21:56:16', '2020-07-25 21:56:16');
-- --------------------------------------------------------
--
-- Table structure for table `role_user`
--
CREATE TABLE `role_user` (
`id` bigint(20) UNSIGNED NOT NULL,
`role_id` int(10) UNSIGNED NOT NULL,
`user_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;
-- --------------------------------------------------------
--
-- Table structure for table `services`
--
CREATE TABLE `services` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`khuzelaBonus` int(11) NOT NULL,
`clubBonus` int(11) NOT NULL,
`partnerBonus` int(11) NOT NULL,
`partners_id` bigint(20) UNSIGNED NOT NULL,
`percentagems_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;
-- --------------------------------------------------------
--
-- Table structure for table `service_clubs`
--
CREATE TABLE `service_clubs` (
`id` bigint(20) UNSIGNED NOT NULL,
`destription` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`clubs_id` bigint(20) UNSIGNED NOT NULL,
`services_id` bigint(20) UNSIGNED NOT NULL,
`users_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;
-- --------------------------------------------------------
--
-- Table structure for table `statuses`
--
CREATE TABLE `statuses` (
`id` bigint(20) UNSIGNED NOT NULL,
`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;
-- --------------------------------------------------------
--
-- Table structure for table `stocks`
--
CREATE TABLE `stocks` (
`id` bigint(20) UNSIGNED NOT NULL,
`quantMin` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`products_id` bigint(20) UNSIGNED NOT 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 `subcategorias`
--
CREATE TABLE `subcategorias` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`cody` int(11) NOT NULL,
`categories_id` bigint(20) UNSIGNED NOT 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 `tamanhos`
--
CREATE TABLE `tamanhos` (
`id` bigint(20) UNSIGNED NOT NULL,
`size` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` 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;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) 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,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nuit` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`bi` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`picture` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`responsible_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`responsible_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`club_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 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;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `clubs`
--
ALTER TABLE `clubs`
ADD PRIMARY KEY (`id`),
ADD KEY `clubs_cities_id_foreign` (`cities_id`);
--
-- Indexes for table `colors`
--
ALTER TABLE `colors`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `compras`
--
ALTER TABLE `compras`
ADD PRIMARY KEY (`id`),
ADD KEY `compras_meios_pagamentos_id_foreign` (`meios_pagamentos_id`),
ADD KEY `compras_statuses_id_foreign` (`statuses_id`);
--
-- Indexes for table `documents`
--
ALTER TABLE `documents`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `estados`
--
ALTER TABLE `estados`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `images`
--
ALTER TABLE `images`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `item_compras`
--
ALTER TABLE `item_compras`
ADD PRIMARY KEY (`id`),
ADD KEY `item_compras_products_id_foreign` (`products_id`),
ADD KEY `item_compras_compras_id_foreign` (`compras_id`);
--
-- Indexes for table `meios_pagamentos`
--
ALTER TABLE `meios_pagamentos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `members`
--
ALTER TABLE `members`
ADD PRIMARY KEY (`id`),
ADD KEY `members_documents_id_foreign` (`documents_id`),
ADD KEY `members_clubs_id_foreign` (`clubs_id`),
ADD KEY `members_cities_id_foreign` (`cities_id`);
--
-- Indexes for table `member_clubs`
--
ALTER TABLE `member_clubs`
ADD PRIMARY KEY (`id`),
ADD KEY `member_clubs_members_id_foreign` (`members_id`),
ADD KEY `member_clubs_clubs_id_foreign` (`clubs_id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `oauth_access_tokens`
--
ALTER TABLE `oauth_access_tokens`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_access_tokens_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_auth_codes`
--
ALTER TABLE `oauth_auth_codes`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_auth_codes_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_clients_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `oauth_refresh_tokens`
--
ALTER TABLE `oauth_refresh_tokens`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);
--
-- Indexes for table `partners`
--
ALTER TABLE `partners`
ADD PRIMARY KEY (`id`),
ADD KEY `partners_cities_id_foreign` (`cities_id`);
--
-- Indexes for table `partner_clubs`
--
ALTER TABLE `partner_clubs`
ADD PRIMARY KEY (`id`),
ADD KEY `partner_clubs_clubs_id_foreign` (`clubs_id`),
ADD KEY `partner_clubs_partners_id_foreign` (`partners_id`);
--
-- Indexes for table `percentagems`
--
ALTER TABLE `percentagems`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `periods`
--
ALTER TABLE `periods`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`),
ADD KEY `posts_clubs_id_foreign` (`clubs_id`);
--
-- Indexes for table `post_khuzelas`
--
ALTER TABLE `post_khuzelas`
ADD PRIMARY KEY (`id`),
ADD KEY `post_khuzelas_clubs_id_foreign` (`clubs_id`);
--
-- Indexes for table `producto_categorias`
--
ALTER TABLE `producto_categorias`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `producto_subcategorias`
--
ALTER TABLE `producto_subcategorias`
ADD PRIMARY KEY (`id`),
ADD KEY `producto_subcategorias_producto_categorias_id_foreign` (`producto_categorias_id`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`),
ADD KEY `products_clubs_id_foreign` (`clubs_id`),
ADD KEY `products_subcategorias_id_foreign` (`subcategorias_id`);
--
-- Indexes for table `product_colors`
--
ALTER TABLE `product_colors`
ADD PRIMARY KEY (`id`),
ADD KEY `product_colors_products_id_foreign` (`products_id`);
--
-- Indexes for table `product_items`
--
ALTER TABLE `product_items`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `product_item_images`
--
ALTER TABLE `product_item_images`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `quotas`
--
ALTER TABLE `quotas`
ADD PRIMARY KEY (`id`),
ADD KEY `quotas_clubs_id_foreign` (`clubs_id`);
--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `role_user`
--
ALTER TABLE `role_user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `services`
--
ALTER TABLE `services`
ADD PRIMARY KEY (`id`),
ADD KEY `services_partners_id_foreign` (`partners_id`);
--
-- Indexes for table `service_clubs`
--
ALTER TABLE `service_clubs`
ADD PRIMARY KEY (`id`),
ADD KEY `service_clubs_clubs_id_foreign` (`clubs_id`),
ADD KEY `service_clubs_services_id_foreign` (`services_id`);
--
-- Indexes for table `statuses`
--
ALTER TABLE `statuses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stocks`
--
ALTER TABLE `stocks`
ADD PRIMARY KEY (`id`),
ADD KEY `stocks_products_id_foreign` (`products_id`);
--
-- Indexes for table `subcategorias`
--
ALTER TABLE `subcategorias`
ADD PRIMARY KEY (`id`),
ADD KEY `subcategorias_categories_id_foreign` (`categories_id`);
--
-- Indexes for table `tamanhos`
--
ALTER TABLE `tamanhos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cities`
--
ALTER TABLE `cities`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `clubs`
--
ALTER TABLE `clubs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `colors`
--
ALTER TABLE `colors`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `compras`
--
ALTER TABLE `compras`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `documents`
--
ALTER TABLE `documents`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `estados`
--
ALTER TABLE `estados`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `images`
--
ALTER TABLE `images`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `item_compras`
--
ALTER TABLE `item_compras`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `meios_pagamentos`
--
ALTER TABLE `meios_pagamentos`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `members`
--
ALTER TABLE `members`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `member_clubs`
--
ALTER TABLE `member_clubs`
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=44;
--
-- AUTO_INCREMENT for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `partners`
--
ALTER TABLE `partners`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `partner_clubs`
--
ALTER TABLE `partner_clubs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `percentagems`
--
ALTER TABLE `percentagems`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `periods`
--
ALTER TABLE `periods`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `posts`
--
ALTER TABLE `posts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `post_khuzelas`
--
ALTER TABLE `post_khuzelas`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `producto_categorias`
--
ALTER TABLE `producto_categorias`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `producto_subcategorias`
--
ALTER TABLE `producto_subcategorias`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `product_colors`
--
ALTER TABLE `product_colors`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `product_items`
--
ALTER TABLE `product_items`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `product_item_images`
--
ALTER TABLE `product_item_images`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `quotas`
--
ALTER TABLE `quotas`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `role_user`
--
ALTER TABLE `role_user`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `service_clubs`
--
ALTER TABLE `service_clubs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `statuses`
--
ALTER TABLE `statuses`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stocks`
--
ALTER TABLE `stocks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subcategorias`
--
ALTER TABLE `subcategorias`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tamanhos`
--
ALTER TABLE `tamanhos`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `clubs`
--
ALTER TABLE `clubs`
ADD CONSTRAINT `clubs_cities_id_foreign` FOREIGN KEY (`cities_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `compras`
--
ALTER TABLE `compras`
ADD CONSTRAINT `compras_meios_pagamentos_id_foreign` FOREIGN KEY (`meios_pagamentos_id`) REFERENCES `meios_pagamentos` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `compras_statuses_id_foreign` FOREIGN KEY (`statuses_id`) REFERENCES `statuses` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `item_compras`
--
ALTER TABLE `item_compras`
ADD CONSTRAINT `item_compras_compras_id_foreign` FOREIGN KEY (`compras_id`) REFERENCES `compras` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `item_compras_products_id_foreign` FOREIGN KEY (`products_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `members`
--
ALTER TABLE `members`
ADD CONSTRAINT `members_cities_id_foreign` FOREIGN KEY (`cities_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `members_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `members_documents_id_foreign` FOREIGN KEY (`documents_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `member_clubs`
--
ALTER TABLE `member_clubs`
ADD CONSTRAINT `member_clubs_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `member_clubs_members_id_foreign` FOREIGN KEY (`members_id`) REFERENCES `members` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `partners`
--
ALTER TABLE `partners`
ADD CONSTRAINT `partners_cities_id_foreign` FOREIGN KEY (`cities_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `partner_clubs`
--
ALTER TABLE `partner_clubs`
ADD CONSTRAINT `partner_clubs_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `partner_clubs_partners_id_foreign` FOREIGN KEY (`partners_id`) REFERENCES `partners` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `posts_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `post_khuzelas`
--
ALTER TABLE `post_khuzelas`
ADD CONSTRAINT `post_khuzelas_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `producto_subcategorias`
--
ALTER TABLE `producto_subcategorias`
ADD CONSTRAINT `producto_subcategorias_producto_categorias_id_foreign` FOREIGN KEY (`producto_categorias_id`) REFERENCES `producto_categorias` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `products`
--
ALTER TABLE `products`
ADD CONSTRAINT `products_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `products_subcategorias_id_foreign` FOREIGN KEY (`subcategorias_id`) REFERENCES `subcategorias` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `product_colors`
--
ALTER TABLE `product_colors`
ADD CONSTRAINT `product_colors_products_id_foreign` FOREIGN KEY (`products_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `quotas`
--
ALTER TABLE `quotas`
ADD CONSTRAINT `quotas_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `services`
--
ALTER TABLE `services`
ADD CONSTRAINT `services_partners_id_foreign` FOREIGN KEY (`partners_id`) REFERENCES `partners` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `service_clubs`
--
ALTER TABLE `service_clubs`
ADD CONSTRAINT `service_clubs_clubs_id_foreign` FOREIGN KEY (`clubs_id`) REFERENCES `clubs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `service_clubs_services_id_foreign` FOREIGN KEY (`services_id`) REFERENCES `services` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `stocks`
--
ALTER TABLE `stocks`
ADD CONSTRAINT `stocks_products_id_foreign` FOREIGN KEY (`products_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `subcategorias`
--
ALTER TABLE `subcategorias`
ADD CONSTRAINT `subcategorias_categories_id_foreign` FOREIGN KEY (`categories_id`) REFERENCES `categories` (`id`) ON DELETE 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 */;