--
-- Host: localhost    Database: hci-db-system
-- ------------------------------------------------------


--
-- Table structure for table `Permissions`
--

CREATE TABLE `Permissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `assignedTo` text NOT NULL,
  `dataCreated` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `Permissions`
--

INSERT INTO `Permissions` VALUES (1,'User Manager','','2024-01-06 12:09:52'),(2,'Dashboard','','2024-01-06 12:22:18');

--
-- Table structure for table `Roles`
--

CREATE TABLE `Roles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) NOT NULL,
  `role_users` text,
  `role_ability` json DEFAULT NULL,
  `createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_name` (`role_name`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `Roles`
--

INSERT INTO `Roles` VALUES (3,'Comercial',NULL,'[{\"name\": \"User Manager\", \"read\": true, \"write\": true, \"create\": true}, {\"name\": \"Dashboard\", \"read\": true, \"write\": true, \"create\": true}]','2024-01-06 19:30:52'),(11,'admin',NULL,'[{\"name\": \"User Manager\", \"read\": true, \"write\": true, \"create\": true}, {\"name\": \"Dashboard\", \"read\": true, \"write\": true, \"create\": true}]','2024-01-07 23:24:37'),(16,'Válvulas',NULL,'[]','2024-01-11 00:05:09'),(17,'Tubos',NULL,'[{\"name\": \"User Manager\", \"read\": true, \"write\": true, \"create\": true}, {\"name\": \"Dashboard\", \"read\": true, \"write\": true, \"create\": true}]','2024-01-11 00:09:53'),(18,'SAC',NULL,'[]','2024-01-11 00:09:59'),(19,'Recebimento',NULL,'[]','2024-01-11 00:10:18'),(20,'Logística',NULL,'[]','2024-01-11 00:10:26'),(21,'Industrial',NULL,'[]','2024-01-11 00:10:34'),(22,'Financeiro',NULL,'[]','2024-01-11 00:10:40'),(23,'Qualidade',NULL,'[]','2024-01-11 00:10:44'),(24,'Compras Nacionais',NULL,'[]','2024-01-11 00:10:50');

--
-- Table structure for table `User`
--

CREATE TABLE `User` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fullName` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `username` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'normal',
  `date_create` datetime DEFAULT CURRENT_TIMESTAMP,
  `abilityRules` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `avatar` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `User`
--

INSERT INTO `User` VALUES (1,'Admin Teste User','admin','admin@demo.com','$2a$10$r6iqNurpw8FbvhZv1DfhqOIB7fchB8DXkk3ESL7ECMeMQWBU8Zure','admin','2024-01-02 21:07:19','[\n        {\n          action: \'manage\',\n          subject: \'all\',\n        },\n      ]\n\n','/uploads/fotos-perfil/1704913323387.jpg'),(26,'Teste User 2','teste','teste@gmail.com','$2a$10$0xpbz0Dq7yy4Nd7fV3wB9OyLn54A12Um1NCZGxz5A4T28mG7l5t1q','admin','2024-01-06 21:41:55','[\n        {\n          action: \'manage\',\n          subject: \'all\',\n        },\n      ]\n\n','/uploads/fotos-perfil/1704599021413.jpg');


