listado de productos
This commit is contained in:
parent
0b8cd08fa9
commit
43136a66e7
296
BD/taller_bd.sql
Normal file
296
BD/taller_bd.sql
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.1
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Servidor: 127.0.0.1:3306
|
||||
-- Tiempo de generación: 06-09-2026 a las 22:14:46
|
||||
-- Versión del servidor: 9.1.0
|
||||
-- Versión de PHP: 8.2.26
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Base de datos: `taller_bd`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `categorias`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `categorias`;
|
||||
CREATE TABLE IF NOT EXISTS `categorias` (
|
||||
`id_categoria` int NOT NULL AUTO_INCREMENT,
|
||||
`nombre` varchar(255) DEFAULT NULL,
|
||||
`descripcion` varchar(255) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id_categoria`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
--
|
||||
-- Volcado de datos para la tabla `categorias`
|
||||
--
|
||||
|
||||
INSERT INTO `categorias` (`id_categoria`, `nombre`, `descripcion`, `created_at`, `updated_at`, `deleted_at`) VALUES
|
||||
(3, 'Vehiculos Y Mas', 'categoria numero 3', NULL, '2026-08-31 22:30:43', NULL),
|
||||
(4, 'Tecnología E Informatica', 'Productos y servicios Tecnologicos', NULL, '2026-08-30 23:30:07', NULL),
|
||||
(5, 'Educación Y Trabajo', 'Cursos, capacitaciones y formación', NULL, '2026-08-31 14:58:27', NULL),
|
||||
(6, 'Salud', 'Servicios médicos y bienestar', NULL, '2026-08-31 15:10:17', NULL),
|
||||
(7, 'Deportes', 'Actividades deportivas y recreativas', NULL, NULL, NULL),
|
||||
(8, 'Alimentos', 'Productos alimenticios', NULL, NULL, NULL),
|
||||
(9, 'Transporte', 'Servicios de movilidad y logística', NULL, NULL, NULL),
|
||||
(10, 'Turismo', 'Viajes, hospedaje y excursiones', NULL, NULL, NULL),
|
||||
(11, 'Finanzas', 'Servicios financieros y bancarios', NULL, NULL, NULL),
|
||||
(12, 'Entretenimiento', 'Cine, música y ocio', NULL, NULL, NULL),
|
||||
(13, 'Hogar', 'Productos y servicios para el hogar', NULL, NULL, NULL),
|
||||
(15, 'CRISTIANO', 'Pedido mes de febrero', NULL, NULL, NULL),
|
||||
(16, 'asdasd', 'sdfsawdq', NULL, NULL, NULL),
|
||||
(17, 'vehiculos', 'descripc vehiculos', '2026-05-26 22:46:28', '2026-06-02 16:08:41', NULL),
|
||||
(18, '12sdkjasj', '121jgsj', '2026-06-02 16:12:47', '2026-06-02 16:12:47', NULL),
|
||||
(19, 'kndwbyucgds', 'jldwhoichwsda', '2026-06-08 22:48:37', '2026-06-08 22:48:37', NULL),
|
||||
(20, 'ksijdsjf', 'jnaduiah', '2026-06-09 22:35:03', '2026-06-09 22:35:03', NULL),
|
||||
(21, NULL, NULL, '2026-06-09 22:36:01', '2026-06-09 22:36:01', NULL),
|
||||
(22, 'njadhcafiud', 'iohoiwhsed', '2026-06-09 23:00:07', '2026-06-09 23:00:07', NULL);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `codigo_barras`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `codigo_barras`;
|
||||
CREATE TABLE IF NOT EXISTS `codigo_barras` (
|
||||
`id_codigo_barras` int NOT NULL AUTO_INCREMENT,
|
||||
`codigo` varchar(45) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id_codigo_barras`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
--
|
||||
-- Volcado de datos para la tabla `codigo_barras`
|
||||
--
|
||||
|
||||
INSERT INTO `codigo_barras` (`id_codigo_barras`, `codigo`, `created_at`, `deleted_at`, `updated_at`) VALUES
|
||||
(1, '12345', NULL, NULL, NULL),
|
||||
(2, '98765', NULL, NULL, NULL);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `etiquetas`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `etiquetas`;
|
||||
CREATE TABLE IF NOT EXISTS `etiquetas` (
|
||||
`id_etiqueta` int NOT NULL AUTO_INCREMENT,
|
||||
`nombre` varchar(250) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id_etiqueta`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `failed_jobs`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `failed_jobs`;
|
||||
CREATE TABLE IF NOT EXISTS `failed_jobs` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uuid` varchar(191) 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=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `migrations`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `migrations`;
|
||||
CREATE TABLE IF NOT EXISTS `migrations` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`batch` int NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=6 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, '2014_10_12_100000_create_password_resets_table', 1),
|
||||
(4, '2019_08_19_000000_create_failed_jobs_table', 1),
|
||||
(5, '2019_12_14_000001_create_personal_access_tokens_table', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `password_resets`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `password_resets`;
|
||||
CREATE TABLE IF NOT EXISTS `password_resets` (
|
||||
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
KEY `password_resets_email_index` (`email`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `password_reset_tokens`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `password_reset_tokens`;
|
||||
CREATE TABLE IF NOT EXISTS `password_reset_tokens` (
|
||||
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`email`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `personal_access_tokens`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `personal_access_tokens`;
|
||||
CREATE TABLE IF NOT EXISTS `personal_access_tokens` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`tokenable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`tokenable_id` bigint UNSIGNED NOT NULL,
|
||||
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`abilities` text COLLATE utf8mb4_unicode_ci,
|
||||
`last_used_at` timestamp NULL DEFAULT NULL,
|
||||
`expires_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
|
||||
KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `productos`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `productos`;
|
||||
CREATE TABLE IF NOT EXISTS `productos` (
|
||||
`id_producto` int NOT NULL AUTO_INCREMENT,
|
||||
`nombre` varchar(250) DEFAULT NULL,
|
||||
`descripcion` text,
|
||||
`precio` decimal(10,2) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`categoria_id` int NOT NULL,
|
||||
`codigo_barras_id` int NOT NULL,
|
||||
PRIMARY KEY (`id_producto`),
|
||||
KEY `fk_productos_categorias_idx` (`categoria_id`),
|
||||
KEY `fk_productos_codigo_barras1_idx` (`codigo_barras_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
--
|
||||
-- Volcado de datos para la tabla `productos`
|
||||
--
|
||||
|
||||
INSERT INTO `productos` (`id_producto`, `nombre`, `descripcion`, `precio`, `created_at`, `updated_at`, `deleted_at`, `categoria_id`, `codigo_barras_id`) VALUES
|
||||
(1, 'Iphone 17', NULL, 1500000.00, NULL, NULL, NULL, 4, 1),
|
||||
(2, 'samsung a51', NULL, 600000.00, NULL, NULL, NULL, 4, 2);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `productos_etiquetas`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `productos_etiquetas`;
|
||||
CREATE TABLE IF NOT EXISTS `productos_etiquetas` (
|
||||
`producto_id` int NOT NULL,
|
||||
`etiqueta_id` int NOT NULL,
|
||||
PRIMARY KEY (`producto_id`,`etiqueta_id`),
|
||||
KEY `fk_productos_has_etiquetas_etiquetas1_idx` (`etiqueta_id`),
|
||||
KEY `fk_productos_has_etiquetas_productos1_idx` (`producto_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`email_verified_at` timestamp NULL DEFAULT NULL,
|
||||
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `users_email_unique` (`email`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Volcado de datos para la tabla `users`
|
||||
--
|
||||
|
||||
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
|
||||
(1, 'cristian', 'cristian@cristian.com', NULL, '$2y$12$dEXwqJGEupdCtcODIE2l1ugLHKN84/lpUg63ldd/weX9MgBfFmTc2', NULL, '2026-08-18 23:28:07', '2026-08-18 23:28:07'),
|
||||
(2, 'cri', 'cristian@gmail.com', NULL, '$2y$12$iHir/XKxQztCrmSIlhh8M./Bx96XCGg6TZYInVXW5I7VYUzL5i./.', NULL, '2026-08-24 14:13:07', '2026-08-24 14:13:07'),
|
||||
(3, 'cristian', 'cristian@cris.com', NULL, '$2y$12$wMALozxvqw2ueyRmaCFtzevx05XSaRIo9Vdv7YMSzLhfLFLA1lJT6', NULL, '2026-08-29 21:57:06', '2026-08-29 21:57:06');
|
||||
|
||||
--
|
||||
-- Restricciones para tablas volcadas
|
||||
--
|
||||
|
||||
--
|
||||
-- Filtros para la tabla `productos`
|
||||
--
|
||||
ALTER TABLE `productos`
|
||||
ADD CONSTRAINT `fk_productos_categorias` FOREIGN KEY (`categoria_id`) REFERENCES `categorias` (`id_categoria`),
|
||||
ADD CONSTRAINT `fk_productos_codigo_barras1` FOREIGN KEY (`codigo_barras_id`) REFERENCES `codigo_barras` (`id_codigo_barras`);
|
||||
|
||||
--
|
||||
-- Filtros para la tabla `productos_etiquetas`
|
||||
--
|
||||
ALTER TABLE `productos_etiquetas`
|
||||
ADD CONSTRAINT `fk_productos_has_etiquetas_etiquetas1` FOREIGN KEY (`etiqueta_id`) REFERENCES `etiquetas` (`id_etiqueta`),
|
||||
ADD CONSTRAINT `fk_productos_has_etiquetas_productos1` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id_producto`);
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
Loading…
Reference in New Issue
Block a user