-
Notifications
You must be signed in to change notification settings - Fork 0
/
bkp_essentia.sql
184 lines (161 loc) · 7.02 KB
/
bkp_essentia.sql
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
CREATE DATABASE IF NOT EXISTS `essentia` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `essentia`;
-- MySQL dump 10.13 Distrib 8.0.38, for Win64 (x86_64)
--
-- Host: localhost Database: essentia
-- ------------------------------------------------------
-- Server version 8.0.39
/*!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 */;
/*!50503 SET NAMES utf8 */;
/*!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 `cliente`
--
DROP TABLE IF EXISTS `cliente`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cliente` (
`id_cliente` int NOT NULL AUTO_INCREMENT,
`nome` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`cpf` varchar(14) NOT NULL,
`telefone` varchar(15) NOT NULL,
`data_criacao` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_cliente`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `cpf` (`cpf`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cliente`
--
LOCK TABLES `cliente` WRITE;
/*!40000 ALTER TABLE `cliente` DISABLE KEYS */;
INSERT INTO `cliente` VALUES (1,'alfa','sa@gmail.com','807.618.880-63','(53) 42534-5345','2024-10-01 04:47:44');
/*!40000 ALTER TABLE `cliente` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pedido_produtos`
--
DROP TABLE IF EXISTS `pedido_produtos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pedido_produtos` (
`id` int NOT NULL AUTO_INCREMENT,
`id_pedido` int DEFAULT NULL,
`id_produto` int DEFAULT NULL,
`quantidade` int DEFAULT NULL,
`valor` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id_pedido` (`id_pedido`),
CONSTRAINT `pedido_produtos_ibfk_1` FOREIGN KEY (`id_pedido`) REFERENCES `pedidos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pedido_produtos`
--
LOCK TABLES `pedido_produtos` WRITE;
/*!40000 ALTER TABLE `pedido_produtos` DISABLE KEYS */;
INSERT INTO `pedido_produtos` VALUES (1,1,4,1,10.00),(2,2,3,2,24.00),(3,2,4,9,90.00),(4,3,3,1,12.00),(5,4,3,2,24.00),(6,5,3,2,24.00),(7,6,3,3,36.00),(8,7,3,2,24.00),(9,7,4,9,90.00);
/*!40000 ALTER TABLE `pedido_produtos` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pedidos`
--
DROP TABLE IF EXISTS `pedidos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pedidos` (
`id` int NOT NULL AUTO_INCREMENT,
`id_cliente` int DEFAULT NULL,
`observacao` text,
`subtotal` decimal(10,2) DEFAULT NULL,
`desconto` decimal(10,2) DEFAULT NULL,
`total` decimal(10,2) DEFAULT NULL,
`id_usuario` int DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `id_cliente` (`id_cliente`),
CONSTRAINT `pedidos_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `cliente` (`id_cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pedidos`
--
LOCK TABLES `pedidos` WRITE;
/*!40000 ALTER TABLE `pedidos` DISABLE KEYS */;
INSERT INTO `pedidos` VALUES (1,1,'teste',10.00,0.00,10.00,1,'2024-10-01 04:48:51'),(2,1,'asdfs',114.00,10.00,104.00,1,'2024-10-01 05:20:53'),(3,1,'',12.00,0.00,12.00,1,'2024-10-01 06:05:30'),(4,1,'a',24.00,0.00,24.00,1,'2024-10-01 06:10:22'),(5,1,'a',24.00,0.00,24.00,1,'2024-10-01 06:12:12'),(6,1,'',36.00,0.00,36.00,1,'2024-10-01 06:12:47'),(7,1,'aa',114.00,10.00,104.00,1,'2024-10-01 06:14:00');
/*!40000 ALTER TABLE `pedidos` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `produto`
--
DROP TABLE IF EXISTS `produto`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `produto` (
`id_produto` int NOT NULL AUTO_INCREMENT,
`nome` varchar(100) NOT NULL,
`sku` varchar(50) NOT NULL,
`valor` decimal(10,2) NOT NULL,
`quantidade` int NOT NULL,
`descricao` text,
`caminho` varchar(255) NOT NULL,
`data_criacao` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_produto`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `produto`
--
LOCK TABLES `produto` WRITE;
/*!40000 ALTER TABLE `produto` DISABLE KEYS */;
INSERT INTO `produto` VALUES (3,'Charizarda','44',12.00,9,'Pokemon de fogos','uploads/gengar.jpg','2024-09-22 20:57:51'),(4,'Dragonite','17',10.00,2,'Pokemon tipo dragão','uploads/dragonite.jpg','2024-09-24 21:49:37');
/*!40000 ALTER TABLE `produto` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario`
--
DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `usuario` (
`id_usuario` int NOT NULL AUTO_INCREMENT,
`nome` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`cpf` varchar(14) NOT NULL,
`telefone` varchar(15) NOT NULL,
`dataNascimento` date NOT NULL,
`senha` varchar(255) NOT NULL,
`pergunta_secreta` varchar(255) NOT NULL,
`resposta_secreta` varchar(255) NOT NULL,
`data_cadastro` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_usuario`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `cpf` (`cpf`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `usuario`
--
LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
INSERT INTO `usuario` VALUES (1,'s','s@gmail.com','704.454.712-55','(15) 98248-3423','2002-05-31','7c4a8d09ca3762af61e59520943dc26494f8941b','Qual é o nome do seu primeiro animal de estimação?','lesie','2024-10-01 06:17:56');
/*!40000 ALTER TABLE `usuario` 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 2024-10-01 3:50:16