-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 21-05-2024 a las 20:15:39
-- Versión del servidor: 8.2.0
-- Versión de PHP: 8.1.26

START TRANSACTION;



--
-- Base de datos: `laravel`
--

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

--
-- Estructura de tabla para la tabla `categorias`
--

CREATE TABLE IF NOT EXISTS `categorias` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `categorias`
--

INSERT INTO `categorias` (`id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, 'categoria1', '2024-03-19 13:19:11', '2024-03-19 13:19:11'),
(2, 'categoria2', '2024-03-19 13:35:25', '2024-03-19 13:35:25'),
(3, 'cajas', '2024-03-20 23:08:05', '2024-03-20 23:08:05'),
(4, 'cajas1', '2024-03-20 23:17:11', '2024-03-20 23:17:11'),
(5, 'Aurora', '2024-03-20 23:33:55', '2024-03-21 06:01:32'),
(6, 'patos1', '2024-03-20 23:35:51', '2024-03-20 23:35:51'),
(7, 'ropa niño', '2024-03-20 23:37:50', '2024-03-20 23:37:50'),
(8, 'niños', '2024-03-20 23:39:22', '2024-03-20 23:39:22'),
(9, 'niñas', '2024-03-20 23:39:31', '2024-03-20 23:39:31'),
(13, 'consequatur ducimus et', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(14, 'sit voluptatibus iure', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(15, 'sed provident libero', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(16, 'ex velit dolor', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(17, 'quos consequuntur quisquam', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(18, 'minus distinctio dolor', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(19, 'sequi non sint', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(20, 'earum dolor soluta', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(21, 'ut rerum deserunt', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(22, 'quis non possimus', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(23, 'ut neque molestiae', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(24, 'odio eius aut', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(25, 'ut minima qui', '2024-03-31 05:34:42', '2024-03-31 05:34:42'),
(27, 'ranurado 1', '2024-03-31 05:34:42', '2024-04-29 22:40:48');

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

--
-- Estructura de tabla para la tabla `clientes`
--

CREATE TABLE IF NOT EXISTS `clientes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `clave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `empresa` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contacto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `clientes`
--

INSERT INTO `clientes` (`id`, `nombre`, `clave`, `telefono`, `mail`, `empresa`, `contacto`, `created_at`, `updated_at`) VALUES
(1, 'Minim voluptatem do ', '78abc', '558855875', 'myqetyr@mailinator.com', 'Et minima nihil sit ', NULL, '2024-04-17 05:10:42', '2024-04-17 05:46:46'),
(3, 'General', '-----', NULL, NULL, NULL, NULL, '2024-04-17 06:20:47', '2024-04-17 06:20:47');

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

--
-- Estructura de tabla para la tabla `cotizaciones`
--

CREATE TABLE IF NOT EXISTS `cotizaciones` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `clave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` decimal(8,2) DEFAULT NULL,
  `iva` decimal(8,2) DEFAULT NULL,
  `total` decimal(8,2) DEFAULT NULL,
  `herramientas` decimal(8,2) DEFAULT NULL,
  `suaje` decimal(8,2) DEFAULT NULL,
  `placa` decimal(8,2) DEFAULT NULL,
  `desperdicio` int DEFAULT NULL,
  `utilidad` int DEFAULT NULL,
  `transporte` decimal(8,2) DEFAULT NULL,
  `categorias_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cotizaciones_categorias_id_foreign` (`categorias_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Estructura de tabla para la tabla `empresas`
--

CREATE TABLE IF NOT EXISTS `empresas` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `slogan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ciudad` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `empresas`
--

INSERT INTO `empresas` (`id`, `nombre`, `slogan`, `telefono`, `mail`, `direccion`, `ciudad`, `created_at`, `updated_at`) VALUES
(1, 'Boxcology Empresa', 'Boxcology', '55 55 66 77 89', 'ventas@boxcology.com', NULL, 'Mexico', NULL, '2024-04-17 21:42:41');

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

--
-- Estructura de tabla para la tabla `failed_jobs`
--

CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Estructura de tabla para la tabla `generales`
--

CREATE TABLE IF NOT EXISTS `generales` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `utilidad` decimal(8,2) DEFAULT NULL,
  `tipocambio` decimal(8,2) DEFAULT NULL,
  `manobra` decimal(8,2) DEFAULT NULL,
  `placa` decimal(8,2) DEFAULT NULL,
  `suaje` decimal(8,2) DEFAULT NULL,
  `insumos` decimal(8,2) 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;

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

--
-- Estructura de tabla para la tabla `images`
--

CREATE TABLE IF NOT EXISTS `images` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imageable_id` int UNSIGNED DEFAULT NULL,
  `imageable_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `images`
--

INSERT INTO `images` (`id`, `url`, `imageable_id`, `imageable_type`, `created_at`, `updated_at`) VALUES
(4, 'products/660879cd755e0.jpg', 8, 'App\\Models\\productos', '2024-03-31 02:45:01', '2024-03-31 02:45:01'),
(9, 'products/66087d3128437.jpg', 4, 'App\\Models\\productos', '2024-03-31 02:59:29', '2024-03-31 02:59:29'),
(10, 'products/66087dd240b90.jpg', 1, 'App\\Models\\productos', '2024-03-31 03:02:10', '2024-03-31 03:02:10'),
(11, 'products/66087f05af79a.jpg', 9, 'App\\Models\\productos', '2024-03-31 03:07:17', '2024-03-31 03:07:17'),
(12, 'users/661ec8f9cdb9f.jpg', 3, 'App\\Models\\User', '2024-04-17 00:52:41', '2024-04-17 00:52:41'),
(13, 'users/661ec91d4b694.jpg', 2, 'App\\Models\\User', '2024-04-17 00:53:17', '2024-04-17 00:53:17'),
(14, 'users/661eeb9f0a426.jpg', 5, 'App\\Models\\User', '2024-04-17 03:20:31', '2024-04-17 03:20:31'),
(15, 'products/66207c54ce59e.jpg', 12, 'App\\Models\\productos', '2024-04-18 07:50:12', '2024-04-18 07:50:12');

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

--
-- Estructura de tabla para la tabla `items`
--

CREATE TABLE IF NOT EXISTS `items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `qty` int UNSIGNED NOT NULL,
  `fecha` date NOT NULL,
  `product_id` bigint NOT 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;

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

--
-- Estructura de tabla para la tabla `item_sale`
--

CREATE TABLE IF NOT EXISTS `item_sale` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `sale_id` bigint UNSIGNED NOT NULL,
  `item_id` bigint UNSIGNED NOT NULL,
  `qty` int UNSIGNED NOT NULL,
  `fecha` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `item_sale_sale_id_foreign` (`sale_id`),
  KEY `item_sale_item_id_foreign` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Estructura de tabla para la tabla `materiales`
--

CREATE TABLE IF NOT EXISTS `materiales` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `clave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preciom2` decimal(8,4) NOT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resitencia` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `flauta` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
  `observaciones` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anchomincm` int DEFAULT NULL,
  `largomincm` int DEFAULT NULL,
  `anchomaxcm` int DEFAULT NULL,
  `largomaxcm` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `materiales`
--

INSERT INTO `materiales` (`id`, `clave`, `tipo`, `nombre`, `preciom2`, `color`, `resitencia`, `flauta`, `observaciones`, `anchomincm`, `largomincm`, `anchomaxcm`, `largomaxcm`, `created_at`, `updated_at`) VALUES
(1, 'BECT23FCNAL', 'corrugado sencillo', 'BECT23FCNAL', 9.5040, 'Kraft', 'ECT 26', 'C', NULL, 30, 50, 2170, 3000, NULL, NULL),
(2, 'BECT26FCNAL', 'corrugado sencillo', 'BECT26FCNAL', 9.9300, 'Blanco', 'ECT 26', 'C', NULL, 30, 50, 2170, 3000, NULL, NULL),
(3, 'BECT29FCNAL', 'corrugado sencillo', 'BECT29FCNAL', 10.9590, 'Blanco', 'ECT 29', 'C', NULL, 30, 50, 2170, 3000, NULL, NULL),
(4, 'BECT32FCNAL', 'corrugado sencillo', 'BECT32FCNAL', 11.8700, 'Blanco', 'ECT 32', 'C', NULL, 30, 50, 2170, 3000, NULL, NULL),
(5, 'BECT36FBCNAL', 'corrugado sencillo', 'BECT36FBCNAL', 12.2360, 'Blanco', 'ECT 32', 'BC', NULL, 30, 50, 2170, 3000, NULL, NULL),
(6, 'BECT36FCNAL', 'corrugado sencillo', 'BECT36FCNAL', 12.8700, 'Blanco', 'ECT 32', 'C', NULL, 30, 50, 2170, 3000, NULL, NULL),
(7, 'BECT61FBCNAL', 'corrugado sencillo', 'BECT61FBCNAL', 9.5040, 'Blanco', 'ECT 61', 'BC', NULL, 30, 50, 2170, 3000, NULL, NULL),
(8, 'BECT71FBCNAL', 'corrugado sencillo', 'BECT71FBCNAL', 9.5040, 'Blanco', 'ECT 71', 'BC', NULL, 30, 50, 2170, 3000, NULL, NULL);

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

--
-- Estructura de tabla para la tabla `migrations`
--

CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2024_03_12_164246_create_categorias_table', 1),
(6, '2024_03_12_165424_create_productos_table', 1),
(7, '2024_03_12_175647_create_clientes_table', 1),
(8, '2024_03_12_180729_create_cotizaciones_table', 1),
(9, '2024_03_12_180747_create_proveedores_table', 1),
(10, '2024_03_12_180800_create_materiales_table', 1),
(11, '2024_03_13_230852_create_generales_table', 1),
(12, '2024_03_13_230909_create_empresas_table', 1),
(13, '2024_03_13_231034_create_images_table', 1),
(14, '2024_03_13_231058_create_item_ventas_table', 1),
(15, '2024_03_13_231113_create_items_table', 1),
(16, '2014_10_12_100000_create_password_resets_table', 2),
(17, '2024_03_18_214515_create_empresas_table', 3),
(18, '2024_03_18_214757_create_productos_table', 4),
(19, '2024_03_18_215319_create_images_table', 5),
(20, '2024_03_18_215519_create_items_table', 6),
(21, '2024_03_18_215728_create_item_ventas_table', 7),
(22, '2024_03_18_220020_create_materiales_table', 8),
(23, '2024_04_17_193148_create_sales_table', 9),
(24, '2024_04_17_193858_create_items_table', 10),
(25, '2024_04_17_220044_create_item_sale_table', 10);

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

--
-- Estructura de tabla para la tabla `productos`
--

CREATE TABLE IF NOT EXISTS `productos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cantidad` int UNSIGNED DEFAULT NULL,
  `costo` decimal(10,2) DEFAULT NULL,
  `precio` decimal(10,2) DEFAULT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `clave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resistencia` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ancho` int DEFAULT NULL,
  `largo` int DEFAULT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `categorias_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `flauta` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `productos_categorias_id_foreign` (`categorias_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `productos`
--

INSERT INTO `productos` (`id`, `nombre`, `descripcion`, `cantidad`, `costo`, `precio`, `fecha_vencimiento`, `clave`, `color`, `resistencia`, `ancho`, `largo`, `activo`, `categorias_id`, `created_at`, `updated_at`, `flauta`) VALUES
(1, 'caja basica', 'caja bas', 1, 10.00, 10.00, '2024-03-30', NULL, NULL, 'ect', 50, 50, 1, 3, '2024-03-29 03:19:55', '2024-03-29 03:19:55', 'c'),
(2, 'victor', NULL, 1, 10.00, 10.00, NULL, NULL, NULL, NULL, 50, 50, 1, 1, '2024-03-29 04:01:37', '2024-03-29 04:01:37', NULL),
(3, 'mi produ', 'sss', 1, 10.00, 15.00, NULL, NULL, NULL, NULL, 40, 40, 1, 3, '2024-03-29 07:22:29', '2024-03-29 07:22:29', NULL),
(4, 'caja3', 'cajas', 1, 10.00, 10.00, NULL, NULL, NULL, NULL, 50, 50, 1, 3, '2024-03-29 07:23:44', '2024-03-29 07:23:44', NULL),
(5, 'caja4', 'caj4', 1, 10.00, 10.00, NULL, NULL, NULL, NULL, 50, 50, 1, 3, '2024-03-29 07:34:39', '2024-03-29 07:34:39', NULL),
(6, 'caja 5', 'caj 5', 1, 10.00, 10.00, NULL, NULL, NULL, NULL, 50, 50, 1, 3, '2024-03-29 07:36:14', '2024-03-29 07:36:14', NULL),
(8, 'caja8', '2222', 1, 10.00, 10.00, '2024-03-30', NULL, 'blanco', 'ECT 26', 80, 80, 1, 1, '2024-03-29 07:43:36', '2024-03-31 02:32:51', 'C'),
(9, 'caja 7', 'cajas ', 100, 10.33, 661.12, '2024-03-28', NULL, NULL, 'ect ', 80, 80, 1, 1, '2024-03-29 08:51:23', '2024-04-20 00:47:58', 'b'),
(10, 'non praesentium voluptatem', 'Nobis aliquam aliquid minus blanditiis molestiae ullam repellat.', 774, 10.33, 170027.68, '1983-01-07', 'aut', 'vero', 'ut', 68, 65, 1, 15, '2024-03-31 06:14:20', '2024-04-18 12:05:23', 'w'),
(11, 'cumque earum et', 'Eum facere quia velit cupiditate esse odio.', 100, 10.00, 640.00, '1981-06-21', 'perferendis', 'consectetur', 'est', 80, 80, 1, 2, '2024-03-31 06:14:20', '2024-04-20 00:47:40', 't'),
(12, 'empaque1', 'Caja de empaque 30x30x30', 100, 9.93, 640.00, '1971-09-13', 'esse', 'atque', 'optio', 80, 80, 1, 4, '2024-03-31 06:14:20', '2024-04-18 11:50:18', 'w');

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

--
-- Estructura de tabla para la tabla `proveedores`
--

CREATE TABLE IF NOT EXISTS `proveedores` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `empresa` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contacto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anchomincm` int DEFAULT NULL,
  `largomincm` int DEFAULT NULL,
  `anchomaxcm` int DEFAULT NULL,
  `largomaxcm` int 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;

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

--
-- Estructura de tabla para la tabla `sales`
--

CREATE TABLE IF NOT EXISTS `sales` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `total` decimal(10,2) NOT NULL,
  `pago` decimal(10,2) DEFAULT NULL,
  `fecha` date NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `clientes_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_user_id_foreign` (`user_id`),
  KEY `sales_clientes_id_foreign` (`clientes_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `cotizaciones`
--
ALTER TABLE `cotizaciones`
  ADD CONSTRAINT `cotizaciones_categorias_id_foreign` FOREIGN KEY (`categorias_id`) REFERENCES `categorias` (`id`);

--
-- Filtros para la tabla `item_sale`
--
ALTER TABLE `item_sale`
  ADD CONSTRAINT `item_sale_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `item_sale_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE;

--
-- Filtros para la tabla `productos`
--
ALTER TABLE `productos`
  ADD CONSTRAINT `productos_categorias_id_foreign` FOREIGN KEY (`categorias_id`) REFERENCES `categorias` (`id`);

--
-- Filtros para la tabla `sales`
--
ALTER TABLE `sales`
  ADD CONSTRAINT `sales_clientes_id_foreign` FOREIGN KEY (`clientes_id`) REFERENCES `clientes` (`id`),
  ADD CONSTRAINT `sales_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
COMMIT;

