-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQL.txt
153 lines (129 loc) · 5.97 KB
/
SQL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 07-02-2022 a las 23:00:38
-- Versión del servidor: 5.6.35
-- Versión de PHP: 7.0.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Base de datos: `api_rest_laravel`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categories`
--
CREATE TABLE `categories` (
`id` int(255) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `categories`
--
INSERT INTO `categories` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Laptops', NULL, NULL),
(2, 'Smartphones', NULL, '2022-02-02 15:31:58'),
(3, 'Videojuegos', '2022-02-02 15:20:43', '2022-02-02 15:31:29'),
(4, 'Software', '2022-02-02 15:21:02', '2022-02-02 15:21:02');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `posts`
--
CREATE TABLE `posts` (
`id` int(255) NOT NULL,
`user_id` int(255) NOT NULL,
`category_id` int(255) NOT NULL,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`image` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `posts`
--
INSERT INTO `posts` (`id`, `user_id`, `category_id`, `title`, `content`, `image`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'Apple Macbook pro 16\" M1 10-core', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin faucibus nisl eu gravida bibendum. Ut cursus purus vel urna venenatis rutrum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut consectetur vitae risus eleifend vehicula. Vestibulum quis lacus non justo varius blandit. Suspendisse leo felis, efficitur nec metus eu, placerat efficitur nisi. Sed convallis dolor pharetra lectus bibendum, a sagittis dui venenatis. Vivamus a ligula nibh. Suspendisse sed urna ullamcorper, iaculis risus eget, feugiat dui. Integer sit amet nisl non erat viverra fringilla. In lorem nisi, eleifend ac urna sit amet, rutrum feugiat sem. Sed bibendum turpis vitae sodales interdum. Donec luctus lorem sit amet ligula malesuada ullamcorper. Ut lectus justo, tempus quis tincidunt eget, ullamcorper at dui. Ut ipsum leo, fermentum ac efficitur ut, mollis eget enim.', NULL, NULL, NULL),
(2, 2, 2, 'Apple Iphone 13 pro Max 128Gb', 'Nam vel mauris vitae nibh congue maximus. Duis pretium, augue ac vulputate viverra, turpis leo varius mauris, sed efficitur sem enim quis urna. Praesent lobortis nisl turpis, a ornare ex ornare nec. Vivamus sed pretium mi, ac rhoncus velit. Morbi pellentesque nulla eget auctor porta. In et suscipit nunc, eu auctor magna. Proin at urna in ipsum efficitur vulputate at quis sapien. Sed ac orci auctor, porttitor turpis quis, dictum nibh. Curabitur sed arcu vitae eros facilisis consequat sit amet non metus.', NULL, NULL, NULL),
(4, 5, 4, 'AAAAAAA', 'BBBBBBBB', 'test.png', '2022-02-03 16:19:17', '2022-02-03 16:19:17'),
(5, 5, 4, 'AAAAAAA', 'BBBBBBBB', 'test.png', '2022-02-03 16:22:32', '2022-02-03 16:22:32'),
(6, 5, 4, 'AAAAAAA', 'BBBBBBBB', 'test.png', '2022-02-03 16:19:21', '2022-02-03 16:19:21'),
(7, 5, 4, 'AAAAAAA', 'BBBBBBBB', 'test.png', '2022-02-03 16:22:28', '2022-02-03 16:22:28'),
(8, 5, 4, 'AAAAAAA', 'BBBBBBBB', 'test.png', '2022-02-03 16:22:30', '2022-02-03 16:22:30');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(255) NOT NULL,
`name` varchar(50) NOT NULL,
`surname` varchar(100) DEFAULT NULL,
`role` varchar(20) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`description` text,
`image` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`remember_token` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `name`, `surname`, `role`, `email`, `password`, `description`, `image`, `created_at`, `updated_at`, `remember_token`) VALUES
(1, 'Alf', 'Diaz', NULL, '', '', NULL, NULL, NULL, NULL, NULL),
(2, 'James', 'Hetfield', NULL, '', '', NULL, NULL, NULL, NULL, NULL),
(3, 'Alf', 'DdC', 'ROLE_USER', '[email protected]', '$2y$04$PpvC81HXP5l6SXNTw8mGjenUoiHJb20IGfB96fFA.CQ7grz8GcG9.', NULL, NULL, '2022-01-28 23:02:20', '2022-01-28 23:02:20', NULL),
(4, 'Jose', 'bDdC', 'ROLE_USER', '[email protected]', '1ec4ed037766aa181d8840ad04b9fc6e195fd37dedc04c98a5767a67d3758ece', NULL, NULL, '2022-01-29 15:32:51', '2022-01-29 15:32:51', NULL),
(5, 'Pepe', 'Ruiz', 'ROLE_USER', '[email protected]', '7c9e7c1494b2684ab7c19d6aff737e460fa9e98d5a234da1310c97ddf5691834', NULL, NULL, '2022-01-30 10:30:27', '2022-01-30 12:40:30', NULL);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_post_user` (`user_id`),
ADD KEY `fk_post_category` (`category_id`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `categories`
--
ALTER TABLE `categories`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `posts`
--
ALTER TABLE `posts`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `fk_post_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
ADD CONSTRAINT `fk_post_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);