/home/techb158/dev.balacoffee.com/public/storage/backup
Edit: /home/techb158/dev.balacoffee.com/public/storage/backup/backup-2022-05-19.sql (91337B)
-- MariaDB dump 10.19 Distrib 10.4.21-MariaDB, for Win64 (AMD64)
--
-- Host: 127.0.0.1 Database: stocky_bb
-- ------------------------------------------------------
-- Server version 10.4.21-MariaDB
/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `adjustment_details`
--
DROP TABLE IF EXISTS `adjustment_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adjustment_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`adjustment_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`quantity` double NOT NULL,
`type` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `adjust_product_id` (`product_id`),
KEY `adjust_adjustment_id` (`adjustment_id`),
KEY `adjust_product_variant` (`product_variant_id`),
CONSTRAINT `adjust_adjustment_id` FOREIGN KEY (`adjustment_id`) REFERENCES `adjustments` (`id`),
CONSTRAINT `adjust_product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `adjust_product_variant` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `adjustment_details`
--
LOCK TABLES `adjustment_details` WRITE;
/*!40000 ALTER TABLE `adjustment_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `adjustment_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `adjustments`
--
DROP TABLE IF EXISTS `adjustments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adjustments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`items` double DEFAULT 0,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_adjustment` (`user_id`),
KEY `warehouse_id_adjustment` (`warehouse_id`),
CONSTRAINT `user_id_adjustment` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `warehouse_id_adjustment` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `adjustments`
--
LOCK TABLES `adjustments` WRITE;
/*!40000 ALTER TABLE `adjustments` DISABLE KEYS */;
/*!40000 ALTER TABLE `adjustments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `attendances`
--
DROP TABLE IF EXISTS `attendances`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendances` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`company_id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`date` date NOT NULL,
`clock_in` varchar(191) NOT NULL,
`clock_in_ip` varchar(45) NOT NULL,
`clock_out` varchar(191) NOT NULL,
`clock_out_ip` varchar(191) NOT NULL,
`clock_in_out` tinyint(1) NOT NULL,
`depart_early` varchar(191) NOT NULL DEFAULT '00:00',
`late_time` varchar(191) NOT NULL DEFAULT '00:00',
`overtime` varchar(191) NOT NULL DEFAULT '00:00',
`total_work` varchar(191) NOT NULL DEFAULT '00:00',
`total_rest` varchar(191) NOT NULL DEFAULT '00:00',
`status` varchar(191) NOT NULL DEFAULT 'present',
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `attendances_user_id` (`user_id`),
KEY `attendances_company_id` (`company_id`),
KEY `attendances_employee_id` (`employee_id`),
CONSTRAINT `attendances_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
CONSTRAINT `attendances_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
CONSTRAINT `attendances_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `attendances`
--
LOCK TABLES `attendances` WRITE;
/*!40000 ALTER TABLE `attendances` DISABLE KEYS */;
/*!40000 ALTER TABLE `attendances` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `brands`
--
DROP TABLE IF EXISTS `brands`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `brands` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(192) NOT NULL,
`description` varchar(192) DEFAULT NULL,
`image` varchar(192) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `brands`
--
LOCK TABLES `brands` WRITE;
/*!40000 ALTER TABLE `brands` DISABLE KEYS */;
/*!40000 ALTER TABLE `brands` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(192) NOT NULL,
`name` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `categories`
--
LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL,
`code` int(11) NOT NULL,
`email` varchar(192) NOT NULL,
`country` varchar(191) DEFAULT NULL,
`city` varchar(191) DEFAULT NULL,
`phone` varchar(191) DEFAULT NULL,
`adresse` varchar(191) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `clients`
--
LOCK TABLES `clients` WRITE;
/*!40000 ALTER TABLE `clients` DISABLE KEYS */;
INSERT INTO `clients` VALUES (1,'walk-in-customer',1,'walk-in-customer@example.com','bangladesh','dhaka','123456780','N45 , Dhaka',NULL,NULL,NULL);
/*!40000 ALTER TABLE `clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `companies`
--
DROP TABLE IF EXISTS `companies`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL,
`email` varchar(191) DEFAULT NULL,
`phone` varchar(191) DEFAULT NULL,
`country` varchar(191) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `companies`
--
LOCK TABLES `companies` WRITE;
/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `currencies`
--
DROP TABLE IF EXISTS `currencies`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `currencies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(192) NOT NULL,
`name` varchar(192) NOT NULL,
`symbol` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `currencies`
--
LOCK TABLES `currencies` WRITE;
/*!40000 ALTER TABLE `currencies` DISABLE KEYS */;
INSERT INTO `currencies` VALUES (1,'USD','US Dollar','$',NULL,NULL,NULL);
/*!40000 ALTER TABLE `currencies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `departments`
--
DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `departments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`department` varchar(191) NOT NULL,
`company_id` int(11) NOT NULL,
`department_head` int(11) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `department_company_id` (`company_id`),
KEY `department_department_head` (`department_head`),
CONSTRAINT `department_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
CONSTRAINT `department_department_head` FOREIGN KEY (`department_head`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `departments`
--
LOCK TABLES `departments` WRITE;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `designations`
--
DROP TABLE IF EXISTS `designations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `designations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`company_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`designation` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `designation_company_id` (`company_id`),
KEY `designation_departement_id` (`department_id`),
CONSTRAINT `designation_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
CONSTRAINT `designation_departement_id` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `designations`
--
LOCK TABLES `designations` WRITE;
/*!40000 ALTER TABLE `designations` DISABLE KEYS */;
/*!40000 ALTER TABLE `designations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employee_accounts`
--
DROP TABLE IF EXISTS `employee_accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`employee_id` int(11) NOT NULL,
`bank_name` varchar(192) NOT NULL,
`bank_branch` varchar(192) NOT NULL,
`account_no` varchar(192) NOT NULL,
`note` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `employee_accounts_employee_id` (`employee_id`),
CONSTRAINT `employee_accounts_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employee_accounts`
--
LOCK TABLES `employee_accounts` WRITE;
/*!40000 ALTER TABLE `employee_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employee_experiences`
--
DROP TABLE IF EXISTS `employee_experiences`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_experiences` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`employee_id` int(11) NOT NULL,
`title` varchar(192) NOT NULL,
`company_name` varchar(192) NOT NULL,
`location` varchar(192) DEFAULT NULL,
`employment_type` varchar(192) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `employee_experience_employee_id` (`employee_id`),
CONSTRAINT `employee_experience_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employee_experiences`
--
LOCK TABLES `employee_experiences` WRITE;
/*!40000 ALTER TABLE `employee_experiences` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_experiences` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employees`
--
DROP TABLE IF EXISTS `employees`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(192) NOT NULL,
`lastname` varchar(192) NOT NULL,
`username` varchar(191) NOT NULL,
`email` varchar(192) DEFAULT NULL,
`phone` varchar(192) DEFAULT NULL,
`country` varchar(192) DEFAULT NULL,
`city` varchar(192) DEFAULT NULL,
`province` varchar(192) DEFAULT NULL,
`zipcode` varchar(192) DEFAULT NULL,
`address` varchar(192) DEFAULT NULL,
`gender` varchar(192) NOT NULL,
`resume` varchar(192) DEFAULT NULL,
`avatar` varchar(192) DEFAULT 'no_avatar.png',
`document` varchar(192) DEFAULT NULL,
`birth_date` date DEFAULT NULL,
`joining_date` date DEFAULT NULL,
`company_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`designation_id` int(11) NOT NULL,
`office_shift_id` int(11) NOT NULL,
`remaining_leave` tinyint(1) DEFAULT 0,
`total_leave` tinyint(1) DEFAULT 0,
`hourly_rate` decimal(10,2) DEFAULT 0.00,
`basic_salary` decimal(10,2) DEFAULT 0.00,
`employment_type` varchar(192) DEFAULT 'full_time',
`leaving_date` date DEFAULT NULL,
`marital_status` varchar(192) DEFAULT 'single',
`facebook` varchar(192) DEFAULT NULL,
`skype` varchar(192) DEFAULT NULL,
`whatsapp` varchar(192) DEFAULT NULL,
`twitter` varchar(192) DEFAULT NULL,
`linkedin` varchar(192) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `employees_company_id` (`company_id`),
KEY `employees_department_id` (`department_id`),
KEY `employees_designation_id` (`designation_id`),
KEY `employees_office_shift_id` (`office_shift_id`),
CONSTRAINT `employees_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
CONSTRAINT `employees_department_id` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
CONSTRAINT `employees_designation_id` FOREIGN KEY (`designation_id`) REFERENCES `designations` (`id`),
CONSTRAINT `employees_office_shift_id` FOREIGN KEY (`office_shift_id`) REFERENCES `office_shifts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employees`
--
LOCK TABLES `employees` WRITE;
/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `expense_categories`
--
DROP TABLE IF EXISTS `expense_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expense_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`name` varchar(192) NOT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `expense_category_user_id` (`user_id`),
CONSTRAINT `expense_category_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `expense_categories`
--
LOCK TABLES `expense_categories` WRITE;
/*!40000 ALTER TABLE `expense_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `expense_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `expenses`
--
DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`user_id` int(11) NOT NULL,
`expense_category_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`details` varchar(192) NOT NULL,
`amount` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `expense_user_id` (`user_id`),
KEY `expense_category_id` (`expense_category_id`),
KEY `expense_warehouse_id` (`warehouse_id`),
CONSTRAINT `expense_category_id` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`),
CONSTRAINT `expense_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `expense_warehouse_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `expenses`
--
LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `expenses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `holidays`
--
DROP TABLE IF EXISTS `holidays`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `holidays` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(192) NOT NULL,
`company_id` int(11) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `holidays_company_id` (`company_id`),
CONSTRAINT `holidays_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `holidays`
--
LOCK TABLES `holidays` WRITE;
/*!40000 ALTER TABLE `holidays` DISABLE KEYS */;
/*!40000 ALTER TABLE `holidays` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `leave_types`
--
DROP TABLE IF EXISTS `leave_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `leave_types`
--
LOCK TABLES `leave_types` WRITE;
/*!40000 ALTER TABLE `leave_types` DISABLE KEYS */;
/*!40000 ALTER TABLE `leave_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `leaves`
--
DROP TABLE IF EXISTS `leaves`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leaves` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`employee_id` int(11) NOT NULL,
`company_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`leave_type_id` int(11) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`days` varchar(192) NOT NULL,
`reason` text DEFAULT NULL,
`attachment` varchar(192) DEFAULT NULL,
`half_day` tinyint(1) DEFAULT NULL,
`status` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `leave_employee_id` (`employee_id`),
KEY `leave_company_id` (`company_id`),
KEY `leave_department_id` (`department_id`),
KEY `leave_leave_type_id` (`leave_type_id`),
CONSTRAINT `leave_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
CONSTRAINT `leave_department_id` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
CONSTRAINT `leave_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
CONSTRAINT `leave_leave_type_id` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `leaves`
--
LOCK TABLES `leaves` WRITE;
/*!40000 ALTER TABLE `leaves` DISABLE KEYS */;
/*!40000 ALTER TABLE `leaves` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `migrations`
--
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(191) NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `migrations`
--
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'2021_03_08_020247_create_adjustment_details_table',1),(2,'2021_03_08_020247_create_adjustments_table',1),(3,'2021_03_08_020247_create_brands_table',1),(4,'2021_03_08_020247_create_categories_table',1),(5,'2021_03_08_020247_create_clients_table',1),(6,'2021_03_08_020247_create_currencies_table',1),(7,'2021_03_08_020247_create_expense_categories_table',1),(8,'2021_03_08_020247_create_expenses_table',1),(9,'2021_03_08_020247_create_password_resets_table',1),(10,'2021_03_08_020247_create_payment_purchase_returns_table',1),(11,'2021_03_08_020247_create_payment_purchases_table',1),(12,'2021_03_08_020247_create_payment_sale_returns_table',1),(13,'2021_03_08_020247_create_payment_sales_table',1),(14,'2021_03_08_020247_create_payment_with_credit_card_table',1),(15,'2021_03_08_020247_create_permission_role_table',1),(16,'2021_03_08_020247_create_permissions_table',1),(17,'2021_03_08_020247_create_product_variants_table',1),(18,'2021_03_08_020247_create_product_warehouse_table',1),(19,'2021_03_08_020247_create_products_table',1),(20,'2021_03_08_020247_create_providers_table',1),(21,'2021_03_08_020247_create_purchase_details_table',1),(22,'2021_03_08_020247_create_purchase_return_details_table',1),(23,'2021_03_08_020247_create_purchase_returns_table',1),(24,'2021_03_08_020247_create_purchases_table',1),(25,'2021_03_08_020247_create_quotation_details_table',1),(26,'2021_03_08_020247_create_quotations_table',1),(27,'2021_03_08_020247_create_role_user_table',1),(28,'2021_03_08_020247_create_roles_table',1),(29,'2021_03_08_020247_create_sale_details_table',1),(30,'2021_03_08_020247_create_sale_return_details_table',1),(31,'2021_03_08_020247_create_sale_returns_table',1),(32,'2021_03_08_020247_create_sales_table',1),(33,'2021_03_08_020247_create_serveurs_table',1),(34,'2021_03_08_020247_create_settings_table',1),(35,'2021_03_08_020247_create_transfer_details_table',1),(36,'2021_03_08_020247_create_transfers_table',1),(37,'2021_03_08_020247_create_units_table',1),(38,'2021_03_08_020247_create_users_table',1),(39,'2021_03_08_020247_create_warehouses_table',1),(40,'2021_03_08_020248_add_status_to_roles_table',1),(41,'2021_03_08_020251_add_foreign_keys_to_adjustment_details_table',1),(42,'2021_03_08_020251_add_foreign_keys_to_adjustments_table',1),(43,'2021_03_08_020251_add_foreign_keys_to_expense_categories_table',1),(44,'2021_03_08_020251_add_foreign_keys_to_expenses_table',1),(45,'2021_03_08_020251_add_foreign_keys_to_payment_purchase_returns_table',1),(46,'2021_03_08_020251_add_foreign_keys_to_payment_purchases_table',1),(47,'2021_03_08_020251_add_foreign_keys_to_payment_sale_returns_table',1),(48,'2021_03_08_020251_add_foreign_keys_to_payment_sales_table',1),(49,'2021_03_08_020251_add_foreign_keys_to_permission_role_table',1),(50,'2021_03_08_020251_add_foreign_keys_to_product_variants_table',1),(51,'2021_03_08_020251_add_foreign_keys_to_product_warehouse_table',1),(52,'2021_03_08_020251_add_foreign_keys_to_products_table',1),(53,'2021_03_08_020251_add_foreign_keys_to_purchase_details_table',1),(54,'2021_03_08_020251_add_foreign_keys_to_purchase_return_details_table',1),(55,'2021_03_08_020251_add_foreign_keys_to_purchase_returns_table',1),(56,'2021_03_08_020251_add_foreign_keys_to_purchases_table',1),(57,'2021_03_08_020251_add_foreign_keys_to_quotation_details_table',1),(58,'2021_03_08_020251_add_foreign_keys_to_quotations_table',1),(59,'2021_03_08_020251_add_foreign_keys_to_role_user_table',1),(60,'2021_03_08_020251_add_foreign_keys_to_sale_details_table',1),(61,'2021_03_08_020251_add_foreign_keys_to_sale_return_details_table',1),(62,'2021_03_08_020251_add_foreign_keys_to_sale_returns_table',1),(63,'2021_03_08_020251_add_foreign_keys_to_sales_table',1),(64,'2021_03_08_020251_add_foreign_keys_to_settings_table',1),(65,'2021_03_08_020251_add_foreign_keys_to_transfer_details_table',1),(66,'2021_03_08_020251_add_foreign_keys_to_transfers_table',1),(67,'2021_03_08_020251_add_foreign_keys_to_units_table',1),(68,'2021_04_11_221536_add_footer_to_settings_table',1),(69,'2021_04_30_040505_add_devopped_by_to_settings',1),(70,'2021_05_07_140933_add_client_id_to_settings_table',1),(71,'2021_05_07_141034_add_warehouse_id_to_settings_table',1),(72,'2021_05_07_141303_add_foreign_keys_clients_to_settings',1),(73,'2021_07_19_141906_add_sale_unit_id_to_sale_details',1),(74,'2021_07_22_013045_add_sale_unit_id_to_quotation_details_table',1),(75,'2021_07_22_032512_add_purchase_unit_id_to_purchase_details_table',1),(76,'2021_07_22_052330_add_sale_unit_id_to_sale_return_details_table',1),(77,'2021_07_22_052447_add_purchase_unit_id_to_purchase_return_details_table',1),(78,'2021_07_22_052713_add_purchase_unit_id_to_transfer_details_table',1),(79,'2021_07_26_155038_change_cost_column_type_return_details',1),(80,'2021_07_30_142441_add_change_to_payment_sales',1),(81,'2021_07_31_122946_add_change_to_payment_purchases_table',1),(82,'2021_07_31_123105_add_change_to_payment_sale_returns_table',1),(83,'2021_07_31_123135_add_change_to_payment_purchase_returns_table',1),(84,'2021_09_23_003640_add_default_language_to_settings_table',1),(85,'2021_09_24_000547_create_pos_settings',1),(86,'2022_02_18_161351_create_attendances_table',1),(87,'2022_02_18_161351_create_companies_table',1),(88,'2022_02_18_161351_create_departments_table',1),(89,'2022_02_18_161351_create_designations_table',1),(90,'2022_02_18_161351_create_employee_accounts_table',1),(91,'2022_02_18_161351_create_employee_experiences_table',1),(92,'2022_02_18_161351_create_employees_table',1),(93,'2022_02_18_161351_create_holidays_table',1),(94,'2022_02_18_161351_create_leave_types_table',1),(95,'2022_02_18_161351_create_leaves_table',1),(96,'2022_02_18_161351_create_office_shifts_table',1),(97,'2022_02_18_161355_add_foreign_keys_to_attendances_table',1),(98,'2022_02_18_161355_add_foreign_keys_to_departments_table',1),(99,'2022_02_18_161355_add_foreign_keys_to_designations_table',1),(100,'2022_02_18_161355_add_foreign_keys_to_employee_accounts_table',1),(101,'2022_02_18_161355_add_foreign_keys_to_employee_experiences_table',1),(102,'2022_02_18_161355_add_foreign_keys_to_employees_table',1),(103,'2022_02_18_161355_add_foreign_keys_to_holidays_table',1),(104,'2022_02_18_161355_add_foreign_keys_to_leaves_table',1),(105,'2022_02_18_161355_add_foreign_keys_to_office_shifts_table',1),(106,'2022_04_06_155633_create_user_warehouse_table',1),(107,'2022_04_06_155635_add_foreign_keys_to_user_warehouse_table',1),(108,'2022_04_08_001056_change_type_of_columns__clients__table',1),(109,'2022_04_08_002126_change_type_of_columns__providers__table',1),(110,'2022_04_26_163039_add_imei_to_product_table',1),(111,'2022_04_26_163314_add_imei_number_to_purchase_details',1),(112,'2022_04_26_163516_add_imei_number_to_quotation_details',1),(113,'2022_04_26_163600_add_imei_number_to_sale_details',1),(114,'2022_04_26_163653_add_imei_number_to_sale_return_details',1),(115,'2022_04_26_163741_add_imei_number_to_purchase_return_details',1),(116,'2022_05_01_005644_add_shipping_status_to_sales',1),(117,'2022_05_11_010241_add_is_all_warehouses_to_users',1),(118,'2022_05_14_191716_create_shipments_table',1),(119,'2022_05_14_191718_add_foreign_keys_to_shipments_table',1),(120,'2016_06_01_000001_create_oauth_auth_codes_table',2),(121,'2016_06_01_000002_create_oauth_access_tokens_table',2),(122,'2016_06_01_000003_create_oauth_refresh_tokens_table',2),(123,'2016_06_01_000004_create_oauth_clients_table',2),(124,'2016_06_01_000005_create_oauth_personal_access_clients_table',2);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_access_tokens`
--
DROP TABLE IF EXISTS `oauth_access_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_access_tokens` (
`id` varchar(100) NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`client_id` bigint(20) unsigned NOT NULL,
`name` varchar(191) DEFAULT NULL,
`scopes` text DEFAULT NULL,
`revoked` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_access_tokens_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_access_tokens`
--
LOCK TABLES `oauth_access_tokens` WRITE;
/*!40000 ALTER TABLE `oauth_access_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `oauth_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_auth_codes`
--
DROP TABLE IF EXISTS `oauth_auth_codes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_auth_codes` (
`id` varchar(100) NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`client_id` bigint(20) unsigned NOT NULL,
`scopes` text DEFAULT NULL,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_auth_codes_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_auth_codes`
--
LOCK TABLES `oauth_auth_codes` WRITE;
/*!40000 ALTER TABLE `oauth_auth_codes` DISABLE KEYS */;
/*!40000 ALTER TABLE `oauth_auth_codes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_clients`
--
DROP TABLE IF EXISTS `oauth_clients`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_clients` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(191) NOT NULL,
`secret` varchar(100) DEFAULT NULL,
`provider` varchar(191) DEFAULT NULL,
`redirect` text 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,
PRIMARY KEY (`id`),
KEY `oauth_clients_user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_clients`
--
LOCK TABLES `oauth_clients` WRITE;
/*!40000 ALTER TABLE `oauth_clients` DISABLE KEYS */;
INSERT INTO `oauth_clients` VALUES (1,NULL,'Stocky Personal Access Client','B1m7Ar4ZoPGsQxBAtij032ymMJVF2nxMLN4ZPsUW',NULL,'http://localhost',1,0,0,'2022-05-19 15:53:23','2022-05-19 15:53:23'),(2,NULL,'Stocky Password Grant Client','UMJpWcRgDRXud5SZZMm6Zvyv0bWAve1aYMXJ2336','users','http://localhost',0,1,0,'2022-05-19 15:53:23','2022-05-19 15:53:23');
/*!40000 ALTER TABLE `oauth_clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_personal_access_clients`
--
DROP TABLE IF EXISTS `oauth_personal_access_clients`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_personal_access_clients` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_personal_access_clients`
--
LOCK TABLES `oauth_personal_access_clients` WRITE;
/*!40000 ALTER TABLE `oauth_personal_access_clients` DISABLE KEYS */;
INSERT INTO `oauth_personal_access_clients` VALUES (1,1,'2022-05-19 15:53:23','2022-05-19 15:53:23');
/*!40000 ALTER TABLE `oauth_personal_access_clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_refresh_tokens`
--
DROP TABLE IF EXISTS `oauth_refresh_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_refresh_tokens` (
`id` varchar(100) NOT NULL,
`access_token_id` varchar(100) NOT NULL,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_refresh_tokens`
--
LOCK TABLES `oauth_refresh_tokens` WRITE;
/*!40000 ALTER TABLE `oauth_refresh_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `oauth_refresh_tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `office_shifts`
--
DROP TABLE IF EXISTS `office_shifts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `office_shifts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`company_id` int(11) NOT NULL,
`name` varchar(191) NOT NULL,
`monday_in` varchar(191) DEFAULT NULL,
`monday_out` varchar(191) DEFAULT NULL,
`tuesday_in` varchar(191) DEFAULT NULL,
`tuesday_out` varchar(191) DEFAULT NULL,
`wednesday_in` varchar(191) DEFAULT NULL,
`wednesday_out` varchar(191) DEFAULT NULL,
`thursday_in` varchar(191) DEFAULT NULL,
`thursday_out` varchar(191) DEFAULT NULL,
`friday_in` varchar(191) DEFAULT NULL,
`friday_out` varchar(191) DEFAULT NULL,
`saturday_in` varchar(191) DEFAULT NULL,
`saturday_out` varchar(191) DEFAULT NULL,
`sunday_in` varchar(191) DEFAULT NULL,
`sunday_out` varchar(191) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `office_shift_company_id` (`company_id`),
CONSTRAINT `office_shift_company_id` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `office_shifts`
--
LOCK TABLES `office_shifts` WRITE;
/*!40000 ALTER TABLE `office_shifts` DISABLE KEYS */;
/*!40000 ALTER TABLE `office_shifts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(191) NOT NULL,
`token` varchar(191) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `email` (`email`),
KEY `token` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_purchase_returns`
--
DROP TABLE IF EXISTS `payment_purchase_returns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_purchase_returns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`purchase_return_id` int(11) NOT NULL,
`montant` double NOT NULL,
`change` double NOT NULL DEFAULT 0,
`Reglement` varchar(191) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_payment_return_purchase` (`user_id`),
KEY `supplier_id_payment_return_purchase` (`purchase_return_id`),
CONSTRAINT `supplier_id_payment_return_purchase` FOREIGN KEY (`purchase_return_id`) REFERENCES `purchase_returns` (`id`),
CONSTRAINT `user_id_payment_return_purchase` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_purchase_returns`
--
LOCK TABLES `payment_purchase_returns` WRITE;
/*!40000 ALTER TABLE `payment_purchase_returns` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_purchase_returns` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_purchases`
--
DROP TABLE IF EXISTS `payment_purchases`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_purchases` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`purchase_id` int(11) NOT NULL,
`montant` double NOT NULL,
`change` double NOT NULL DEFAULT 0,
`Reglement` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_payment_purchases` (`user_id`),
KEY `payments_purchase_id` (`purchase_id`),
CONSTRAINT `factures_purchase_id` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`),
CONSTRAINT `user_id_factures_achat` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_purchases`
--
LOCK TABLES `payment_purchases` WRITE;
/*!40000 ALTER TABLE `payment_purchases` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_purchases` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_sale_returns`
--
DROP TABLE IF EXISTS `payment_sale_returns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_sale_returns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`sale_return_id` int(11) NOT NULL,
`montant` double NOT NULL,
`change` double NOT NULL DEFAULT 0,
`Reglement` varchar(191) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `factures_sale_return_user_id` (`user_id`),
KEY `factures_sale_return` (`sale_return_id`),
CONSTRAINT `factures_sale_return` FOREIGN KEY (`sale_return_id`) REFERENCES `sale_returns` (`id`),
CONSTRAINT `factures_sale_return_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_sale_returns`
--
LOCK TABLES `payment_sale_returns` WRITE;
/*!40000 ALTER TABLE `payment_sale_returns` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_sale_returns` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_sales`
--
DROP TABLE IF EXISTS `payment_sales`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_sales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`sale_id` int(11) NOT NULL,
`montant` double NOT NULL,
`change` double NOT NULL DEFAULT 0,
`Reglement` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_payments_sale` (`user_id`),
KEY `payment_sale_id` (`sale_id`),
CONSTRAINT `facture_sale_id` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`),
CONSTRAINT `user_id_factures_ventes` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_sales`
--
LOCK TABLES `payment_sales` WRITE;
/*!40000 ALTER TABLE `payment_sales` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_sales` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_with_credit_card`
--
DROP TABLE IF EXISTS `payment_with_credit_card`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_with_credit_card` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`payment_id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`customer_stripe_id` varchar(192) NOT NULL,
`charge_id` varchar(192) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_with_credit_card`
--
LOCK TABLES `payment_with_credit_card` WRITE;
/*!40000 ALTER TABLE `payment_with_credit_card` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_with_credit_card` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `permission_role`
--
DROP TABLE IF EXISTS `permission_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permission_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`permission_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `permission_role_permission_id` (`permission_id`),
KEY `permission_role_role_id` (`role_id`),
CONSTRAINT `permission_role_permission_id` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`),
CONSTRAINT `permission_role_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permission_role`
--
LOCK TABLES `permission_role` WRITE;
/*!40000 ALTER TABLE `permission_role` DISABLE KEYS */;
INSERT INTO `permission_role` VALUES (1,1,1),(2,2,1),(3,3,1),(4,4,1),(5,5,1),(6,6,1),(7,7,1),(8,8,1),(9,9,1),(10,10,1),(11,11,1),(12,12,1),(13,13,1),(14,14,1),(15,15,1),(16,16,1),(17,17,1),(18,18,1),(19,19,1),(20,20,1),(21,21,1),(22,22,1),(23,23,1),(24,24,1),(25,25,1),(26,26,1),(27,27,1),(28,28,1),(29,29,1),(30,30,1),(31,31,1),(32,32,1),(33,33,1),(34,34,1),(35,35,1),(36,36,1),(37,37,1),(38,38,1),(39,39,1),(40,40,1),(41,41,1),(42,42,1),(43,43,1),(44,44,1),(45,45,1),(46,46,1),(47,47,1),(48,48,1),(49,49,1),(50,50,1),(51,51,1),(52,52,1),(53,53,1),(54,54,1),(55,55,1),(56,56,1),(57,57,1),(58,58,1),(59,59,1),(60,60,1),(61,61,1),(62,62,1),(63,63,1),(64,64,1),(65,65,1),(66,66,1),(67,67,1),(68,68,1),(69,69,1),(70,70,1),(72,72,1),(73,73,1),(74,74,1),(75,75,1),(76,76,1),(77,77,1),(78,78,1),(79,79,1),(80,80,1),(81,81,1),(82,82,1),(83,83,1),(84,84,1),(85,85,1),(86,86,1),(87,87,1),(88,88,1),(89,89,1),(90,90,1),(91,91,1),(92,92,1),(93,93,1),(94,94,1),(95,95,1),(96,96,1),(97,97,1),(98,98,1),(99,99,1),(100,100,1),(101,101,1),(102,102,1),(103,103,1),(104,104,1),(105,105,1);
/*!40000 ALTER TABLE `permission_role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `permissions`
--
DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(192) NOT NULL,
`label` varchar(192) DEFAULT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permissions`
--
LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` VALUES (1,'users_view',NULL,NULL,NULL,NULL,NULL),(2,'users_edit',NULL,NULL,NULL,NULL,NULL),(3,'record_view',NULL,NULL,NULL,NULL,NULL),(4,'users_delete',NULL,NULL,NULL,NULL,NULL),(5,'users_add',NULL,NULL,NULL,NULL,NULL),(6,'permissions_edit',NULL,NULL,NULL,NULL,NULL),(7,'permissions_view',NULL,NULL,NULL,NULL,NULL),(8,'permissions_delete',NULL,NULL,NULL,NULL,NULL),(9,'permissions_add',NULL,NULL,NULL,NULL,NULL),(10,'products_delete',NULL,NULL,NULL,NULL,NULL),(11,'products_view',NULL,NULL,NULL,NULL,NULL),(12,'barcode_view',NULL,NULL,NULL,NULL,NULL),(13,'products_edit',NULL,NULL,NULL,NULL,NULL),(14,'products_add',NULL,NULL,NULL,NULL,NULL),(15,'expense_add',NULL,NULL,NULL,NULL,NULL),(16,'expense_delete',NULL,NULL,NULL,NULL,NULL),(17,'expense_edit',NULL,NULL,NULL,NULL,NULL),(18,'expense_view',NULL,NULL,NULL,NULL,NULL),(19,'transfer_delete',NULL,NULL,NULL,NULL,NULL),(20,'transfer_add',NULL,NULL,NULL,NULL,NULL),(21,'transfer_view',NULL,NULL,NULL,NULL,NULL),(22,'transfer_edit',NULL,NULL,NULL,NULL,NULL),(23,'adjustment_delete',NULL,NULL,NULL,NULL,NULL),(24,'adjustment_add',NULL,NULL,NULL,NULL,NULL),(25,'adjustment_edit',NULL,NULL,NULL,NULL,NULL),(26,'adjustment_view',NULL,NULL,NULL,NULL,NULL),(27,'Sales_edit',NULL,NULL,NULL,NULL,NULL),(28,'Sales_view',NULL,NULL,NULL,NULL,NULL),(29,'Sales_delete',NULL,NULL,NULL,NULL,NULL),(30,'Sales_add',NULL,NULL,NULL,NULL,NULL),(31,'Purchases_edit',NULL,NULL,NULL,NULL,NULL),(32,'Purchases_view',NULL,NULL,NULL,NULL,NULL),(33,'Purchases_delete',NULL,NULL,NULL,NULL,NULL),(34,'Purchases_add',NULL,NULL,NULL,NULL,NULL),(35,'Quotations_edit',NULL,NULL,NULL,NULL,NULL),(36,'Quotations_delete',NULL,NULL,NULL,NULL,NULL),(37,'Quotations_add',NULL,NULL,NULL,NULL,NULL),(38,'Quotations_view',NULL,NULL,NULL,NULL,NULL),(39,'payment_sales_delete',NULL,NULL,NULL,NULL,NULL),(40,'payment_sales_add',NULL,NULL,NULL,NULL,NULL),(41,'payment_sales_edit',NULL,NULL,NULL,NULL,NULL),(42,'payment_sales_view',NULL,NULL,NULL,NULL,NULL),(43,'Purchase_Returns_delete',NULL,NULL,NULL,NULL,NULL),(44,'Purchase_Returns_add',NULL,NULL,NULL,NULL,NULL),(45,'Purchase_Returns_view',NULL,NULL,NULL,NULL,NULL),(46,'Purchase_Returns_edit',NULL,NULL,NULL,NULL,NULL),(47,'Sale_Returns_delete',NULL,NULL,NULL,NULL,NULL),(48,'Sale_Returns_add',NULL,NULL,NULL,NULL,NULL),(49,'Sale_Returns_edit',NULL,NULL,NULL,NULL,NULL),(50,'Sale_Returns_view',NULL,NULL,NULL,NULL,NULL),(51,'payment_purchases_edit',NULL,NULL,NULL,NULL,NULL),(52,'payment_purchases_view',NULL,NULL,NULL,NULL,NULL),(53,'payment_purchases_delete',NULL,NULL,NULL,NULL,NULL),(54,'payment_purchases_add',NULL,NULL,NULL,NULL,NULL),(55,'payment_returns_edit',NULL,NULL,NULL,NULL,NULL),(56,'payment_returns_view',NULL,NULL,NULL,NULL,NULL),(57,'payment_returns_delete',NULL,NULL,NULL,NULL,NULL),(58,'payment_returns_add',NULL,NULL,NULL,NULL,NULL),(59,'Customers_edit',NULL,NULL,NULL,NULL,NULL),(60,'Customers_view',NULL,NULL,NULL,NULL,NULL),(61,'Customers_delete',NULL,NULL,NULL,NULL,NULL),(62,'Customers_add',NULL,NULL,NULL,NULL,NULL),(63,'unit',NULL,NULL,NULL,NULL,NULL),(64,'currency',NULL,NULL,NULL,NULL,NULL),(65,'category',NULL,NULL,NULL,NULL,NULL),(66,'backup',NULL,NULL,NULL,NULL,NULL),(67,'warehouse',NULL,NULL,NULL,NULL,NULL),(68,'brand',NULL,NULL,NULL,NULL,NULL),(69,'setting_system',NULL,NULL,NULL,NULL,NULL),(70,'Warehouse_report',NULL,NULL,NULL,NULL,NULL),(72,'Reports_quantity_alerts',NULL,NULL,NULL,NULL,NULL),(73,'Reports_profit',NULL,NULL,NULL,NULL,NULL),(74,'Reports_suppliers',NULL,NULL,NULL,NULL,NULL),(75,'Reports_customers',NULL,NULL,NULL,NULL,NULL),(76,'Reports_purchase',NULL,NULL,NULL,NULL,NULL),(77,'Reports_sales',NULL,NULL,NULL,NULL,NULL),(78,'Reports_payments_purchase_Return',NULL,NULL,NULL,NULL,NULL),(79,'Reports_payments_Sale_Returns',NULL,NULL,NULL,NULL,NULL),(80,'Reports_payments_Purchases',NULL,NULL,NULL,NULL,NULL),(81,'Reports_payments_Sales',NULL,NULL,NULL,NULL,NULL),(82,'Suppliers_delete',NULL,NULL,NULL,NULL,NULL),(83,'Suppliers_add',NULL,NULL,NULL,NULL,NULL),(84,'Suppliers_edit',NULL,NULL,NULL,NULL,NULL),(85,'Suppliers_view',NULL,NULL,NULL,NULL,NULL),(86,'Pos_view',NULL,NULL,NULL,NULL,NULL),(87,'product_import',NULL,NULL,NULL,NULL,NULL),(88,'customers_import',NULL,NULL,NULL,NULL,NULL),(89,'Suppliers_import',NULL,NULL,NULL,NULL,NULL),(90,'view_employee',NULL,NULL,NULL,NULL,NULL),(91,'add_employee',NULL,NULL,NULL,NULL,NULL),(92,'edit_employee',NULL,NULL,NULL,NULL,NULL),(93,'delete_employee',NULL,NULL,NULL,NULL,NULL),(94,'company',NULL,NULL,NULL,NULL,NULL),(95,'department',NULL,NULL,NULL,NULL,NULL),(96,'designation',NULL,NULL,NULL,NULL,NULL),(97,'office_shift',NULL,NULL,NULL,NULL,NULL),(98,'attendance',NULL,NULL,NULL,NULL,NULL),(99,'leave',NULL,NULL,NULL,NULL,NULL),(100,'holiday',NULL,NULL,NULL,NULL,NULL),(101,'Top_products',NULL,NULL,NULL,NULL,NULL),(102,'Top_customers',NULL,NULL,NULL,NULL,NULL),(103,'shipment',NULL,NULL,NULL,NULL,NULL),(104,'users_report',NULL,NULL,NULL,NULL,NULL),(105,'stock_report',NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pos_settings`
--
DROP TABLE IF EXISTS `pos_settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pos_settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`note_customer` varchar(192) NOT NULL DEFAULT 'Thank You For Shopping With Us . Please Come Again',
`show_note` tinyint(1) NOT NULL DEFAULT 1,
`show_barcode` tinyint(1) NOT NULL DEFAULT 1,
`show_discount` tinyint(1) NOT NULL DEFAULT 1,
`show_customer` tinyint(1) NOT NULL DEFAULT 1,
`show_email` tinyint(1) NOT NULL DEFAULT 1,
`show_phone` tinyint(1) NOT NULL DEFAULT 1,
`show_address` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pos_settings`
--
LOCK TABLES `pos_settings` WRITE;
/*!40000 ALTER TABLE `pos_settings` DISABLE KEYS */;
INSERT INTO `pos_settings` VALUES (1,'Thank You For Shopping With Us . Please Come Again',1,1,1,1,1,1,1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `pos_settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_variants`
--
DROP TABLE IF EXISTS `product_variants`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_variants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) DEFAULT NULL,
`name` varchar(192) DEFAULT NULL,
`qty` decimal(8,2) DEFAULT 0.00,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `product_id_variant` (`product_id`),
CONSTRAINT `product_id_variant` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_variants`
--
LOCK TABLES `product_variants` WRITE;
/*!40000 ALTER TABLE `product_variants` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_variants` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_warehouse`
--
DROP TABLE IF EXISTS `product_warehouse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_warehouse` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`qte` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `product_warehouse_id` (`product_id`),
KEY `warehouse_id` (`warehouse_id`),
KEY `product_variant_id` (`product_variant_id`),
CONSTRAINT `art_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `mag_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
CONSTRAINT `product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_warehouse`
--
LOCK TABLES `product_warehouse` WRITE;
/*!40000 ALTER TABLE `product_warehouse` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_warehouse` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(192) NOT NULL,
`Type_barcode` varchar(192) NOT NULL,
`name` varchar(192) NOT NULL,
`cost` double NOT NULL,
`price` double NOT NULL,
`category_id` int(11) NOT NULL,
`brand_id` int(11) DEFAULT NULL,
`unit_id` int(11) DEFAULT NULL,
`unit_sale_id` int(11) DEFAULT NULL,
`unit_purchase_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT 0,
`tax_method` varchar(192) DEFAULT '1',
`image` text DEFAULT NULL,
`note` text DEFAULT NULL,
`stock_alert` double DEFAULT 0,
`is_variant` tinyint(1) NOT NULL DEFAULT 0,
`is_imei` tinyint(1) NOT NULL DEFAULT 0,
`is_active` tinyint(1) DEFAULT 1,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `category_id` (`category_id`),
KEY `brand_id_products` (`brand_id`),
KEY `unit_id_products` (`unit_id`),
KEY `unit_id_sales` (`unit_sale_id`),
KEY `unit_purchase_products` (`unit_purchase_id`),
CONSTRAINT `brand_id_products` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`),
CONSTRAINT `category_id` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
CONSTRAINT `unit_id_products` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`),
CONSTRAINT `unit_id_sales` FOREIGN KEY (`unit_sale_id`) REFERENCES `units` (`id`),
CONSTRAINT `unit_purchase_products` FOREIGN KEY (`unit_purchase_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `providers`
--
DROP TABLE IF EXISTS `providers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `providers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL,
`code` int(11) NOT NULL,
`email` varchar(192) NOT NULL,
`phone` varchar(191) DEFAULT NULL,
`country` varchar(191) DEFAULT NULL,
`city` varchar(191) DEFAULT NULL,
`adresse` varchar(191) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `providers`
--
LOCK TABLES `providers` WRITE;
/*!40000 ALTER TABLE `providers` DISABLE KEYS */;
/*!40000 ALTER TABLE `providers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `purchase_details`
--
DROP TABLE IF EXISTS `purchase_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cost` double NOT NULL,
`purchase_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT 0,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT 0,
`discount_method` varchar(192) DEFAULT '1',
`purchase_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`imei_number` text DEFAULT NULL,
`total` double NOT NULL,
`quantity` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `purchase_id` (`purchase_id`),
KEY `product_id` (`product_id`),
KEY `purchase_product_variant_id` (`product_variant_id`),
KEY `purchase_unit_id_purchase` (`purchase_unit_id`),
CONSTRAINT `product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON UPDATE CASCADE,
CONSTRAINT `purchase_id` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`),
CONSTRAINT `purchase_product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `purchase_unit_id_purchase` FOREIGN KEY (`purchase_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `purchase_details`
--
LOCK TABLES `purchase_details` WRITE;
/*!40000 ALTER TABLE `purchase_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `purchase_return_details`
--
DROP TABLE IF EXISTS `purchase_return_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_return_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cost` decimal(16,3) NOT NULL,
`purchase_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT 0,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT 0,
`discount_method` varchar(192) DEFAULT '1',
`total` double NOT NULL,
`quantity` double NOT NULL,
`purchase_return_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`imei_number` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `purchase_return_id_return` (`purchase_return_id`),
KEY `product_id_details_purchase_return` (`product_id`),
KEY `purchase_return_product_variant_id` (`product_variant_id`),
KEY `unit_id_purchase_return_details` (`purchase_unit_id`),
CONSTRAINT `product_id_details_purchase_return` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `purchase_return_id_return` FOREIGN KEY (`purchase_return_id`) REFERENCES `purchase_returns` (`id`),
CONSTRAINT `purchase_return_product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`),
CONSTRAINT `unit_id_purchase_return_details` FOREIGN KEY (`purchase_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `purchase_return_details`
--
LOCK TABLES `purchase_return_details` WRITE;
/*!40000 ALTER TABLE `purchase_return_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_return_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `purchase_returns`
--
DROP TABLE IF EXISTS `purchase_returns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_returns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`provider_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL,
`paid_amount` double NOT NULL DEFAULT 0,
`payment_statut` varchar(192) NOT NULL,
`statut` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_returns` (`user_id`),
KEY `provider_id_return` (`provider_id`),
KEY `purchase_return_warehouse_id` (`warehouse_id`),
CONSTRAINT `provider_id_return` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`),
CONSTRAINT `purchase_return_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `purchase_return_warehouse_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `purchase_returns`
--
LOCK TABLES `purchase_returns` WRITE;
/*!40000 ALTER TABLE `purchase_returns` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_returns` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `purchases`
--
DROP TABLE IF EXISTS `purchases`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchases` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`Ref` varchar(192) NOT NULL,
`date` date NOT NULL,
`provider_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL,
`paid_amount` double NOT NULL DEFAULT 0,
`statut` varchar(191) NOT NULL,
`payment_statut` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_purchases` (`user_id`),
KEY `provider_id` (`provider_id`),
KEY `warehouse_id_purchase` (`warehouse_id`),
CONSTRAINT `provider_id` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`),
CONSTRAINT `user_id_purchases` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `warehouse_id_purchase` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `purchases`
--
LOCK TABLES `purchases` WRITE;
/*!40000 ALTER TABLE `purchases` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchases` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `quotation_details`
--
DROP TABLE IF EXISTS `quotation_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quotation_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`price` double NOT NULL,
`sale_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT 0,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT 0,
`discount_method` varchar(192) DEFAULT '1',
`total` double NOT NULL,
`quantity` double NOT NULL,
`product_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`imei_number` text DEFAULT NULL,
`quotation_id` int(11) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `product_id_quotation_details` (`product_id`),
KEY `quote_product_variant_id` (`product_variant_id`),
KEY `quotation_id` (`quotation_id`),
KEY `sale_unit_id_quotation` (`sale_unit_id`),
CONSTRAINT `product_id_quotation_details` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `quotation_id` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`),
CONSTRAINT `quote_product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`),
CONSTRAINT `sale_unit_id_quotation` FOREIGN KEY (`sale_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `quotation_details`
--
LOCK TABLES `quotation_details` WRITE;
/*!40000 ALTER TABLE `quotation_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `quotation_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `quotations`
--
DROP TABLE IF EXISTS `quotations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quotations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`client_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL,
`statut` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_quotation` (`user_id`),
KEY `client_id_quotation` (`client_id`),
KEY `warehouse_id_quotation` (`warehouse_id`),
CONSTRAINT `client_id _quotation` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
CONSTRAINT `user_id_quotation` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `warehouse_id_quotation` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `quotations`
--
LOCK TABLES `quotations` WRITE;
/*!40000 ALTER TABLE `quotations` DISABLE KEYS */;
/*!40000 ALTER TABLE `quotations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role_user`
--
DROP TABLE IF EXISTS `role_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `role_user_user_id` (`user_id`),
KEY `role_user_role_id` (`role_id`),
CONSTRAINT `role_user_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`),
CONSTRAINT `role_user_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role_user`
--
LOCK TABLES `role_user` WRITE;
/*!40000 ALTER TABLE `role_user` DISABLE KEYS */;
INSERT INTO `role_user` VALUES (1,1,1,NULL,NULL);
/*!40000 ALTER TABLE `role_user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(192) NOT NULL,
`label` varchar(192) DEFAULT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`status` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `roles`
--
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'Owner','Owner','Owner',NULL,NULL,NULL,1);
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sale_details`
--
DROP TABLE IF EXISTS `sale_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`sale_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`imei_number` text DEFAULT NULL,
`price` double NOT NULL,
`sale_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT NULL,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT NULL,
`discount_method` varchar(192) DEFAULT '1',
`total` double NOT NULL,
`quantity` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `Details_Sale_id` (`sale_id`),
KEY `sale_product_id` (`product_id`),
KEY `sale_product_variant_id` (`product_variant_id`),
KEY `sales_sale_unit_id` (`sale_unit_id`),
CONSTRAINT `Details_Sale_id` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`),
CONSTRAINT `sale_product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `sale_product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`),
CONSTRAINT `sales_sale_unit_id` FOREIGN KEY (`sale_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sale_details`
--
LOCK TABLES `sale_details` WRITE;
/*!40000 ALTER TABLE `sale_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `sale_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sale_return_details`
--
DROP TABLE IF EXISTS `sale_return_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_return_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sale_return_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`price` double NOT NULL,
`sale_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT 0,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT 0,
`discount_method` varchar(192) DEFAULT '1',
`product_variant_id` int(11) DEFAULT NULL,
`imei_number` text DEFAULT NULL,
`quantity` double NOT NULL,
`total` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `return_id` (`sale_return_id`),
KEY `product_id_details_returns` (`product_id`),
KEY `sale_return_id_product_variant_id` (`product_variant_id`),
KEY `sale_unit_id_return_details` (`sale_unit_id`),
CONSTRAINT `product_id_details_returns` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `sale_return_id` FOREIGN KEY (`sale_return_id`) REFERENCES `sale_returns` (`id`),
CONSTRAINT `sale_return_id_product_variant_id` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`),
CONSTRAINT `sale_unit_id_return_details` FOREIGN KEY (`sale_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sale_return_details`
--
LOCK TABLES `sale_return_details` WRITE;
/*!40000 ALTER TABLE `sale_return_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `sale_return_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sale_returns`
--
DROP TABLE IF EXISTS `sale_returns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_returns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`client_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL,
`paid_amount` double NOT NULL DEFAULT 0,
`payment_statut` varchar(192) NOT NULL,
`statut` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_returns` (`user_id`),
KEY `client_id_returns` (`client_id`),
KEY `warehouse_id_sale_return_id` (`warehouse_id`),
CONSTRAINT `client_id_returns` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
CONSTRAINT `user_id_returns` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `warehouse_id_sale_return_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sale_returns`
--
LOCK TABLES `sale_returns` WRITE;
/*!40000 ALTER TABLE `sale_returns` DISABLE KEYS */;
/*!40000 ALTER TABLE `sale_returns` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sales`
--
DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` date NOT NULL,
`Ref` varchar(192) NOT NULL,
`is_pos` tinyint(1) DEFAULT 0,
`client_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL DEFAULT 0,
`paid_amount` double NOT NULL DEFAULT 0,
`payment_statut` varchar(192) NOT NULL,
`statut` varchar(191) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`shipping_status` varchar(191) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_sales` (`user_id`),
KEY `sale_client_id` (`client_id`),
KEY `warehouse_id_sale` (`warehouse_id`),
CONSTRAINT `sale_client_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
CONSTRAINT `user_id_sales` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `warehouse_id_sale` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sales`
--
LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `servers`
--
DROP TABLE IF EXISTS `servers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`host` varchar(191) NOT NULL,
`port` int(11) NOT NULL,
`username` varchar(191) NOT NULL,
`password` varchar(191) NOT NULL,
`encryption` varchar(191) NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `servers`
--
LOCK TABLES `servers` WRITE;
/*!40000 ALTER TABLE `servers` DISABLE KEYS */;
INSERT INTO `servers` VALUES (1,'mailtrap.io',2525,'test','test','tls',NULL,NULL,NULL);
/*!40000 ALTER TABLE `servers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `settings`
--
DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(191) NOT NULL,
`currency_id` int(11) DEFAULT NULL,
`CompanyName` varchar(191) NOT NULL,
`CompanyPhone` varchar(191) NOT NULL,
`CompanyAdress` varchar(191) NOT NULL,
`logo` varchar(191) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`footer` varchar(192) NOT NULL DEFAULT 'Stocky - Ultimate Inventory With POS',
`developed_by` varchar(192) NOT NULL DEFAULT 'Stocky',
`client_id` int(11) DEFAULT NULL,
`warehouse_id` int(11) DEFAULT NULL,
`default_language` varchar(192) NOT NULL DEFAULT 'en',
PRIMARY KEY (`id`),
KEY `currency_id` (`currency_id`),
KEY `client_id` (`client_id`),
KEY `warehouse_id` (`warehouse_id`),
CONSTRAINT `currency_id` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `settings_client_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
CONSTRAINT `settings_warehouse_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `settings`
--
LOCK TABLES `settings` WRITE;
/*!40000 ALTER TABLE `settings` DISABLE KEYS */;
INSERT INTO `settings` VALUES (1,'admin@example.com',1,'Stocky','6315996770','3618 Abia Martin Drive','logo-default.png',NULL,NULL,NULL,'Stocky - Ultimate Inventory With POS','Stocky',1,NULL,'en');
/*!40000 ALTER TABLE `settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `shipments`
--
DROP TABLE IF EXISTS `shipments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shipments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date` timestamp NOT NULL DEFAULT current_timestamp(),
`Ref` varchar(192) NOT NULL,
`sale_id` int(11) NOT NULL,
`delivered_to` varchar(192) DEFAULT NULL,
`shipping_address` text DEFAULT NULL,
`status` varchar(192) NOT NULL,
`shipping_details` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `shipment_user_id` (`user_id`),
KEY `shipment_sale_id` (`sale_id`),
CONSTRAINT `shipment_sale_id` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`),
CONSTRAINT `shipment_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `shipments`
--
LOCK TABLES `shipments` WRITE;
/*!40000 ALTER TABLE `shipments` DISABLE KEYS */;
/*!40000 ALTER TABLE `shipments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `transfer_details`
--
DROP TABLE IF EXISTS `transfer_details`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transfer_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`transfer_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_variant_id` int(11) DEFAULT NULL,
`cost` double NOT NULL,
`purchase_unit_id` int(11) DEFAULT NULL,
`TaxNet` double DEFAULT NULL,
`tax_method` varchar(192) DEFAULT '1',
`discount` double DEFAULT NULL,
`discount_method` varchar(192) DEFAULT '1',
`quantity` double NOT NULL,
`total` double NOT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `transfer_id` (`transfer_id`),
KEY `product_id_transfers` (`product_id`),
KEY `product_variant_id_transfer` (`product_variant_id`),
KEY `unit_sale_id_transfer` (`purchase_unit_id`),
CONSTRAINT `product_id_transfers` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `product_variant_id_transfer` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`),
CONSTRAINT `transfer_id` FOREIGN KEY (`transfer_id`) REFERENCES `transfers` (`id`),
CONSTRAINT `unit_sale_id_transfer` FOREIGN KEY (`purchase_unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `transfer_details`
--
LOCK TABLES `transfer_details` WRITE;
/*!40000 ALTER TABLE `transfer_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `transfer_details` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `transfers`
--
DROP TABLE IF EXISTS `transfers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `transfers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`Ref` varchar(192) NOT NULL,
`date` date NOT NULL,
`from_warehouse_id` int(11) NOT NULL,
`to_warehouse_id` int(11) NOT NULL,
`items` double NOT NULL,
`tax_rate` double DEFAULT 0,
`TaxNet` double DEFAULT 0,
`discount` double DEFAULT 0,
`shipping` double DEFAULT 0,
`GrandTotal` double NOT NULL DEFAULT 0,
`statut` varchar(192) NOT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id_transfers` (`user_id`),
KEY `from_warehouse_id` (`from_warehouse_id`),
KEY `to_warehouse_id` (`to_warehouse_id`),
CONSTRAINT `from_warehouse_id` FOREIGN KEY (`from_warehouse_id`) REFERENCES `warehouses` (`id`),
CONSTRAINT `to_warehouse_id` FOREIGN KEY (`to_warehouse_id`) REFERENCES `warehouses` (`id`),
CONSTRAINT `user_id_transfers` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `transfers`
--
LOCK TABLES `transfers` WRITE;
/*!40000 ALTER TABLE `transfers` DISABLE KEYS */;
/*!40000 ALTER TABLE `transfers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `units`
--
DROP TABLE IF EXISTS `units`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `units` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(192) NOT NULL,
`ShortName` varchar(192) NOT NULL,
`base_unit` int(11) DEFAULT NULL,
`operator` char(192) DEFAULT '*',
`operator_value` double DEFAULT 1,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `base_unit` (`base_unit`),
CONSTRAINT `base_unit` FOREIGN KEY (`base_unit`) REFERENCES `units` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `units`
--
LOCK TABLES `units` WRITE;
/*!40000 ALTER TABLE `units` DISABLE KEYS */;
/*!40000 ALTER TABLE `units` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_warehouse`
--
DROP TABLE IF EXISTS `user_warehouse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_warehouse` (
`user_id` int(11) NOT NULL,
`warehouse_id` int(11) NOT NULL,
KEY `user_warehouse_user_id` (`user_id`),
KEY `user_warehouse_warehouse_id` (`warehouse_id`),
CONSTRAINT `user_warehouse_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `user_warehouse_warehouse_id` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_warehouse`
--
LOCK TABLES `user_warehouse` WRITE;
/*!40000 ALTER TABLE `user_warehouse` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_warehouse` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(191) NOT NULL,
`lastname` varchar(191) NOT NULL,
`username` varchar(192) NOT NULL,
`email` varchar(192) NOT NULL,
`password` varchar(191) NOT NULL,
`avatar` varchar(191) DEFAULT NULL,
`phone` varchar(192) NOT NULL,
`role_id` int(11) NOT NULL,
`statut` tinyint(1) NOT NULL DEFAULT 1,
`is_all_warehouses` tinyint(1) NOT NULL DEFAULT 0,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'William','Castillo','William Castillo','admin@example.com','$2y$10$IFj6SwqC0Sxrsiv4YkCt.OJv1UV4mZrWuyLoRG7qt47mseP9mJ58u','no_avatar.png','0123456789',1,1,1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `warehouses`
--
DROP TABLE IF EXISTS `warehouses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `warehouses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(192) NOT NULL,
`city` varchar(192) DEFAULT NULL,
`mobile` varchar(192) DEFAULT NULL,
`zip` varchar(192) DEFAULT NULL,
`email` varchar(192) DEFAULT NULL,
`country` varchar(192) DEFAULT NULL,
`created_at` timestamp(6) NULL DEFAULT NULL,
`updated_at` timestamp(6) NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `warehouses`
--
LOCK TABLES `warehouses` WRITE;
/*!40000 ALTER TABLE `warehouses` DISABLE KEYS */;
INSERT INTO `warehouses` VALUES (1,'Default Warehouse',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `warehouses` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-05-19 15:59:17