-- MariaDB dump 10.17  Distrib 10.4.10-MariaDB, for Win64 (AMD64)
--
-- Host: 132.248.180.82    Database: Iris_Produccion
-- ------------------------------------------------------
-- Server version	10.6.7-MariaDB

/*!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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `carrera`
--

DROP TABLE IF EXISTS `carrera`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `carrera` (
  `idCarrera` int(11) NOT NULL AUTO_INCREMENT,
  `carrera` varchar(50) NOT NULL,
  PRIMARY KEY (`idCarrera`),
  UNIQUE KEY `idCarrera` (`idCarrera`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `carrera`
--

LOCK TABLES `carrera` WRITE;
/*!40000 ALTER TABLE `carrera` DISABLE KEYS */;
/*!40000 ALTER TABLE `carrera` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `caso_especial`
--

DROP TABLE IF EXISTS `caso_especial`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `caso_especial` (
  `idCasoEspecial` int(11) NOT NULL AUTO_INCREMENT,
  `creditos` varchar(3) NOT NULL,
  `correo` varchar(60) NOT NULL,
  `telefono` varchar(15) NOT NULL,
  `institucion` varchar(200) DEFAULT NULL,
  `dependencia` varchar(200) DEFAULT NULL,
  `motivo` varchar(1) DEFAULT NULL,
  `direccion` varchar(200) NOT NULL,
  `fechaInicio` datetime NOT NULL,
  `fechaFin` datetime NOT NULL,
  `fechaNacimiento` datetime NOT NULL,
  `carpeta` varchar(60) NOT NULL,
  `archivoZip` varchar(60) NOT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `idUsuario` int(11) NOT NULL,
  `idCarrera` int(11) NOT NULL,
  `idStatus` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`idCasoEspecial`),
  UNIQUE KEY `idCasoEspecial` (`idCasoEspecial`),
  KEY `idUsuario` (`idUsuario`),
  KEY `idCarrera` (`idCarrera`),
  KEY `idStatus` (`idStatus`),
  CONSTRAINT `caso_especial_ibfk_1` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `caso_especial_ibfk_2` FOREIGN KEY (`idCarrera`) REFERENCES `carrera` (`idCarrera`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `caso_especial_ibfk_3` FOREIGN KEY (`idStatus`) REFERENCES `status` (`idStatus`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `caso_especial`
--

LOCK TABLES `caso_especial` WRITE;
/*!40000 ALTER TABLE `caso_especial` DISABLE KEYS */;
/*!40000 ALTER TABLE `caso_especial` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cuestionario_alumno`
--

DROP TABLE IF EXISTS `cuestionario_alumno`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cuestionario_alumno` (
  `idCuestionarioAlumno` int(11) NOT NULL AUTO_INCREMENT,
  `sexo` varchar(1) NOT NULL,
  `edad` varchar(2) NOT NULL,
  `servicioMedico` varchar(100) NOT NULL,
  `p1` tinyint(1) NOT NULL,
  `p2` tinyint(1) NOT NULL,
  `p3` varchar(150) NOT NULL,
  `p4` tinyint(1) NOT NULL,
  `p5` varchar(7) NOT NULL,
  `p6` tinyint(1) NOT NULL,
  `p7` tinyint(1) NOT NULL,
  `p8` varchar(5) NOT NULL,
  `p9` tinyint(1) NOT NULL,
  `p10` tinyint(1) NOT NULL,
  `p11` tinyint(1) NOT NULL,
  `p12` tinyint(1) NOT NULL,
  `p13` tinyint(1) NOT NULL,
  `p14` varchar(7) NOT NULL,
  `p15` varchar(7) NOT NULL,
  `p16` varchar(2) NOT NULL,
  `p17` varchar(5) NOT NULL,
  `p18` tinyint(1) NOT NULL,
  `p19` tinyint(1) NOT NULL,
  `p20` tinyint(1) NOT NULL,
  `p21` varchar(9) NOT NULL,
  `p22` varchar(23) NOT NULL,
  `p23` varchar(8) NOT NULL,
  `p24` varchar(8) NOT NULL,
  `p25` tinyint(1) NOT NULL,
  `p26` tinyint(1) NOT NULL,
  `p27` varchar(400) NOT NULL,
  `p28` varchar(1) NOT NULL,
  `p29` varchar(1) NOT NULL,
  `p30` varchar(400) NOT NULL,
  `createdAt` datetime NOT NULL,
  PRIMARY KEY (`idCuestionarioAlumno`),
  UNIQUE KEY `idCuestionarioAlumno` (`idCuestionarioAlumno`)
) ENGINE=InnoDB AUTO_INCREMENT=13564 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cuestionario_alumno`
--

LOCK TABLES `cuestionario_alumno` WRITE;
/*!40000 ALTER TABLE `cuestionario_alumno` DISABLE KEYS */;
/*!40000 ALTER TABLE `cuestionario_alumno` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cuestionario_programa`
--

DROP TABLE IF EXISTS `cuestionario_programa`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cuestionario_programa` (
  `idCuestionarioPrograma` int(11) NOT NULL AUTO_INCREMENT,
  `actividad1` varchar(400) NOT NULL,
  `actividad2` varchar(400) NOT NULL,
  `actividad3` varchar(400) NOT NULL,
  `actividad4` varchar(400) NOT NULL,
  `actividad5` varchar(400) NOT NULL,
  `retroalimentacion` varchar(9) NOT NULL,
  `p6` varchar(800) DEFAULT NULL,
  `p7` varchar(800) NOT NULL,
  `createdAt` datetime NOT NULL,
  PRIMARY KEY (`idCuestionarioPrograma`),
  UNIQUE KEY `idCuestionarioPrograma` (`idCuestionarioPrograma`)
) ENGINE=InnoDB AUTO_INCREMENT=13582 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cuestionario_programa`
--

LOCK TABLES `cuestionario_programa` WRITE;
/*!40000 ALTER TABLE `cuestionario_programa` DISABLE KEYS */;
/*!40000 ALTER TABLE `cuestionario_programa` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `programa`
--

DROP TABLE IF EXISTS `programa`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `programa` (
  `idPrograma` int(11) NOT NULL AUTO_INCREMENT,
  `institucion` varchar(120) NOT NULL,
  `dependencia` varchar(120) NOT NULL,
  `programa` varchar(280) NOT NULL,
  `clavePrograma` varchar(20) NOT NULL,
  `acatlan` tinyint(1) NOT NULL DEFAULT 0,
  `activo` tinyint(1) NOT NULL DEFAULT 1,
  `idUsuario` int(11) NOT NULL,
  PRIMARY KEY (`idPrograma`),
  UNIQUE KEY `idPrograma` (`idPrograma`),
  KEY `idUsuario` (`idUsuario`),
  CONSTRAINT `programa_ibfk_1` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11518 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `programa`
--

LOCK TABLES `programa` WRITE;
/*!40000 ALTER TABLE `programa` DISABLE KEYS */;
/*!40000 ALTER TABLE `programa` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `servicio`
--

DROP TABLE IF EXISTS `servicio`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servicio` (
  `idServicio` int(11) NOT NULL AUTO_INCREMENT,
  `creditos` varchar(3) NOT NULL,
  `correo` varchar(60) NOT NULL,
  `telefono` varchar(15) DEFAULT NULL,
  `direccion` varchar(200) DEFAULT NULL,
  `fechaInicio` datetime NOT NULL,
  `fechaFin` datetime NOT NULL,
  `fechaNacimiento` datetime DEFAULT NULL,
  `carpeta` varchar(60) NOT NULL,
  `cartaAceptacion` varchar(60) NOT NULL,
  `cartaTermino` varchar(60) DEFAULT NULL,
  `informeGlobal` varchar(60) DEFAULT NULL,
  `programaInterno` varchar(250) DEFAULT NULL,
  `profesor` varchar(50) DEFAULT NULL,
  `vistoBuenoAcatlan` tinyint(1) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `idUsuario` int(11) NOT NULL,
  `idCarrera` int(11) NOT NULL,
  `idStatus` int(11) NOT NULL DEFAULT 1,
  `idPrograma` int(11) NOT NULL,
  `idCuestionarioAlumno` int(11) DEFAULT NULL,
  `idCuestionarioPrograma` int(11) DEFAULT NULL,
  `fechaLiberacion` datetime DEFAULT NULL,
  PRIMARY KEY (`idServicio`),
  UNIQUE KEY `idServicio` (`idServicio`),
  KEY `idUsuario` (`idUsuario`),
  KEY `idCarrera` (`idCarrera`),
  KEY `idStatus` (`idStatus`),
  KEY `idPrograma` (`idPrograma`),
  KEY `idCuestionarioAlumno` (`idCuestionarioAlumno`),
  KEY `idCuestionarioPrograma` (`idCuestionarioPrograma`),
  CONSTRAINT `servicio_ibfk_1` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `servicio_ibfk_2` FOREIGN KEY (`idCarrera`) REFERENCES `carrera` (`idCarrera`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `servicio_ibfk_3` FOREIGN KEY (`idStatus`) REFERENCES `status` (`idStatus`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `servicio_ibfk_4` FOREIGN KEY (`idPrograma`) REFERENCES `programa` (`idPrograma`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `servicio_ibfk_5` FOREIGN KEY (`idCuestionarioAlumno`) REFERENCES `cuestionario_alumno` (`idCuestionarioAlumno`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `servicio_ibfk_6` FOREIGN KEY (`idCuestionarioPrograma`) REFERENCES `cuestionario_programa` (`idCuestionarioPrograma`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17310 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `servicio`
--

LOCK TABLES `servicio` WRITE;
/*!40000 ALTER TABLE `servicio` DISABLE KEYS */;
/*!40000 ALTER TABLE `servicio` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `status`
--

DROP TABLE IF EXISTS `status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `status` (
  `idStatus` int(11) NOT NULL AUTO_INCREMENT,
  `status` varchar(30) NOT NULL,
  PRIMARY KEY (`idStatus`),
  UNIQUE KEY `idStatus` (`idStatus`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `status`
--

LOCK TABLES `status` WRITE;
/*!40000 ALTER TABLE `status` DISABLE KEYS */;
/*!40000 ALTER TABLE `status` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tipo_usuario`
--

DROP TABLE IF EXISTS `tipo_usuario`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipo_usuario` (
  `idTipoUsuario` int(11) NOT NULL AUTO_INCREMENT,
  `tipoUsuario` varchar(15) NOT NULL,
  PRIMARY KEY (`idTipoUsuario`),
  UNIQUE KEY `idTipoUsuario` (`idTipoUsuario`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tipo_usuario`
--

LOCK TABLES `tipo_usuario` WRITE;
/*!40000 ALTER TABLE `tipo_usuario` DISABLE KEYS */;
/*!40000 ALTER TABLE `tipo_usuario` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `usuario`
--

DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuario` (
  `idUsuario` int(11) NOT NULL AUTO_INCREMENT,
  `usuario` varchar(100) NOT NULL,
  `password` varchar(60) DEFAULT NULL,
  `nombre` varchar(70) DEFAULT NULL,
  `activo` tinyint(1) NOT NULL,
  `idTipoUsuario` int(11) NOT NULL,
  PRIMARY KEY (`idUsuario`),
  UNIQUE KEY `idUsuario` (`idUsuario`),
  UNIQUE KEY `usuario` (`usuario`),
  KEY `idTipoUsuario` (`idTipoUsuario`),
  CONSTRAINT `usuario_ibfk_1` FOREIGN KEY (`idTipoUsuario`) REFERENCES `tipo_usuario` (`idTipoUsuario`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19930 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `usuario`
--

LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
/*!40000 ALTER TABLE `usuario` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database 'Iris_Produccion'
--
/*!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 2025-01-12 23:25:49




/* CREATE TABLE `servicio` (
  `idServicio` INT PRIMARY KEY
); */

DROP TABLE IF EXISTS `Cuestionario`;
CREATE TABLE `Cuestionario` (
  `idCuestionario` INT PRIMARY KEY  NOT NULL AUTO_INCREMENT,

 `idCuestionarioAlumno` INT,  -- Agregado para relación con alumnos
  `idCuestionarioPrograma` INT, -- Agregado para relación con programas

 `idCuestionarioAlumno1` INT,  -- Agregado para relación con alumnos
  `idCuestionarioPrograma1` INT, -- Agregado para relación con programas

  `idServicio` INT,
  `version` VARCHAR(50),
  `titulo` VARCHAR(50),
  `desc` VARCHAR(50),
  `dirigidoA` VARCHAR(50),
  `createdAt` DATETIME
);


DROP TABLE IF EXISTS `cuestionario_alumno_2`;
CREATE TABLE `cuestionario_alumno_2` (
  `idCuestionarioAlumno2` INT PRIMARY KEY  NOT NULL AUTO_INCREMENT,

  `createdAt` DATETIME,


  `p12_A_1` VARCHAR(50),
  `p12_A_2` VARCHAR(50),
  `p12_A_3` VARCHAR(50),
  `p12_A_4` VARCHAR(50),
  `p12_B_1` VARCHAR(50),
  `p12_B_2` VARCHAR(50),
  `p12_B_3` VARCHAR(50),
  `p12_B_4` VARCHAR(50),
  `p12_C_1` VARCHAR(50),
  `p12_C_2` VARCHAR(50),
  `p12_C_3` VARCHAR(50),
  `p12_C_4` VARCHAR(50),
  `p10_1` VARCHAR(50),
  `p10_2` VARCHAR(50),
  `p10_3` VARCHAR(50),
  `p11_1` VARCHAR(50),
  `p11_2` VARCHAR(50),
  `p11_3` VARCHAR(50),
  `p11_4` VARCHAR(50),
  `p17_1` VARCHAR(50),
  `p17_2` VARCHAR(50),
  `p17_3` VARCHAR(50),
  `p3_1` VARCHAR(50),
  `p3_2` VARCHAR(50),
  `p3_3` VARCHAR(50),
  `p3_4` VARCHAR(50),
  `p12_D_1` VARCHAR(50),
  `p12_D_2` VARCHAR(50),
  `p12_D_3` VARCHAR(50),
  `p12_D_4` VARCHAR(50),
  `p12_D_5` VARCHAR(50),
  `p1` VARCHAR(150),
  `p2` VARCHAR(50),
  `p4` VARCHAR(50),
  `p5` VARCHAR(50),
  `p6` VARCHAR(50),
  `p7` VARCHAR(50),
  `p8` VARCHAR(50),
  `p9` VARCHAR(50),
  `p13` VARCHAR(50),
  `p14` VARCHAR(50),
  `p15` VARCHAR(50),
  `p16` VARCHAR(50),
  `p18` VARCHAR(50)
);

DROP TABLE IF EXISTS `cuestionario_programa_2`;
CREATE TABLE `cuestionario_programa_2` (
  `idCuestionarioPrograma2` INT PRIMARY KEY  NOT NULL AUTO_INCREMENT,
  `createdAt` DATETIME,

  `p3_A_1` VARCHAR(50),
  `p3_A_2` VARCHAR(50),
  `p3_A_3` VARCHAR(50),
  `p3_A_4` VARCHAR(50),
  `p3_B_1` VARCHAR(50),
  `p3_B_2` VARCHAR(50),
  `p3_B_3` VARCHAR(50),
  `p3_B_4` VARCHAR(50),
  `p3_C_1` VARCHAR(50),
  `p3_C_2` VARCHAR(50),
  `p3_C_3` VARCHAR(50),
  `p3_C_4` VARCHAR(50),
  `p3_C_5` VARCHAR(50),
  `p3_D_1` VARCHAR(50),
  `p3_D_2` VARCHAR(50),
  `p3_D_3` VARCHAR(50),
  `p3_D_4` VARCHAR(50),
  `p3_D_5` VARCHAR(50),
  `p3_E_1` VARCHAR(50),
  `p1` VARCHAR(50),
  `p2` VARCHAR(50),
  `p4` VARCHAR(50),
  `p5` VARCHAR(50),
  `p6` VARCHAR(50)
);


-- Relaciones corregidas
ALTER TABLE `Cuestionario`
ADD FOREIGN KEY (`idServicio`) REFERENCES `servicio` (`idServicio`);

ALTER TABLE `Cuestionario`
ADD FOREIGN KEY (`idCuestionarioAlumno`) REFERENCES `cuestionario_alumno_2` (`idCuestionarioAlumno2`);

ALTER TABLE `Cuestionario`
ADD FOREIGN KEY (`idCuestionarioPrograma`) REFERENCES `cuestionario_programa_2` (`idCuestionarioPrograma2`);




ALTER TABLE `Cuestionario`
ADD FOREIGN KEY (`idCuestionarioAlumno1`) REFERENCES `cuestionario_alumno` (`idCuestionarioAlumno`);

ALTER TABLE `Cuestionario`
ADD FOREIGN KEY (`idCuestionarioPrograma1`) REFERENCES `cuestionario_programa` (`idCuestionarioPrograma`);





