/*M!999999\- enable the sandbox mode */ 
-- MariaDB dump 10.19-11.7.2-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: i5ai2_db
-- ------------------------------------------------------
-- Server version	11.7.2-MariaDB-ubu2404

/*!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 */;
/*!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' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `permessi`
--

DROP TABLE IF EXISTS `permessi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `permessi` (
  `ID_USER` int(11) NOT NULL,
  `ID_RUOLO` int(11) NOT NULL,
  `DATA_ASSEGNAZIONE` datetime NOT NULL,
  UNIQUE KEY `PERMESSI_UNIQUE` (`ID_USER`,`ID_RUOLO`,`DATA_ASSEGNAZIONE`),
  KEY `PERMESSI_RUOLI_FK` (`ID_RUOLO`),
  CONSTRAINT `PERMESSI_RUOLI_FK` FOREIGN KEY (`ID_RUOLO`) REFERENCES `ruoli` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `PERMESSI_USERS_FK` FOREIGN KEY (`ID_USER`) REFERENCES `users` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permessi`
--

LOCK TABLES `permessi` WRITE;
/*!40000 ALTER TABLE `permessi` DISABLE KEYS */;
INSERT INTO `permessi` VALUES
(1,1,'2025-10-10 00:00:00'),
(2,1,'2025-10-10 00:00:00'),
(3,1,'2025-10-10 00:00:00'),
(4,1,'2025-10-10 00:00:00'),
(5,1,'2025-10-10 00:00:00'),
(6,1,'2025-10-10 00:00:00'),
(7,1,'2025-10-10 00:00:00'),
(8,1,'2025-10-10 00:00:00'),
(9,1,'2025-10-10 00:00:00'),
(10,2,'2025-10-10 00:00:00');
/*!40000 ALTER TABLE `permessi` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `persone`
--

DROP TABLE IF EXISTS `persone`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `persone` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `NOME` varchar(100) NOT NULL,
  `COGNOME` varchar(100) NOT NULL,
  `DATA_NASCITA` date NOT NULL,
  `LUOGO_NASCITA` varchar(100) NOT NULL,
  `CF` varchar(16) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `persone`
--

LOCK TABLES `persone` WRITE;
/*!40000 ALTER TABLE `persone` DISABLE KEYS */;
INSERT INTO `persone` VALUES
(1,'Greha','Brugnatti','2007-02-20','GENOVA','GRH1123'),
(2,'Grato','Brugnara','2001-11-11','GENOVA','GRH1123'),
(3,'Gruto','Bermuda','2001-01-20','GENOVA','GRH1123'),
(4,'Pluto','Permuta','2005-10-20','GENOVA','GRH1123'),
(5,'Maruto','Perpetuo','2005-10-20','GENOVA','GRH1123'),
(6,'Rutto','Serpetuo','2005-10-20','GENOVA','GRH1123'),
(7,'Ratto','Serpento','2005-10-20','GENOVA','GRH1123'),
(8,'Matto','Serato','2005-10-20','GENOVA','GRH1123'),
(9,'Santo','Stefano','2005-10-20','GENOVA','GRH1123'),
(10,'Sergio','Bianchi','2007-05-07','Genova','BNCSRG07E07D969F');
/*!40000 ALTER TABLE `persone` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ruoli`
--

DROP TABLE IF EXISTS `ruoli`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ruoli` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `DESCRIZIONE` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ruoli`
--

LOCK TABLES `ruoli` WRITE;
/*!40000 ALTER TABLE `ruoli` DISABLE KEYS */;
INSERT INTO `ruoli` VALUES
(1,'utente'),
(2,'admin'),
(3,'scrittore');
/*!40000 ALTER TABLE `ruoli` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `DESCRIZIONE` varchar(100) NOT NULL,
  `DATA_CREAZIONE` datetime DEFAULT NULL,
  `ID_PERSONA` int(11) NOT NULL,
  `PASSWORD` varchar(30) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `USERS_UNIQUE` (`ID_PERSONA`,`ID`),
  CONSTRAINT `USERS_PERSONE_FK` FOREIGN KEY (`ID_PERSONA`) REFERENCES `persone` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES
(1,'utente-1','2025-10-10 00:00:00',1,'password-1'),
(2,'utente-2','2025-10-10 00:00:00',2,'password-2'),
(3,'utente-3','2025-10-10 00:00:00',3,'password-3'),
(4,'utente-4','2025-10-10 00:00:00',4,'password-4'),
(5,'utente-5','2025-10-10 00:00:00',5,'password-5'),
(6,'utente-6','2025-10-10 00:00:00',6,'password-6'),
(7,'utente-7','2025-10-10 00:00:00',7,'password-7'),
(8,'utente-8','2025-10-10 00:00:00',8,'password-8'),
(9,'utente-9','2025-10-10 00:00:00',9,'password-9'),
(10,'utente-10','2025-10-10 00:00:00',10,'password-10');
/*!40000 ALTER TABLE `users` 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 */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2025-10-24  7:39:43
