--
-- Host: localhost    Database: fabrica
-- ------------------------------------------------------


--
-- Table structure for table `analisis_agua`
--

CREATE TABLE `analisis_agua` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `phagua` varchar(50) DEFAULT NULL,
  `conductividad` varchar(50) DEFAULT NULL,
  `clibre` varchar(50) DEFAULT NULL,
  `phproducto` varchar(50) DEFAULT NULL,
  `viscosidad` varchar(50) DEFAULT NULL,
  `densidad` varchar(50) DEFAULT NULL,
  `apariencia` varchar(50) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `olor` varchar(50) DEFAULT NULL,
  `status` int(11) NOT NULL,
  `turno` int(11) NOT NULL,
  `observaciones` varchar(300) DEFAULT NULL,
  `especificacion` varchar(500) NOT NULL,
  `user_crea` varchar(50) DEFAULT NULL,
  `rol_crea` varchar(50) DEFAULT NULL,
  `crea_date` timestamp NULL DEFAULT NULL,
  `user_verifica` varchar(50) DEFAULT NULL,
  `rol_verifica` varchar(50) DEFAULT NULL,
  `verifica_date` timestamp NULL DEFAULT NULL,
  `user_autoriza` varchar(50) DEFAULT NULL,
  `rol_autoriza` varchar(50) DEFAULT NULL,
  `autoriza_date` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `analisis_agua`
--


--
-- Table structure for table `controles`
--

CREATE TABLE `controles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `oproduccion` varchar(10) DEFAULT NULL,
  `presentacion` varchar(200) DEFAULT NULL,
  `vmaximo` varchar(10) DEFAULT NULL,
  `voptimo` varchar(10) DEFAULT NULL,
  `vminimo` varchar(10) DEFAULT NULL,
  `pmaximo` varchar(10) DEFAULT NULL,
  `poptimo` varchar(10) DEFAULT NULL,
  `pminimo` varchar(10) DEFAULT NULL,
  `fecharealizada` timestamp NULL DEFAULT current_timestamp(),
  `fecharealizada2` timestamp NULL DEFAULT current_timestamp(),
  `llenado` varchar(200) DEFAULT NULL,
  `supervisado` varchar(200) DEFAULT NULL,
  `autorizado` varchar(200) DEFAULT NULL,
  `observaciones` varchar(500) DEFAULT NULL,
  `seccion` int(11) NOT NULL,
  `turno` int(11) NOT NULL,
  `horas` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`horas`)),
  `realizo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`realizo`)),
  `verifico` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`verifico`)),
  `realizo2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`realizo2`)),
  `verifico2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`verifico2`)),
  `m1` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m1`)),
  `m2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m2`)),
  `m3` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m3`)),
  `m4` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m4`)),
  `m5` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m5`)),
  `m6` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m6`)),
  `m7` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`m7`)),
  `t1` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t1`)),
  `t2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t2`)),
  `t3` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t3`)),
  `t4` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t4`)),
  `t5` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t5`)),
  `t6` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t6`)),
  `t7` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t7`)),
  `e1` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`e1`)),
  `e2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`e2`)),
  `packing_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `controles_packing_id_foreign` (`packing_id`),
  CONSTRAINT `controles_packing_id_foreign` FOREIGN KEY (`packing_id`) REFERENCES `packings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `controles`
--


--
-- Table structure for table `empaque_materials`
--

CREATE TABLE `empaque_materials` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` int(11) NOT NULL,
  `description` varchar(700) NOT NULL,
  `process` varchar(700) NOT NULL,
  `required_amount` int(11) NOT NULL,
  `unit` varchar(100) NOT NULL,
  `stock` int(11) NOT NULL,
  `lot1` int(11) NOT NULL,
  `entrega1` int(11) NOT NULL,
  `entrega2` int(11) DEFAULT NULL,
  `return` int(11) DEFAULT NULL,
  `packing_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `empaque_materials_packing_id_foreign` (`packing_id`),
  CONSTRAINT `empaque_materials_packing_id_foreign` FOREIGN KEY (`packing_id`) REFERENCES `packings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `empaque_materials`
--


--
-- Table structure for table `estandares`
--

CREATE TABLE `estandares` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `opresponsable` varchar(300) DEFAULT NULL,
  `supervisado` varchar(200) DEFAULT NULL,
  `autorizado` varchar(200) DEFAULT NULL,
  `observaciones` varchar(500) DEFAULT NULL,
  `fecharealizada` timestamp NULL DEFAULT current_timestamp(),
  `seccion` int(11) NOT NULL,
  `turno` int(11) NOT NULL,
  `presentacion` varchar(200) DEFAULT NULL,
  `horas` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`horas`)),
  `realizo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`realizo`)),
  `verifico` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`verifico`)),
  `a1` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a1`)),
  `a2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a2`)),
  `a3` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a3`)),
  `a4` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a4`)),
  `a5` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a5`)),
  `a6` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a6`)),
  `a7` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a7`)),
  `a8` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a8`)),
  `a9` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a9`)),
  `a10` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a10`)),
  `a11` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a11`)),
  `a12` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a12`)),
  `a13` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a13`)),
  `a14` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a14`)),
  `a15` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a15`)),
  `a16` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a16`)),
  `a17` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a17`)),
  `a18` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a18`)),
  `a19` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a19`)),
  `packing_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `estandares_packing_id_foreign` (`packing_id`),
  CONSTRAINT `estandares_packing_id_foreign` FOREIGN KEY (`packing_id`) REFERENCES `packings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `estandares`
--


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

CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `granel`
--

CREATE TABLE `granel` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `producto` varchar(700) NOT NULL,
  `lote` varchar(50) DEFAULT NULL,
  `batch` varchar(50) DEFAULT NULL,
  `orden` varchar(50) NOT NULL,
  `fecha_fabricacion` timestamp NULL DEFAULT NULL,
  `fecha_expiracion` timestamp NULL DEFAULT NULL,
  `cantidad` int(11) DEFAULT NULL,
  `proceso` varchar(200) DEFAULT NULL,
  `cv1` varchar(50) DEFAULT NULL,
  `cv2` varchar(50) DEFAULT NULL,
  `viscosidad` varchar(50) DEFAULT NULL,
  `ph` varchar(50) DEFAULT NULL,
  `temperatura` varchar(50) DEFAULT NULL,
  `alcohol` varchar(50) DEFAULT NULL,
  `densidad` varchar(50) DEFAULT NULL,
  `responsables` varchar(300) NOT NULL,
  `equipo` varchar(150) DEFAULT NULL,
  `mix_order_id` bigint(20) unsigned NOT NULL,
  `user_crea` varchar(50) DEFAULT NULL,
  `user_upd` varchar(50) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `granel_mix_order_id_foreign` (`mix_order_id`),
  CONSTRAINT `granel_mix_order_id_foreign` FOREIGN KEY (`mix_order_id`) REFERENCES `mix_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `granel`
--


--
-- Table structure for table `inspecciones`
--

CREATE TABLE `inspecciones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `estado` int(11) NOT NULL,
  `lote` varchar(15) NOT NULL,
  `fechahoraconxtanque1` timestamp NULL DEFAULT NULL,
  `fechahoraconxtanque2` timestamp NULL DEFAULT NULL,
  `supervisorconxtanque1` varchar(255) DEFAULT NULL,
  `supervisorconxtanque2` varchar(255) DEFAULT NULL,
  `ctrlcalidadconxtanque1` varchar(255) DEFAULT NULL,
  `ctrlcalidadconxtanque2` varchar(255) DEFAULT NULL,
  `opmaquinaconxtanque1` varchar(255) DEFAULT NULL,
  `opmaquinaconxtanque2` varchar(255) DEFAULT NULL,
  `rechazadosfecha1` date DEFAULT NULL,
  `rechazadosfecha2` date DEFAULT NULL,
  `rechazadosfecha3` date DEFAULT NULL,
  `rechazadosfecha4` date DEFAULT NULL,
  `rechazadoscantidadund1` int(11) DEFAULT NULL,
  `rechazadoscantidadund2` int(11) DEFAULT NULL,
  `rechazadoscantidadund3` int(11) DEFAULT NULL,
  `rechazadoscantidadund4` int(11) DEFAULT NULL,
  `totalunidadesrechazadas` int(11) DEFAULT NULL,
  `vaciosfecha1` date DEFAULT NULL,
  `vaciosfecha2` date DEFAULT NULL,
  `vaciosfecha3` date DEFAULT NULL,
  `vaciosfecha4` date DEFAULT NULL,
  `vacioscantidadkgs1` double(8,2) DEFAULT NULL,
  `vacioscantidadkgs2` double(8,2) DEFAULT NULL,
  `vacioscantidadkgs3` double(8,2) DEFAULT NULL,
  `vacioscantidadkgs4` double(8,2) DEFAULT NULL,
  `totalkilogramosvacios` double(8,2) DEFAULT NULL,
  `productoterminado1` varchar(255) DEFAULT NULL,
  `productoterminado2` varchar(255) DEFAULT NULL,
  `pt` int(11) DEFAULT NULL,
  `ptotal` int(11) DEFAULT NULL,
  `rendimientomezcla` double(8,2) DEFAULT NULL,
  `consumobobina` varchar(15) DEFAULT NULL,
  `packing_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inspecciones_packing_id_foreign` (`packing_id`),
  CONSTRAINT `inspecciones_packing_id_foreign` FOREIGN KEY (`packing_id`) REFERENCES `packings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `inspecciones`
--


--
-- Table structure for table `materials`
--

CREATE TABLE `materials` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` int(11) NOT NULL,
  `description` varchar(700) NOT NULL,
  `required_amount` int(11) NOT NULL,
  `unit` varchar(100) NOT NULL,
  `stock` int(11) NOT NULL,
  `entrega1` tinyint(1) NOT NULL,
  `lot1` int(11) NOT NULL,
  `entrega2` tinyint(1) NOT NULL,
  `lot2` int(11) DEFAULT NULL,
  `mix_order_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `materials_mix_order_id_foreign` (`mix_order_id`),
  CONSTRAINT `materials_mix_order_id_foreign` FOREIGN KEY (`mix_order_id`) REFERENCES `mix_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `materials`
--


--
-- Table structure for table `menus`
--

CREATE TABLE `menus` (
  `id` int(11) NOT NULL,
  `menu` varchar(100) NOT NULL,
  `role_id` int(11) NOT NULL,
  `path` varchar(200) NOT NULL,
  `icon` varchar(50) NOT NULL,
  `parent` int(11) DEFAULT NULL,
  UNIQUE KEY `menus_id_unique` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `menus`
--


--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2019_08_19_000000_create_failed_jobs_table',1),(4,'2021_11_25_070420_create_permission_tables',1),(5,'2021_11_25_070425_create_menus_table',1),(6,'2021_11_28_210628_create_mix_orders_table',1),(7,'2021_11_28_210823_create_materials_table',1),(8,'2021_11_28_210830_create_analisis_agua_table',1),(9,'2021_12_06_210830_create_granel_table',1),(10,'2021_12_19_205519_create_packings_table',1),(11,'2021_12_20_210830_create_controles_table',1),(12,'2021_12_20_210830_create_estandares_table',1),(13,'2021_12_27_230930_create_empaque_materials_table',1),(14,'2021_12_27_231042_create_inspecciones_table',1);

--
-- Table structure for table `mix_orders`
--

CREATE TABLE `mix_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `num_id` int(11) NOT NULL,
  `product_code` varchar(300) NOT NULL,
  `product_name` varchar(700) NOT NULL,
  `lot_num` int(11) DEFAULT NULL,
  `lot_size` int(11) NOT NULL,
  `datetime_init` timestamp NULL DEFAULT NULL,
  `datetime_end` timestamp NULL DEFAULT NULL,
  `cod_formula_master` varchar(300) DEFAULT NULL,
  `verified_by` varchar(150) DEFAULT NULL,
  `real_performance` int(11) DEFAULT NULL,
  `materials` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `water_check` tinyint(1) NOT NULL DEFAULT 0,
  `water_firma` varchar(255) DEFAULT NULL,
  `water_date` timestamp NULL DEFAULT NULL,
  `observaciones` varchar(500) DEFAULT NULL,
  `revisiones` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`revisiones`)),
  `user_entrega` varchar(150) DEFAULT NULL,
  `user_autoriza` varchar(150) DEFAULT NULL,
  `user_recibe` varchar(150) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mix_orders_num_id_index` (`num_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mix_orders`
--


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

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) unsigned NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--


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

CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) unsigned NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `model_has_roles` VALUES (1,'App\\User',1),(2,'App\\User',2),(3,'App\\User',3),(4,'App\\User',4),(5,'App\\User',5),(6,'App\\User',6),(7,'App\\User',7),(8,'App\\User',9),(9,'App\\User',8);

--
-- Table structure for table `packings`
--

CREATE TABLE `packings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_date` date NOT NULL,
  `num_id` int(11) NOT NULL,
  `product_code` varchar(300) NOT NULL,
  `product_name` varchar(700) NOT NULL,
  `lot_num` int(11) DEFAULT NULL,
  `lot_size` int(11) NOT NULL,
  `total_units` int(11) NOT NULL,
  `performance_teorico` int(11) DEFAULT NULL,
  `performance` int(11) DEFAULT NULL,
  `times` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`times`)),
  `operarios` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`operarios`)),
  `entregas` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`entregas`)),
  `materials` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `observations` varchar(500) DEFAULT NULL,
  `user_entrega` varchar(150) DEFAULT NULL,
  `user_autoriza` varchar(150) DEFAULT NULL,
  `user_recibe` varchar(150) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `packings_num_id_index` (`num_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packings`
--


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

CREATE TABLE `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'cap-cip','web','Capacidad especificamente para rol CIP','2023-09-27 07:42:07','2023-09-27 07:42:07'),(2,'cap-materiaprima','web','Capacidad destinada solo para rol materia prima','2023-09-27 07:42:07','2023-09-27 07:42:07'),(3,'cap-supcalidad','web','Capacidad destinada especificamente para rol supervisor de calidad','2023-09-27 07:42:07','2023-09-27 07:42:07'),(4,'cap-mezcla','web','Capacidad destinada especificamente para rol mezcla','2023-09-27 07:42:07','2023-09-27 07:42:07'),(5,'cap-produccion','web','Capacidad destinada especificamente para rol produccion','2023-09-27 07:42:07','2023-09-27 07:42:07'),(6,'cap-calidad','web','Capacidad destinada especificamente para rol analisis de calidad','2023-09-27 07:42:07','2023-09-27 07:42:07'),(7,'cap-bodega','web','Capacidad destinada especificamente para rol analisis de calidad','2023-09-27 07:42:07','2023-09-27 07:42:07'),(8,'cap-administrador','web','Capacidad destinada especificamente para rol analisis de calidad','2023-09-27 07:42:07','2023-09-27 07:42:07'),(9,'cap-supprod','web','Capacidad destinada especificamente para rol Supervisor de produccion','2023-09-27 07:42:07','2023-09-27 07:42:07'),(10,'cargar-ordermix','web','Apartado para cargar un orden desde API o local','2023-09-27 07:42:08','2023-09-27 07:42:08'),(11,'approved-ordermix','web','Capacidad de aprovar una orden de produccion, mezcla','2023-09-27 07:42:08','2023-09-27 07:42:08'),(12,'times-ordermix','web','Capacidad de marcar tiempos de inicio y fin para orden de produccion, mezcla','2023-09-27 07:42:08','2023-09-27 07:42:08'),(13,'registro-analisis-agua','web','Capacidad de registrar, modificar hoja de granel','2023-09-27 07:42:08','2023-09-27 07:42:08'),(14,'registro-granel','web','Capacidad de registrar, modificar hoja de granel','2023-09-27 07:42:08','2023-09-27 07:42:08');

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

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) unsigned NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `role_has_permissions` VALUES (1,1),(2,2),(3,6),(4,3),(5,4),(6,5),(7,7),(8,8),(9,9),(10,2),(11,6),(12,3),(13,3),(14,4);

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

CREATE TABLE `roles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'CleanInPlace','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(2,'MateriaPrima','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(3,'Mezcla','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(4,'Produccion','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(5,'Calidad','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(6,'SupCalidad','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(7,'Bodega','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(8,'Admin','web','2023-09-27 07:42:07','2023-09-27 07:42:07'),(9,'SupProduccion','web','2023-09-27 07:42:07','2023-09-27 07:42:07');

--
-- Dumping routines for database 'fabrica'
--


