--
-- Host: localhost    Database: administracion
-- ------------------------------------------------------


--
-- Current Database: `administracion`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `administracion` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `administracion`;

--
-- Table structure for table `34791929J_nom`
--

CREATE TABLE `34791929J_nom` (
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  UNIQUE KEY `centro_origen` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `34791929J_tmp`
--

CREATE TABLE `34791929J_tmp` (
  `id_trabajador` mediumint unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `razonsocial` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `categoria` varchar(255) NOT NULL,
  `puesto` varchar(255) DEFAULT NULL,
  `departamento` varchar(255) NOT NULL,
  `iddelegacion` varchar(4) NOT NULL,
  `bruto_imputado` float(8,2) NOT NULL,
  `bruto_total` float(8,2) NOT NULL,
  `ssempresa_imputado` float(8,2) NOT NULL,
  `ssempresa_total` float(8,2) NOT NULL,
  `imputacion` float(8,2) DEFAULT NULL,
  `jornada_semanal` float DEFAULT NULL,
  `horas` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `34812601P_tmp`
--

CREATE TABLE `34812601P_tmp` (
  `id_trabajador` mediumint unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `razonsocial` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `categoria` varchar(255) NOT NULL,
  `puesto` varchar(255) DEFAULT NULL,
  `departamento` varchar(255) NOT NULL,
  `iddelegacion` varchar(4) NOT NULL,
  `bruto_imputado` float(8,2) NOT NULL,
  `bruto_total` float(8,2) NOT NULL,
  `ssempresa_imputado` float(8,2) NOT NULL,
  `ssempresa_total` float(8,2) NOT NULL,
  `imputacion` float(8,2) DEFAULT NULL,
  `jornada_semanal` float DEFAULT NULL,
  `horas` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48492283A_arbol`
--

CREATE TABLE `48492283A_arbol` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `proyecto` int unsigned NOT NULL,
  `padre_id` bigint unsigned NOT NULL,
  `posicion` tinyint unsigned NOT NULL,
  `nombre` varchar(255) NOT NULL,
  `clas` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_id` (`padre_id`,`posicion`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

--
-- Table structure for table `48492283A_nominas`
--

CREATE TABLE `48492283A_nominas` (
  `fecha` date NOT NULL,
  `nif` varchar(255) DEFAULT NULL,
  `trabajador` varchar(255) DEFAULT NULL,
  `categoria` varchar(255) DEFAULT NULL,
  `totalbruto` decimal(8,2) DEFAULT NULL,
  `totalssempresa` decimal(8,2) DEFAULT NULL,
  `totalirpf` decimal(8,2) DEFAULT NULL,
  `totalliquido` decimal(8,2) DEFAULT NULL,
  `totalss_empleado` decimal(8,2) DEFAULT NULL,
  `totalliquidofiniquito` decimal(8,2) DEFAULT NULL,
  `totalpagodelegado` decimal(8,2) DEFAULT NULL,
  `bruto` decimal(8,2) DEFAULT NULL,
  `ssempresa` decimal(8,2) DEFAULT NULL,
  `irpf` decimal(8,2) DEFAULT NULL,
  `ss_empleado` decimal(8,2) DEFAULT NULL,
  `liquido` decimal(8,2) DEFAULT NULL,
  `pagodelegado` decimal(8,2) DEFAULT NULL,
  `totalsaldofiniquito` decimal(8,2) DEFAULT NULL,
  `liquidofiniquito` decimal(8,2) DEFAULT NULL,
  `anticipo` decimal(8,2) DEFAULT NULL,
  `totalanticipo` decimal(8,2) DEFAULT NULL,
  `codigoproyecto` decimal(5,0) NOT NULL,
  `iddelegacion` char(4) DEFAULT NULL,
  `anacodigo1` decimal(2,0) DEFAULT NULL,
  `anacodigo2` decimal(2,0) DEFAULT NULL,
  `anacodigo3` decimal(2,0) DEFAULT NULL,
  `fechapago` date DEFAULT NULL,
  KEY `codigoproyecto` (`codigoproyecto`,`iddelegacion`,`anacodigo1`,`anacodigo2`,`anacodigo3`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `48492283A_rawdata`
--

CREATE TABLE `48492283A_rawdata` (
  `n_orden` int unsigned DEFAULT NULL,
  `codigoproyecto` decimal(5,0) NOT NULL,
  `proyecto` varchar(255) DEFAULT NULL,
  `fecha` date NOT NULL,
  `razonsocial` varchar(255) DEFAULT NULL,
  `concepto` varchar(255) DEFAULT NULL,
  `importe` decimal(30,2) DEFAULT NULL,
  `numeroalbaran` mediumint unsigned NOT NULL,
  `porcentaje` decimal(30,2) DEFAULT NULL,
  `delegacion` varchar(255) DEFAULT NULL,
  `departamento` varchar(255) DEFAULT NULL,
  `seccion` varchar(255) DEFAULT NULL,
  `descripcion` varchar(255) DEFAULT NULL,
  `iddelegacion` char(4) DEFAULT NULL,
  `anacodigo1` decimal(2,0) DEFAULT NULL,
  `anacodigo2` decimal(2,0) DEFAULT NULL,
  `anacodigo3` decimal(2,0) DEFAULT NULL,
  `cifdni` varchar(255) DEFAULT NULL,
  `categoria` varchar(255) DEFAULT NULL,
  `codigoubicacion` char(4) DEFAULT NULL,
  `fechacaduca` date DEFAULT NULL,
  `numfact` varchar(255) DEFAULT NULL,
  `obsfact` varchar(255) DEFAULT NULL,
  `unidades` decimal(8,2) DEFAULT NULL,
  `id_ubicacion` int unsigned DEFAULT NULL,
  `num_fact_cont` int unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48492283A_tmp`
--

CREATE TABLE `48492283A_tmp` (
  `id_trabajador` mediumint unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `razonsocial` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `categoria` varchar(255) NOT NULL,
  `puesto` varchar(255) DEFAULT NULL,
  `departamento` varchar(255) NOT NULL,
  `iddelegacion` varchar(4) NOT NULL,
  `bruto_imputado` float(8,2) NOT NULL,
  `bruto_total` float(8,2) NOT NULL,
  `ssempresa_imputado` float(8,2) NOT NULL,
  `ssempresa_total` float(8,2) NOT NULL,
  `imputacion` float(8,2) DEFAULT NULL,
  `jornada_semanal` float DEFAULT NULL,
  `horas` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `cajas`
--

CREATE TABLE `cajas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_centro` smallint NOT NULL,
  `fecha` date NOT NULL,
  `importe` float(8,2) NOT NULL,
  `proveedor` varchar(200) NOT NULL,
  `nfactura` varchar(100) DEFAULT NULL,
  `concepto` varchar(255) DEFAULT NULL,
  `id_proyecto` smallint DEFAULT NULL,
  `id_cierre` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=178938 DEFAULT CHARSET=latin1;

--
-- Table structure for table `cajas_cierres`
--

CREATE TABLE `cajas_cierres` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_centro` smallint unsigned NOT NULL,
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `saldo_previo` float(8,2) NOT NULL,
  `importes` float(8,2) NOT NULL,
  `autor` varchar(9) NOT NULL,
  `borrador` tinyint(1) NOT NULL DEFAULT '1',
  `verificado_por` varchar(9) DEFAULT NULL,
  `fecha_verif` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=940 DEFAULT CHARSET=latin1;

--
-- Table structure for table `cajas_usu`
--

CREATE TABLE `cajas_usu` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_centro` smallint unsigned NOT NULL,
  `nif` varchar(9) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=180 DEFAULT CHARSET=latin1;

--
-- Table structure for table `costes_salariales`
--

CREATE TABLE `costes_salariales` (
  `id` int NOT NULL AUTO_INCREMENT,
  `categoria` varchar(15) NOT NULL,
  `sueldo_bruto` decimal(10,2) NOT NULL,
  `ss_empresa` decimal(10,2) NOT NULL,
  `finiquito` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `categoria` (`categoria`),
  KEY `categoria_orden` (`categoria`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Table structure for table `imputaciones`
--

CREATE TABLE `imputaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_proy` int unsigned NOT NULL,
  `id_subproy` int unsigned NOT NULL,
  `nif` varchar(12) DEFAULT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  `id_categoria` tinyint unsigned DEFAULT NULL,
  `categoria` varchar(25) DEFAULT NULL,
  `id_centro` int NOT NULL,
  `imputacion` decimal(5,2) DEFAULT NULL,
  `puesto` varchar(255) DEFAULT NULL,
  `tipo_puesto` enum('Plantilla','Sustitución') DEFAULT NULL,
  `epigrafe` varchar(20) DEFAULT NULL,
  `meses` tinyint unsigned NOT NULL,
  `horas_semana` decimal(4,2) unsigned DEFAULT NULL,
  `horas_totales` decimal(8,2) unsigned DEFAULT NULL,
  `bruto` decimal(10,2) unsigned NOT NULL,
  `ssempresa` decimal(10,2) unsigned NOT NULL,
  `finiquito` decimal(10,2) unsigned NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3261 DEFAULT CHARSET=latin1;

--
-- Table structure for table `proyectos`
--

CREATE TABLE `proyectos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=latin1;

--
-- Table structure for table `subproyectos`
--

CREATE TABLE `subproyectos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `id_proyecto` tinyint unsigned NOT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_proyecto` (`id_proyecto`),
  CONSTRAINT `subproyectos_ibfk_1` FOREIGN KEY (`id_proyecto`) REFERENCES `proyectos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=latin1;

--
-- Current Database: `beneficiarios`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `beneficiarios` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `beneficiarios`;

--
-- Table structure for table `acciones_grupales`
--

CREATE TABLE `acciones_grupales` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_proyecto` int NOT NULL,
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_centro` int NOT NULL,
  `id_objetivo` int DEFAULT NULL,
  `id_tipoaccion` int DEFAULT NULL,
  `expediente` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '(sin expediente)',
  `tipo` enum('beneficiarias','entidades') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT 'beneficiarias',
  `f_ini` date NOT NULL,
  `f_fin` date NOT NULL,
  `duracion` float NOT NULL DEFAULT '0',
  `titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `lugar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `con_gasto` tinyint(1) NOT NULL,
  `controlar_asistencia` tinyint(1) NOT NULL,
  `materiales` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `objetivos` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `contenido` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `desarrollo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `logros` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `dificultades` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `evaluacion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `obs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  PRIMARY KEY (`id`),
  KEY `fk-acciones_grupales-id_servicio` (`id_servicio`),
  CONSTRAINT `fk-acciones_grupales-id_servicio` FOREIGN KEY (`id_servicio`) REFERENCES `proy_servicios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1338 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `acciones_grupales_inscripciones`
--

CREATE TABLE `acciones_grupales_inscripciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_accion_grupal` int NOT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  `id_actuacion` int unsigned DEFAULT NULL,
  `id_actuacion_entidad` int unsigned DEFAULT NULL,
  `autor` varchar(9) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `fk-acc-grup-inscripciones-accion-grupal-id` (`id_accion_grupal`),
  KEY `fk-acc-grup-inscripciones-id_actuacion` (`id_actuacion`),
  KEY `fk-acc-grup-inscripciones-id_actuacion_entidad` (`id_actuacion_entidad`),
  CONSTRAINT `fk-acc-grup-inscripciones-id_accion-grupal` FOREIGN KEY (`id_accion_grupal`) REFERENCES `acciones_grupales` (`id`),
  CONSTRAINT `fk-acc-grup-inscripciones-id_actuacion` FOREIGN KEY (`id_actuacion`) REFERENCES `actuaciones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk-acc-grup-inscripciones-id_actuacion_entidad` FOREIGN KEY (`id_actuacion_entidad`) REFERENCES `empresas`.`actuaciones` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=1462 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Table structure for table `acciones_grupales_inscripciones_benefs`
--

CREATE TABLE `acciones_grupales_inscripciones_benefs` (
  `id_accion_grupal_inscripcion` int NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  UNIQUE KEY `idx-acc_gr_inscripci_inscritas-id_acc_grup_centro_usuario` (`id_accion_grupal_inscripcion`,`centro_origen`,`idusuario`),
  KEY `idx-acc_gr_insc_inscritas-usuarios-centro_origen-idusuario` (`centro_origen`,`idusuario`),
  CONSTRAINT `fk-acc_gru_inscr_benefs-id_accion_grupal_inscripcion` FOREIGN KEY (`id_accion_grupal_inscripcion`) REFERENCES `acciones_grupales_inscripciones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk-inscritas-usuarios-centro_origen-idusuario` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios_cepaim`.`usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `acciones_grupales_inscripciones_entidades`
--

CREATE TABLE `acciones_grupales_inscripciones_entidades` (
  `id_accion_grupal_inscripcion` int NOT NULL,
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id_accion_grupal_inscripcion`,`id_entidad`),
  KEY `fk-inscritas-entidades` (`id_entidad`),
  CONSTRAINT `fk-acc_gru_inscr_ent_inscritas-id_accion_grupal_inscripcion` FOREIGN KEY (`id_accion_grupal_inscripcion`) REFERENCES `acciones_grupales_inscripciones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk-inscritas-entidades` FOREIGN KEY (`id_entidad`) REFERENCES `usuarios_cepaim`.`entidades` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `acciones_grupales_sesiones`
--

CREATE TABLE `acciones_grupales_sesiones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha` datetime NOT NULL,
  `obs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `id_accion_grupal` int DEFAULT NULL,
  `duracion` decimal(8,4) NOT NULL,
  `autor` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx-acciones_grupales_sesiones-unique` (`id_accion_grupal`,`fecha`),
  KEY `fk-acciones_grupales_sesiones-id_accion_grupal` (`id_accion_grupal`),
  CONSTRAINT `fk-acciones_grupales_sesiones-id_accion_grupal` FOREIGN KEY (`id_accion_grupal`) REFERENCES `acciones_grupales` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `acciones_grupales_sesiones_benefs`
--

CREATE TABLE `acciones_grupales_sesiones_benefs` (
  `id_accion_grupal_sesion` int NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  UNIQUE KEY `idxacc_gr_ses_benef_centro_usuario` (`id_accion_grupal_sesion`,`centro_origen`,`idusuario`),
  KEY `fk-acc_gr_ses_asis_centro_idusuario` (`centro_origen`,`idusuario`),
  CONSTRAINT `fk-acc_gr_sesiones_usuarios-centro_origen-idusuario` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios_cepaim`.`usuarios` (`centro_origen`, `id`),
  CONSTRAINT `fkacc_gr_ses_benef_sesion-acciones_grupales` FOREIGN KEY (`id_accion_grupal_sesion`) REFERENCES `acciones_grupales_sesiones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `acciones_grupales_sesiones_entidades`
--

CREATE TABLE `acciones_grupales_sesiones_entidades` (
  `id_accion_grupal_sesion` int NOT NULL,
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id_accion_grupal_sesion`,`id_entidad`),
  KEY `fk-acc_gr_ses_entidades` (`id_entidad`),
  CONSTRAINT `fk-acc_gr_ses_asis_sesion-id_accion_grupal_sesion` FOREIGN KEY (`id_accion_grupal_sesion`) REFERENCES `acciones_grupales_sesiones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk-acc_gr_ses_entidades` FOREIGN KEY (`id_entidad`) REFERENCES `usuarios_cepaim`.`entidades` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `actuaciones`
--

CREATE TABLE `actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proyecto` smallint unsigned NOT NULL DEFAULT '0',
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `id_centro` smallint unsigned NOT NULL DEFAULT '0',
  `id_ubicacion` smallint unsigned DEFAULT NULL,
  `destinatarios` varchar(5400) DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `fecha1` datetime NOT NULL,
  `fecha2` datetime DEFAULT NULL,
  `duracion` float unsigned DEFAULT NULL,
  `obs` text,
  `autor` varchar(9) NOT NULL DEFAULT '00000000A',
  `edic` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `certificado` tinyint DEFAULT NULL,
  `fecha_certificacion` date DEFAULT NULL,
  `id_lista` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_formato` (`id_formato`),
  KEY `expte` (`centro_origen`,`idusuario`),
  KEY `fecha1` (`fecha1`),
  KEY `id_centro` (`id_centro`),
  KEY `act_proyecto_servicio` (`id_proyecto`,`id_servicio`),
  KEY `key-proy-formato` (`id_proyecto`,`id_formato`),
  KEY `id_complementaria` (`id_complementaria`)
) ENGINE=InnoDB AUTO_INCREMENT=2268254 DEFAULT CHARSET=latin1;

--
-- Table structure for table `asistencia_sesion_curso`
--

CREATE TABLE `asistencia_sesion_curso` (
  `id_sesion_curso` int NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  UNIQUE KEY `idx-asistencia-sesion_curso-id_curso_centro_usuario` (`id_sesion_curso`,`centro_origen`,`idusuario`),
  KEY `fk-asistencia-usuarios-centro_origen-idusuario` (`centro_origen`,`idusuario`),
  CONSTRAINT `fk-asistencia-sesion_curso-id_sesion_curso` FOREIGN KEY (`id_sesion_curso`) REFERENCES `sesion_curso` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk-asistencia-usuarios-centro_origen-idusuario` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios_cepaim`.`usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `becas`
--

CREATE TABLE `becas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `serie` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `serie_id` int unsigned NOT NULL,
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `document` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `nom_benef` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `expte` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `expte_asilo` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha` date NOT NULL,
  `fecha1` date DEFAULT NULL,
  `fecha2` date DEFAULT NULL,
  `concepto` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id_concepto` int NOT NULL,
  `detalle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `dias_nom` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `dias` smallint unsigned DEFAULT NULL,
  `precio_dia` float(8,2) unsigned DEFAULT NULL,
  `mes` date DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `minoracion` decimal(12,2) NOT NULL DEFAULT '0.00',
  `minoracion_ah` decimal(12,2) NOT NULL DEFAULT '0.00',
  `obs` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `historia` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `situacion` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `otros` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `pago` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `iban` varchar(29) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `proveedor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `num_factura` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `cuenta_contable` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `autor_exportacion` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha_exportacion` date DEFAULT NULL,
  `fecha_impresion` date DEFAULT NULL,
  `num_pagare1` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `num_pagare2` tinyint(1) DEFAULT NULL,
  `fecha_imp_pagare` date DEFAULT NULL,
  `autor_imp_pagare` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha_cobro` date DEFAULT NULL,
  `num_transf` mediumint DEFAULT NULL,
  `fecha_export_caja` date DEFAULT NULL,
  `autor_export_caja` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha_minoracion` date DEFAULT NULL,
  `minoracion_copago` decimal(12,2) NOT NULL DEFAULT '0.00',
  `minoracion_beca_comedor` decimal(12,2) NOT NULL DEFAULT '0.00',
  `fecha_minoracion_copago` date DEFAULT NULL,
  `fecha_minoracion_beca_comedor` date DEFAULT NULL,
  `compensacion_cambio_fase` decimal(12,2) NOT NULL DEFAULT '0.00',
  `fecha_autorizacion` date DEFAULT NULL,
  `obs_excepcionalidad` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `minoracion_pago_indebido` decimal(12,2) NOT NULL DEFAULT '0.00',
  `becas_pago_indebido` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `serie` (`serie`,`serie_id`),
  KEY `expte` (`centro_origen`,`idusuario`),
  KEY `id_complementaria` (`id_complementaria`),
  KEY `fecha` (`fecha`),
  CONSTRAINT `becas_ibfk_1` FOREIGN KEY (`id_complementaria`) REFERENCES `becas_extra` (`id`) ON DELETE CASCADE ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=432581 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `becas_borradas`
--

CREATE TABLE `becas_borradas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_ayuda` varchar(20) NOT NULL,
  `fmto` varchar(50) NOT NULL,
  `benef` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `pago` varchar(25) DEFAULT NULL,
  `id_centro` smallint unsigned NOT NULL DEFAULT '0',
  `id_proyecto` smallint unsigned NOT NULL DEFAULT '0',
  `autor` varchar(9) DEFAULT NULL,
  `fecha_borrado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `datos` text,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20089 DEFAULT CHARSET=latin1;

--
-- Table structure for table `becas_dest`
--

CREATE TABLE `becas_dest` (
  `id_beca` int unsigned NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `importe` float(8,2) NOT NULL,
  `parentesco` enum('Ascendiente a su cargo','Cónyuge','Hijo/a','Hijo/a del cónyuge','Menor a su cargo','Menor tutelado legalmente','Otros','Pareja de hecho') NOT NULL,
  `incluido` tinyint(1) NOT NULL DEFAULT '0',
  UNIQUE KEY `id_beca` (`id_beca`,`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `becas_dest2`
--

CREATE TABLE `becas_dest2` (
  `id_beca` int unsigned NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `importe` float(8,2) NOT NULL,
  `parentesco` enum('Ascendiente a su cargo','Cónyuge','Hijo/a','Hijo/a del cónyuge','Menor a su cargo','Menor tutelado legalmente','Otros','Pareja de hecho') NOT NULL,
  UNIQUE KEY `id_beca` (`id_beca`,`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `becas_extra`
--

CREATE TABLE `becas_extra` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `num_siria` varchar(12) DEFAULT NULL,
  `situacion_legal` varchar(50) DEFAULT NULL,
  `num_unidadfamiliar` tinyint DEFAULT NULL,
  `titular_familia` varchar(255) DEFAULT NULL,
  `num_centros` tinyint DEFAULT NULL,
  `ult_centro` varchar(255) DEFAULT NULL,
  `dias_centros` smallint DEFAULT NULL,
  `codigo_ayu` varchar(12) DEFAULT NULL,
  `periodo` varchar(20) DEFAULT NULL,
  `financiacion` varchar(40) DEFAULT NULL,
  `fase` varchar(20) DEFAULT NULL,
  `ingresos_mensuales` float(8,2) unsigned DEFAULT NULL,
  `gastos_fijos` float(8,2) unsigned DEFAULT NULL,
  `concepto_ingresos` varchar(50) DEFAULT NULL,
  `tiempo_sistema` tinyint(1) DEFAULT NULL,
  `uc_tit_centro_origen` mediumint DEFAULT NULL,
  `uc_tit_idusuario` mediumint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=275614 DEFAULT CHARSET=latin1;

--
-- Table structure for table `blacklist_becas`
--

CREATE TABLE `blacklist_becas` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `autor` varchar(9) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `motivo` varchar(255) DEFAULT NULL,
  UNIQUE KEY `centro_origen` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `catalogo_actuaciones`
--

CREATE TABLE `catalogo_actuaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_formato` int NOT NULL,
  `bloque` varchar(255) NOT NULL,
  `nom_actuacion` varchar(255) NOT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=406 DEFAULT CHARSET=latin1;

--
-- Table structure for table `cursos`
--

CREATE TABLE `cursos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `id_proyecto` smallint unsigned NOT NULL,
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_tipo` int DEFAULT NULL,
  `id_centro` smallint unsigned DEFAULT NULL,
  `f_ini` date DEFAULT NULL,
  `f_fin` date DEFAULT NULL,
  `expediente` varchar(30) DEFAULT '(sin expediente)',
  `duracion` float unsigned DEFAULT NULL,
  `obs` text,
  `id_tipologia` int DEFAULT NULL,
  `id_especialidad` int DEFAULT NULL,
  `desarrollo_sostenible` float unsigned DEFAULT NULL,
  `igualdad_oportunidades` float unsigned DEFAULT NULL,
  `igualdad_hm` float unsigned DEFAULT NULL,
  `practicas_empresas` float unsigned DEFAULT NULL,
  `modalidad` enum('Presencial','Semipresencial','Online') NOT NULL DEFAULT 'Presencial',
  `formacion_externa` tinyint(1) NOT NULL DEFAULT '0',
  `formacion_subcontratada` tinyint(1) NOT NULL DEFAULT '0',
  `formacion_becada` tinyint(1) NOT NULL DEFAULT '0',
  `controlar_asistencia` tinyint(1) NOT NULL DEFAULT '0',
  `evaluar` tinyint(1) NOT NULL DEFAULT '0',
  `estadisticas` tinyint DEFAULT NULL,
  `requiere_valoracion` tinyint(1) NOT NULL DEFAULT '0',
  `lugar` varchar(255) DEFAULT NULL,
  `con_gasto` tinyint(1) DEFAULT NULL,
  `id_tipoaccion` int DEFAULT NULL,
  `id_objetivo` int DEFAULT NULL,
  `materiales` text,
  `objetivos` text,
  `contenido` text,
  `desarrollo` text,
  `logros` text,
  `dificultades` text,
  `evaluacion` text,
  `obs_valoracion` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx-cursos-unique` (`id_proyecto`,`id_servicio`,`nombre`,`id_especialidad`,`id_tipo`,`id_centro`),
  KEY `idx-cursos-id_centro` (`id_centro`),
  KEY `idx-cursos-id_tipo` (`id_tipo`),
  KEY `idx-cursos-id_servicio` (`id_servicio`),
  KEY `idx-cursos-id_proyecto` (`id_proyecto`),
  KEY `idx-cursos-id_especialidad` (`id_especialidad`),
  CONSTRAINT `fk-cursos-id_centro` FOREIGN KEY (`id_centro`) REFERENCES `usuarios`.`centros` (`id`),
  CONSTRAINT `fk-cursos-id_especialidad` FOREIGN KEY (`id_especialidad`) REFERENCES `li_cursos_especialidades` (`id`),
  CONSTRAINT `fk-cursos-id_proyecto` FOREIGN KEY (`id_proyecto`) REFERENCES `usuarios_cepaim`.`proyectos` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `fk-cursos-id_servicio` FOREIGN KEY (`id_servicio`) REFERENCES `proy_servicios` (`id`),
  CONSTRAINT `fk-cursos-id_tipo` FOREIGN KEY (`id_tipo`) REFERENCES `li_cursos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6676 DEFAULT CHARSET=latin1;

--
-- Table structure for table `derivaciones`
--

CREATE TABLE `derivaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `id_tip_deriv` int NOT NULL,
  `id_motivo` int NOT NULL,
  `id_entidad` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8386 DEFAULT CHARSET=latin1;

--
-- Table structure for table `dv_conceptos`
--

CREATE TABLE `dv_conceptos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `id_var` tinyint unsigned NOT NULL,
  `nombre` varchar(254) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `dv_nom_var`
--

CREATE TABLE `dv_nom_var` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(254) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `dv_registro`
--

CREATE TABLE `dv_registro` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_var` tinyint unsigned NOT NULL,
  `id_concepto` tinyint unsigned NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fecha` (`fecha`,`centro_origen`,`idusuario`,`id_var`,`id_concepto`),
  KEY `id_var_c` (`id_var`),
  KEY `id_concepto_c` (`id_concepto`),
  CONSTRAINT `id_concepto_c` FOREIGN KEY (`id_concepto`) REFERENCES `dv_conceptos` (`id`),
  CONSTRAINT `id_var_c` FOREIGN KEY (`id_var`) REFERENCES `dv_nom_var` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `evaluaciones`
--

CREATE TABLE `evaluaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date DEFAULT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_curso` int NOT NULL,
  `nom_curso` varchar(255) NOT NULL,
  `resultado` varchar(255) DEFAULT NULL,
  `obs` text,
  `obs_inscripcion` text,
  `fecha_inscripcion` datetime DEFAULT NULL,
  `duracion` float unsigned DEFAULT NULL,
  `id_act_insc` int unsigned DEFAULT NULL,
  `id_act_eval` int unsigned DEFAULT NULL,
  `id_centro` smallint unsigned DEFAULT NULL,
  `autor` varchar(9) DEFAULT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `yii2fk-evaluaciones-cursos-id_curso` (`id_curso`),
  KEY `fk-evaluaciones-id_act_insc` (`id_act_insc`),
  KEY `fk-evaluaciones-id_act_eval` (`id_act_eval`),
  KEY `idx-evaluaciones-id_centro` (`id_centro`),
  KEY `id_curso` (`id_curso`),
  CONSTRAINT `fk-evaluaciones-id_act_eval` FOREIGN KEY (`id_act_eval`) REFERENCES `actuaciones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk-evaluaciones-id_act_insc` FOREIGN KEY (`id_act_insc`) REFERENCES `actuaciones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk-evaluaciones-id_centro` FOREIGN KEY (`id_centro`) REFERENCES `usuarios`.`centros` (`id`),
  CONSTRAINT `yii2fk-evaluaciones-cursos-id_curso` FOREIGN KEY (`id_curso`) REFERENCES `cursos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=92942 DEFAULT CHARSET=latin1;

--
-- Table structure for table `formatos_actuaciones`
--

CREATE TABLE `formatos_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `tipo` enum('economica','otro') DEFAULT NULL,
  `tipo2` enum('grupal','individual','ambas') DEFAULT NULL,
  `destinatarios` enum('personas','entidades','proyectos') NOT NULL DEFAULT 'personas',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=latin1;

--
-- Table structure for table `indicadores`
--

CREATE TABLE `indicadores` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL,
  `f_baja` date DEFAULT NULL,
  `f_6meses` date DEFAULT NULL,
  `tipo` enum('entrada','salida','6meses') NOT NULL,
  `nivel_laboral` varchar(200) DEFAULT NULL,
  `propia_ajena` varchar(16) DEFAULT NULL,
  `estudios_ue` varchar(100) DEFAULT NULL,
  `estudios_sh` varchar(100) DEFAULT NULL,
  `estudios_ph` varchar(100) DEFAULT NULL,
  `i1` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i2` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i3` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i4` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i5` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i6` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i7` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i13` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i17` enum('SI','NO','NS/NC') DEFAULT NULL,
  `i_otras` enum('SI','NO','NS/NC') DEFAULT NULL,
  `integrado_form` varchar(5) DEFAULT NULL,
  `cualificacion` varchar(5) DEFAULT NULL,
  `obs` text,
  `mejora_sit_laboral` enum('SI','NO','NS/NC') DEFAULT NULL,
  `conciliacion` enum('SI','NO') DEFAULT NULL,
  `mod_igualdad` enum('SI','NO') DEFAULT NULL,
  `localizar` enum('SI','NO') DEFAULT NULL,
  `i8` enum('SI','NO','NS/NC') DEFAULT NULL,
  `subempleada_a_empleada` enum('SI','NO','NS/NC') DEFAULT NULL,
  `homologacion_estudios` enum('SI','NO','NS/NC') DEFAULT NULL,
  `empoderamiento` enum('SI','NO','NS/NC') DEFAULT NULL,
  `empleabilidad` enum('SI','NO','NS/NC') DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=79010 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_conceptos_actuaciones`
--

CREATE TABLE `li_conceptos_actuaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_proyecto` smallint unsigned NOT NULL,
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_perfil` tinyint unsigned DEFAULT NULL,
  `id_formato` tinyint unsigned NOT NULL,
  `nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `nombre2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_traduccion` int DEFAULT NULL,
  `cod_exp` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `periodo` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `directa` tinyint NOT NULL DEFAULT '1',
  `aviso` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `obs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `cuenta_contable` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `importe_max` float(8,2) unsigned DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  `num_participantes` smallint NOT NULL DEFAULT '0',
  `maximo_exacto` tinyint(1) NOT NULL DEFAULT '1',
  `prorrateable` tinyint(1) NOT NULL DEFAULT '1',
  `solo_tras_fase2` tinyint(1) NOT NULL DEFAULT '0',
  `copago_sanitario` tinyint(1) NOT NULL DEFAULT '0',
  `requiere_autorizacion` tinyint(1) NOT NULL DEFAULT '0',
  `minoracion_rentas` tinyint(1) NOT NULL DEFAULT '0',
  `minoracion_ah` tinyint(1) NOT NULL DEFAULT '0',
  `maximo_itinerario` tinyint(1) NOT NULL DEFAULT '0',
  `no_solapar_fechas` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_proyecto` (`id_proyecto`),
  KEY `id_servicio` (`id_servicio`),
  CONSTRAINT `fkey_proy_servicios_id_servicio` FOREIGN KEY (`id_servicio`) REFERENCES `proy_servicios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=86444 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_cursos`
--

CREATE TABLE `li_cursos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_cursos_especialidades`
--

CREATE TABLE `li_cursos_especialidades` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_tipologia` int NOT NULL,
  `nombre` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk-especialidades-tipologia` (`id_tipologia`),
  CONSTRAINT `fk-especialidades-tipologia` FOREIGN KEY (`id_tipologia`) REFERENCES `li_cursos_tipologias` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_cursos_tipologias`
--

CREATE TABLE `li_cursos_tipologias` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_nivel` int NOT NULL,
  `nombre` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk-tipologias-nivelformativo` (`id_nivel`),
  CONSTRAINT `fk-tipologias-nivelformativo` FOREIGN KEY (`id_nivel`) REFERENCES `li_cursos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_empleado_activo`
--

CREATE TABLE `li_empleado_activo` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_ent_destino`
--

CREATE TABLE `li_ent_destino` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_motivos_dev`
--

CREATE TABLE `li_motivos_dev` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_tip_deriv` int NOT NULL,
  `nombre` varchar(75) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tip_deriv`
--

CREATE TABLE `li_tip_deriv` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(75) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tipo_contrato`
--

CREATE TABLE `li_tipo_contrato` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `listas_nom`
--

CREATE TABLE `listas_nom` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(10) NOT NULL,
  `nombre` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25931 DEFAULT CHARSET=latin1;

--
-- Table structure for table `listas_personas`
--

CREATE TABLE `listas_personas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_lista` int unsigned NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_lista_2` (`id_lista`,`centro_origen`,`idusuario`),
  KEY `id_lista` (`id_lista`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `listas_personas_ibfk_1` FOREIGN KEY (`id_lista`) REFERENCES `listas_nom` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=275982 DEFAULT CHARSET=latin1;

--
-- Table structure for table `multiples_catalogo`
--

CREATE TABLE `multiples_catalogo` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `tabla` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `campo` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `tipo` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `valor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `multiples_valores`
--

CREATE TABLE `multiples_valores` (
  `id_multiple_catalogo` int unsigned NOT NULL,
  `id_tabla` int unsigned NOT NULL,
  PRIMARY KEY (`id_tabla`,`id_multiple_catalogo`),
  KEY `fk-multiples_valores-id_multiple_catalogo` (`id_multiple_catalogo`),
  CONSTRAINT `fk-multiples_valores-id_multiple_catalogo` FOREIGN KEY (`id_multiple_catalogo`) REFERENCES `multiples_catalogo` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `obtencion_empleo`
--

CREATE TABLE `obtencion_empleo` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tipo_obt` enum('Por cuenta propia','Por cuenta ajena') NOT NULL,
  `id_tipo_cont` int DEFAULT NULL,
  `duracion` float DEFAULT NULL,
  `jornada` enum('Parcial','Completa') DEFAULT NULL,
  `horas_sem` float DEFAULT NULL,
  `id_sector_act` tinyint unsigned DEFAULT NULL,
  `primer_empleo` enum('Sí','No') DEFAULT NULL,
  `mejora` enum('Sí','No') DEFAULT NULL,
  `cif_entidad` varchar(9) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7697 DEFAULT CHARSET=latin1;

--
-- Table structure for table `perfil_formatos`
--

CREATE TABLE `perfil_formatos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proy_perfil` int unsigned NOT NULL,
  `id_formato` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19002 DEFAULT CHARSET=latin1;

--
-- Table structure for table `perfil_usu`
--

CREATE TABLE `perfil_usu` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proy_perfil` int unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `horas_sem` double unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_proy_perfil` (`id_proy_perfil`,`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=20647 DEFAULT CHARSET=latin1;

--
-- Table structure for table `perfiles_tecnicos`
--

CREATE TABLE `perfiles_tecnicos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;

--
-- Table structure for table `personas_vulnerables`
--

CREATE TABLE `personas_vulnerables` (
  `id` enum('Mujeres en situación de violencia de género','Personas víctimas de trata con fines de explotación sexual','Mujeres en situación de prostitución','Personas víctimas de discriminación por orientación sexual e identidad de género','Mutilación genital femenina','LGTBI+','Personas sin techo','Personas sin vivienda','Personas con vivienda insegura','Personas con vivienda inadecuada','Personas pertenecientes a una minoría étnica','Personas víctimas de discriminación por origen racial','Personas migrantes','Personas con problemas de salud mental','Personas con problemas de adicción','Personas con enfermedades graves','Personas de avanzada edad','Menores no acompañados','Familias monomarentales/monoparentales con menores a cargo','Familias monomarentales/monoparentales con personas dependientes a cargo','Analfabetismo','Analfabetismo digital','Personas que viven en el medio rural','Personas que sufren de privación material severa','Personas penadas en instituciones penitenciarias o con medidas judiciales','Personas víctimas de trata laboral','Familias con menores con pruebas de ADN negativas','Personas con discapacidad intelectual','Personas con discapacidad física') NOT NULL,
  `centro_origen` tinyint NOT NULL,
  `idusuario` mediumint NOT NULL,
  `fecha` date NOT NULL,
  UNIQUE KEY `no_repetic` (`centro_origen`,`idusuario`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `proy_perfil`
--

CREATE TABLE `proy_perfil` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proy` smallint unsigned NOT NULL,
  `id_perfil` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_proy` (`id_proy`,`id_perfil`)
) ENGINE=InnoDB AUTO_INCREMENT=908 DEFAULT CHARSET=latin1;

--
-- Table structure for table `proy_servicios`
--

CREATE TABLE `proy_servicios` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `id_proy` smallint unsigned DEFAULT NULL,
  `nombre` varchar(100) NOT NULL,
  `fase_pi` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_nombre_proyecto` (`id_proy`,`nombre`),
  CONSTRAINT `fk-proy_servicios-proyectos` FOREIGN KEY (`id_proy`) REFERENCES `usuarios_cepaim`.`proyectos` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=383 DEFAULT CHARSET=latin1;

--
-- Table structure for table `proy_ubic`
--

CREATE TABLE `proy_ubic` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proy` smallint unsigned NOT NULL,
  `id_ubic` smallint unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=443 DEFAULT CHARSET=latin1;

--
-- Table structure for table `seguimiento_curso`
--

CREATE TABLE `seguimiento_curso` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date DEFAULT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_curso` int unsigned NOT NULL,
  `nom_curso` varchar(255) NOT NULL,
  `resultado` varchar(255) DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17673 DEFAULT CHARSET=latin1;

--
-- Table structure for table `sesion_curso`
--

CREATE TABLE `sesion_curso` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha` datetime NOT NULL,
  `obs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `id_curso` int DEFAULT NULL,
  `duracion` float unsigned DEFAULT NULL,
  `id_centro` smallint unsigned DEFAULT NULL,
  `autor` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx-sesion_curso-unique` (`id_curso`,`fecha`,`id_centro`,`autor`,`id_perfil`),
  KEY `idx-sesion_curso-id_centro` (`id_centro`),
  KEY `fk-sesion_curso-id_curso` (`id_curso`),
  CONSTRAINT `fk-sesion_curso-id_centro` FOREIGN KEY (`id_centro`) REFERENCES `usuarios`.`centros` (`id`),
  CONSTRAINT `fk-sesion_curso-id_curso` FOREIGN KEY (`id_curso`) REFERENCES `cursos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=76466 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `tareas`
--

CREATE TABLE `tareas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `hora1` datetime DEFAULT NULL,
  `hora2` datetime DEFAULT NULL,
  `id_concepto` int NOT NULL,
  `concepto` varchar(255) NOT NULL,
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1485297 DEFAULT CHARSET=latin1;

--
-- Table structure for table `tareas_extra`
--

CREATE TABLE `tareas_extra` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `id_tipo` smallint unsigned DEFAULT NULL,
  `tipo` varchar(255) DEFAULT NULL,
  `id_herramienta` smallint unsigned DEFAULT NULL,
  `herramienta` varchar(255) DEFAULT NULL,
  `id_objetivos` int DEFAULT NULL,
  `objetivos` varchar(255) DEFAULT NULL,
  `id_indicadores` int unsigned DEFAULT NULL,
  `indicadores` varchar(255) DEFAULT NULL,
  `objetivo` text,
  `descripcion` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13259 DEFAULT CHARSET=latin1;

--
-- Current Database: `citas`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `citas` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `citas`;

--
-- Table structure for table `phpc_areas`
--

CREATE TABLE `phpc_areas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `area` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;

--
-- Table structure for table `phpc_auth`
--

CREATE TABLE `phpc_auth` (
  `id_area` int NOT NULL DEFAULT '0',
  `nif` char(9) NOT NULL DEFAULT '',
  `esc` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_area`,`nif`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `phpc_events`
--

CREATE TABLE `phpc_events` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `stamp` datetime DEFAULT NULL,
  `duration` datetime DEFAULT NULL,
  `eventtype` int DEFAULT NULL,
  `tecnico` varchar(255) DEFAULT NULL,
  `description` blob,
  `id_area` varchar(255) DEFAULT NULL,
  `centro` int NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `benef` varchar(255) DEFAULT NULL,
  `asiste` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=211043 DEFAULT CHARSET=latin1;

--
-- Current Database: `contactos`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `contactos` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `contactos`;

--
-- Table structure for table `05647869N`
--

CREATE TABLE `05647869N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `05663438X`
--

CREATE TABLE `05663438X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `05668848S`
--

CREATE TABLE `05668848S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `05915308F`
--

CREATE TABLE `05915308F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `06262847Q`
--

CREATE TABLE `06262847Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `07232630G`
--

CREATE TABLE `07232630G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `07846869M`
--

CREATE TABLE `07846869M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `07975255M`
--

CREATE TABLE `07975255M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `08812263C`
--

CREATE TABLE `08812263C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `08869328E`
--

CREATE TABLE `08869328E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `09175191P`
--

CREATE TABLE `09175191P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `09205620P`
--

CREATE TABLE `09205620P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `09206959J`
--

CREATE TABLE `09206959J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `09318228P`
--

CREATE TABLE `09318228P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `11811344Q`
--

CREATE TABLE `11811344Q` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `15439351A`
--

CREATE TABLE `15439351A` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `18053575R`
--

CREATE TABLE `18053575R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `18054025Z`
--

CREATE TABLE `18054025Z` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `18113439L`
--

CREATE TABLE `18113439L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `18457170S`
--

CREATE TABLE `18457170S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `18457314K`
--

CREATE TABLE `18457314K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `19003841E`
--

CREATE TABLE `19003841E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `20085781L`
--

CREATE TABLE `20085781L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `20156614N`
--

CREATE TABLE `20156614N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `20235777D`
--

CREATE TABLE `20235777D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `20442194R`
--

CREATE TABLE `20442194R` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `20855640E`
--

CREATE TABLE `20855640E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `21685664E`
--

CREATE TABLE `21685664E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `21686108Y`
--

CREATE TABLE `21686108Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `21689351Y`
--

CREATE TABLE `21689351Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `22587073S`
--

CREATE TABLE `22587073S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `22990199C`
--

CREATE TABLE `22990199C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23012787E`
--

CREATE TABLE `23012787E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23014201X`
--

CREATE TABLE `23014201X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23015211P`
--

CREATE TABLE `23015211P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23039204N`
--

CREATE TABLE `23039204N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23040165F`
--

CREATE TABLE `23040165F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23052299C`
--

CREATE TABLE `23052299C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23052626W`
--

CREATE TABLE `23052626W` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23222329B`
--

CREATE TABLE `23222329B` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `23239016T`
--

CREATE TABLE `23239016T` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23270474V`
--

CREATE TABLE `23270474V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23283274Y`
--

CREATE TABLE `23283274Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23283820T`
--

CREATE TABLE `23283820T` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23286127F`
--

CREATE TABLE `23286127F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23292105M`
--

CREATE TABLE `23292105M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23299843S`
--

CREATE TABLE `23299843S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `23955840Y`
--

CREATE TABLE `23955840Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `24288957Z`
--

CREATE TABLE `24288957Z` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `24357938H`
--

CREATE TABLE `24357938H` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `24368307Z`
--

CREATE TABLE `24368307Z` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `24424123D`
--

CREATE TABLE `24424123D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `25415965E`
--

CREATE TABLE `25415965E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `25604589T`
--

CREATE TABLE `25604589T` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `25994643C`
--

CREATE TABLE `25994643C` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `26002474P`
--

CREATE TABLE `26002474P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `26498414E`
--

CREATE TABLE `26498414E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `26502030G`
--

CREATE TABLE `26502030G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `26502641V`
--

CREATE TABLE `26502641V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `26764112R`
--

CREATE TABLE `26764112R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `27323408Y`
--

CREATE TABLE `27323408Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `27461331K`
--

CREATE TABLE `27461331K` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `28616367C`
--

CREATE TABLE `28616367C` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `29049594L`
--

CREATE TABLE `29049594L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `29065561R`
--

CREATE TABLE `29065561R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `30806773K`
--

CREATE TABLE `30806773K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `34791929J`
--

CREATE TABLE `34791929J` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `34803082B`
--

CREATE TABLE `34803082B` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `34812601P`
--

CREATE TABLE `34812601P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `39487214D`
--

CREATE TABLE `39487214D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `41590423Y`
--

CREATE TABLE `41590423Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `42316091R`
--

CREATE TABLE `42316091R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `43628825X`
--

CREATE TABLE `43628825X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `43636509N`
--

CREATE TABLE `43636509N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `44059865F`
--

CREATE TABLE `44059865F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `44212183L`
--

CREATE TABLE `44212183L` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `44221512X`
--

CREATE TABLE `44221512X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `44407664T`
--

CREATE TABLE `44407664T` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `44411018L`
--

CREATE TABLE `44411018L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `44527276N`
--

CREATE TABLE `44527276N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `45101313S`
--

CREATE TABLE `45101313S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `45306422X`
--

CREATE TABLE `45306422X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `45486906J`
--

CREATE TABLE `45486906J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `45602878L`
--

CREATE TABLE `45602878L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `46848198G`
--

CREATE TABLE `46848198G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `47225505L`
--

CREATE TABLE `47225505L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `47464319R`
--

CREATE TABLE `47464319R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `47801714D`
--

CREATE TABLE `47801714D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48344796S`
--

CREATE TABLE `48344796S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48398690C`
--

CREATE TABLE `48398690C` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `48402854K`
--

CREATE TABLE `48402854K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48404552V`
--

CREATE TABLE `48404552V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48423277C`
--

CREATE TABLE `48423277C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48434359Q`
--

CREATE TABLE `48434359Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48434479K`
--

CREATE TABLE `48434479K` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `48491492V`
--

CREATE TABLE `48491492V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48495579X`
--

CREATE TABLE `48495579X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48497782M`
--

CREATE TABLE `48497782M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48499783M`
--

CREATE TABLE `48499783M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48501699N`
--

CREATE TABLE `48501699N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48512579J`
--

CREATE TABLE `48512579J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48513076G`
--

CREATE TABLE `48513076G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48513962Q`
--

CREATE TABLE `48513962Q` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `48517287Y`
--

CREATE TABLE `48517287Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48545541Q`
--

CREATE TABLE `48545541Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48548171R`
--

CREATE TABLE `48548171R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48602421V`
--

CREATE TABLE `48602421V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48612572W`
--

CREATE TABLE `48612572W` (
  `id` mediumint unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `48613406P`
--

CREATE TABLE `48613406P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48615471A`
--

CREATE TABLE `48615471A` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48615951T`
--

CREATE TABLE `48615951T` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48620769B`
--

CREATE TABLE `48620769B` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48635207M`
--

CREATE TABLE `48635207M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48648261H`
--

CREATE TABLE `48648261H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48648666D`
--

CREATE TABLE `48648666D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48650933E`
--

CREATE TABLE `48650933E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48653866B`
--

CREATE TABLE `48653866B` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48654935E`
--

CREATE TABLE `48654935E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48658391M`
--

CREATE TABLE `48658391M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48742857S`
--

CREATE TABLE `48742857S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48803340P`
--

CREATE TABLE `48803340P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48940655J`
--

CREATE TABLE `48940655J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `48951212J`
--

CREATE TABLE `48951212J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `49448481E`
--

CREATE TABLE `49448481E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `50113856F`
--

CREATE TABLE `50113856F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `50187163J`
--

CREATE TABLE `50187163J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `50381753T`
--

CREATE TABLE `50381753T` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `50515675Q`
--

CREATE TABLE `50515675Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `51465211C`
--

CREATE TABLE `51465211C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `51719752C`
--

CREATE TABLE `51719752C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `52696235S`
--

CREATE TABLE `52696235S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `52755736S`
--

CREATE TABLE `52755736S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `52809954E`
--

CREATE TABLE `52809954E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `52828514K`
--

CREATE TABLE `52828514K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `53013938L`
--

CREATE TABLE `53013938L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `53018135F`
--

CREATE TABLE `53018135F` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `53250679K`
--

CREATE TABLE `53250679K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `53312697P`
--

CREATE TABLE `53312697P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `53353115S`
--

CREATE TABLE `53353115S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `70072368Q`
--

CREATE TABLE `70072368Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `70808914X`
--

CREATE TABLE `70808914X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `70865907D`
--

CREATE TABLE `70865907D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `70887811V`
--

CREATE TABLE `70887811V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `70909133H`
--

CREATE TABLE `70909133H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71080242F`
--

CREATE TABLE `71080242F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71122314N`
--

CREATE TABLE `71122314N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71163756P`
--

CREATE TABLE `71163756P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71165978E`
--

CREATE TABLE `71165978E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71284629Q`
--

CREATE TABLE `71284629Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71287111Z`
--

CREATE TABLE `71287111Z` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71345197W`
--

CREATE TABLE `71345197W` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `71555828E`
--

CREATE TABLE `71555828E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `72503093D`
--

CREATE TABLE `72503093D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `72881416M`
--

CREATE TABLE `72881416M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `72889050A`
--

CREATE TABLE `72889050A` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `72891212A`
--

CREATE TABLE `72891212A` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `72893435H`
--

CREATE TABLE `72893435H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `73210956R`
--

CREATE TABLE `73210956R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `73414244S`
--

CREATE TABLE `73414244S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `73566497P`
--

CREATE TABLE `73566497P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `73778189P`
--

CREATE TABLE `73778189P` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `74011213L`
--

CREATE TABLE `74011213L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `74022778S`
--

CREATE TABLE `74022778S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `74025915R`
--

CREATE TABLE `74025915R` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `75145825H`
--

CREATE TABLE `75145825H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `75236633E`
--

CREATE TABLE `75236633E` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `75250795Q`
--

CREATE TABLE `75250795Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `75257297D`
--

CREATE TABLE `75257297D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `75715319D`
--

CREATE TABLE `75715319D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `75886412M`
--

CREATE TABLE `75886412M` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `75898728Q`
--

CREATE TABLE `75898728Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `76124353B`
--

CREATE TABLE `76124353B` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `76128599W`
--

CREATE TABLE `76128599W` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `76132526L`
--

CREATE TABLE `76132526L` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `76255657P`
--

CREATE TABLE `76255657P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77108107D`
--

CREATE TABLE `77108107D` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `77303590S`
--

CREATE TABLE `77303590S` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77439554A`
--

CREATE TABLE `77439554A` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77448200R`
--

CREATE TABLE `77448200R` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `77571419D`
--

CREATE TABLE `77571419D` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77708011G`
--

CREATE TABLE `77708011G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77712344J`
--

CREATE TABLE `77712344J` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `77723589B`
--

CREATE TABLE `77723589B` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `80080266Q`
--

CREATE TABLE `80080266Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X1346806H`
--

CREATE TABLE `X1346806H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X1925150G`
--

CREATE TABLE `X1925150G` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `X2996314N`
--

CREATE TABLE `X2996314N` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `X4079121W`
--

CREATE TABLE `X4079121W` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X4333024P`
--

CREATE TABLE `X4333024P` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X4367663D`
--

CREATE TABLE `X4367663D` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `X4594030X`
--

CREATE TABLE `X4594030X` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `X4896804N`
--

CREATE TABLE `X4896804N` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X5904716H`
--

CREATE TABLE `X5904716H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X5911444F`
--

CREATE TABLE `X5911444F` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X6533465Q`
--

CREATE TABLE `X6533465Q` (
  `id` varchar(9) NOT NULL,
  `lista` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `X6703245X`
--

CREATE TABLE `X6703245X` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X7796372Q`
--

CREATE TABLE `X7796372Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X9105745E`
--

CREATE TABLE `X9105745E` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X9179547V`
--

CREATE TABLE `X9179547V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `X9846709H`
--

CREATE TABLE `X9846709H` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y0717751G`
--

CREATE TABLE `Y0717751G` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y1989330M`
--

CREATE TABLE `Y1989330M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y3721636C`
--

CREATE TABLE `Y3721636C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y4802195Q`
--

CREATE TABLE `Y4802195Q` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y5690422Y`
--

CREATE TABLE `Y5690422Y` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y6320679V`
--

CREATE TABLE `Y6320679V` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y6426965C`
--

CREATE TABLE `Y6426965C` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y7898437K`
--

CREATE TABLE `Y7898437K` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `Y8152985M`
--

CREATE TABLE `Y8152985M` (
  `id` varchar(9) DEFAULT NULL,
  `lista` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `anotaciones`
--

CREATE TABLE `anotaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_contacto` mediumint unsigned NOT NULL,
  `obs` text,
  `nif` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=137 DEFAULT CHARSET=latin1;

--
-- Table structure for table `contactos`
--

CREATE TABLE `contactos` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `entidad` varchar(255) DEFAULT NULL,
  `tratamiento` varchar(50) DEFAULT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  `apellidos` varchar(255) NOT NULL,
  `cargo` varchar(255) DEFAULT NULL,
  `centro_origen_empresa` int DEFAULT NULL,
  `id_empresa` int DEFAULT NULL,
  `id_alta` varchar(255) DEFAULT NULL,
  `direcc` varchar(255) DEFAULT NULL,
  `cp` char(5) DEFAULT NULL,
  `ciudad` varchar(255) DEFAULT NULL,
  `id_pais` tinyint unsigned NOT NULL,
  `id_prov` tinyint unsigned DEFAULT NULL,
  `tlf` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `web` varchar(255) DEFAULT NULL,
  `obs` varchar(255) DEFAULT NULL,
  `actualizado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `tipo` enum('estatal','autonomico','local') DEFAULT NULL,
  `tipo_detalle` tinyint unsigned DEFAULT NULL,
  `ultimo_modificador` varchar(9) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1437 DEFAULT CHARSET=latin1;

--
-- Table structure for table `contactos_entidades`
--

CREATE TABLE `contactos_entidades` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `centro` smallint unsigned NOT NULL,
  `tratamiento` varchar(50) DEFAULT NULL,
  `nombre` varchar(255) DEFAULT NULL,
  `apellidos` varchar(255) DEFAULT NULL,
  `cargo` varchar(255) DEFAULT NULL,
  `direcc` varchar(255) DEFAULT NULL,
  `cp` char(5) DEFAULT NULL,
  `ciudad` varchar(255) DEFAULT NULL,
  `id_pais` tinyint unsigned NOT NULL DEFAULT '67',
  `id_prov` varchar(3) DEFAULT NULL,
  `tlf` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `obs` text,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `f_alta` date NOT NULL,
  `creador` varchar(9) NOT NULL,
  `actualizado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ultimo_modificador` varchar(9) NOT NULL DEFAULT '',
  `estadist` varchar(1) DEFAULT NULL,
  `firmante` tinyint(1) NOT NULL DEFAULT '0',
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk-contactos-entidades` (`id_entidad`)
) ENGINE=MyISAM AUTO_INCREMENT=13576 DEFAULT CHARSET=latin1;

--
-- Table structure for table `fichero_preferido`
--

CREATE TABLE `fichero_preferido` (
  `nif` char(10) NOT NULL DEFAULT '',
  `tipo` enum('estatal','autonomico','local') NOT NULL,
  `tipo_detalle` smallint unsigned DEFAULT NULL,
  PRIMARY KEY (`nif`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `privilegios`
--

CREATE TABLE `privilegios` (
  `nif` char(10) NOT NULL DEFAULT '',
  `tipo` enum('estatal','autonomico','local') NOT NULL,
  `tipo_detalle` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`nif`,`tipo`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

--
-- Table structure for table `tags_assoc`
--

CREATE TABLE `tags_assoc` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_contacto` int DEFAULT NULL,
  `id_tag` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tag` (`id_tag`),
  CONSTRAINT `tags_assoc_ibfk_1` FOREIGN KEY (`id_tag`) REFERENCES `tags` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1709 DEFAULT CHARSET=latin1;

--
-- Current Database: `directorio`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `directorio` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `directorio`;

--
-- Table structure for table `personal_bembea`
--

CREATE TABLE `personal_bembea` (
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `ubicacion` varchar(50) DEFAULT NULL,
  `tlf` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `puesto` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`nombre`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `personal_nexos`
--

CREATE TABLE `personal_nexos` (
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `ubicacion` varchar(50) DEFAULT NULL,
  `tlf` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `puesto` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`nombre`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Current Database: `documentos`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `documentos` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `documentos`;

--
-- Table structure for table `docs`
--

CREATE TABLE `docs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `directorio` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=107 DEFAULT CHARSET=latin1;

--
-- Table structure for table `usu_docs`
--

CREATE TABLE `usu_docs` (
  `docs_id` int NOT NULL DEFAULT '0',
  `nif` char(10) NOT NULL DEFAULT '',
  `escritura` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`docs_id`,`nif`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Current Database: `empresas`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `empresas` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `empresas`;

--
-- Table structure for table `act_form_emp`
--

CREATE TABLE `act_form_emp` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_act_form` int unsigned NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `participantes` int unsigned NOT NULL,
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_act_form` (`id_act_form`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `act_form_emp_ibfk_1` FOREIGN KEY (`id_act_form`) REFERENCES `act_formativas` (`id`),
  CONSTRAINT `act_form_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=178 DEFAULT CHARSET=latin1;

--
-- Table structure for table `act_formativas`
--

CREATE TABLE `act_formativas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nombre` varchar(255) NOT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `participantes` int unsigned DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  CONSTRAINT `act_formativas_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_formacion` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=latin1;

--
-- Table structure for table `actividades_int`
--

CREATE TABLE `actividades_int` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `f_inicio` date NOT NULL DEFAULT '0000-00-00',
  `f_fin` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `participantes` int unsigned NOT NULL,
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `act_int_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE,
  CONSTRAINT `actividades_int_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_actividades_int` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=latin1;

--
-- Table structure for table `actuaciones`
--

CREATE TABLE `actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_proyecto` smallint unsigned NOT NULL DEFAULT '0',
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_perfil` tinyint unsigned NOT NULL DEFAULT '0',
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `id_centro` smallint unsigned NOT NULL DEFAULT '0',
  `fecha1` datetime NOT NULL,
  `fecha2` datetime DEFAULT NULL,
  `duracion` float unsigned DEFAULT NULL,
  `obs` text,
  `autor` varchar(9) NOT NULL,
  `edic` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `fecha_certificacion` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_formato` (`id_formato`,`id_complementaria`),
  KEY `id_proyecto` (`id_proyecto`),
  KEY `fecha1` (`fecha1`)
) ENGINE=InnoDB AUTO_INCREMENT=28489 DEFAULT CHARSET=latin1;

--
-- Table structure for table `actuaciones_destinat`
--

CREATE TABLE `actuaciones_destinat` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_actuacion` int unsigned NOT NULL,
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  KEY `fk-act-dest-entidades` (`id_entidad`),
  CONSTRAINT `actuaciones_destinat_ibfk_1` FOREIGN KEY (`id_entidad`) REFERENCES `usuarios_cepaim`.`entidades` (`id`),
  CONSTRAINT `borrado_cascada` FOREIGN KEY (`id_actuacion`) REFERENCES `actuaciones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=32423 DEFAULT CHARSET=latin1;

--
-- Table structure for table `asesoria`
--

CREATE TABLE `asesoria` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `f_inicio` date NOT NULL DEFAULT '0000-00-00',
  `f_fin` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `asesoria_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE,
  CONSTRAINT `asesoria_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_asesoria` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=238 DEFAULT CHARSET=latin1;

--
-- Table structure for table `contratos_ent`
--

CREATE TABLE `contratos_ent` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fec_firma` datetime NOT NULL,
  `id_tipo` tinyint NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `descripcion` text,
  `t_datos_proveedores` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=535 DEFAULT CHARSET=latin1;

--
-- Table structure for table `convenios`
--

CREATE TABLE `convenios` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `f_inicio` date NOT NULL DEFAULT '0000-00-00',
  `f_fin` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `convenios_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE,
  CONSTRAINT `convenios_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_convenios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=487 DEFAULT CHARSET=latin1;

--
-- Table structure for table `convenios_ent`
--

CREATE TABLE `convenios_ent` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fec_firma` datetime NOT NULL,
  `id_tipo` tinyint NOT NULL,
  `titulo` varchar(255) NOT NULL,
  `descripcion` text,
  `responsable` varchar(9) NOT NULL,
  `estatal` tinyint(1) NOT NULL,
  `subvencion` tinyint(1) NOT NULL,
  `renovable` tinyint(1) NOT NULL,
  `t_datos_proveedores` tinyint(1) NOT NULL,
  `firma_convenio` int unsigned NOT NULL,
  `adenda` tinyint(1) NOT NULL,
  `tipo_adenda` int unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=576 DEFAULT CHARSET=latin1;

--
-- Table structure for table `convenios_ent_proys_adenda`
--

CREATE TABLE `convenios_ent_proys_adenda` (
  `id_convenio` int NOT NULL,
  `id_proy` smallint NOT NULL,
  PRIMARY KEY (`id_convenio`,`id_proy`),
  CONSTRAINT `convenios_ent_proys_adenda_ibfk_1` FOREIGN KEY (`id_convenio`) REFERENCES `convenios_ent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `convenios_ent_proys_vinculados`
--

CREATE TABLE `convenios_ent_proys_vinculados` (
  `id_convenio` int NOT NULL,
  `id_proy` smallint NOT NULL,
  PRIMARY KEY (`id_convenio`,`id_proy`),
  CONSTRAINT `convenios_ent_proys_vinculados_ibfk_1` FOREIGN KEY (`id_convenio`) REFERENCES `convenios_ent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `encuentros`
--

CREATE TABLE `encuentros` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nombre` varchar(255) NOT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `participantes` int unsigned DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  CONSTRAINT `encuentros_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_encuentros` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=latin1;

--
-- Table structure for table `encuentros_emp`
--

CREATE TABLE `encuentros_emp` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_encuentros` int unsigned NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `participantes` int unsigned NOT NULL,
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_encuentros` (`id_encuentros`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `encuentros_emp_ibfk_1` FOREIGN KEY (`id_encuentros`) REFERENCES `encuentros` (`id`),
  CONSTRAINT `encuentros_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=362 DEFAULT CHARSET=latin1;

--
-- Table structure for table `entrevistas`
--

CREATE TABLE `entrevistas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  `nif` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `entrevistas_i_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `usuarios_cepaim`.`empresas` (`centro_origen`, `id`) ON DELETE CASCADE,
  CONSTRAINT `entrevistas_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_entrevistas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14347 DEFAULT CHARSET=latin1;

--
-- Table structure for table `indicadores`
--

CREATE TABLE `indicadores` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `f_6meses` date DEFAULT NULL,
  `tipo` enum('entrada','salida','6meses','seguimiento') NOT NULL,
  `trabajadores` varchar(100) DEFAULT NULL,
  `EO02` enum('SI','NO','NS/NC') DEFAULT NULL,
  `EO04` enum('SI','NO','NS/NC') DEFAULT NULL,
  `EO05` enum('SI','NO','NS/NC') DEFAULT NULL,
  `ER2` enum('SI','NO','NS/NC','') DEFAULT NULL,
  `EO06` enum('SI','NO','NS/NC') DEFAULT NULL,
  `buena_practica` enum('SI','NO','NS/NC') DEFAULT NULL,
  `ER4` enum('SI','NO','NS/NC','') DEFAULT NULL,
  `ER5` enum('SI','NO','NS/NC','') DEFAULT NULL,
  `ER06` enum('SI','NO','NS/NC') DEFAULT NULL,
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1527 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_actividades_int`
--

CREATE TABLE `li_actividades_int` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_asesoria`
--

CREATE TABLE `li_asesoria` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_contratos`
--

CREATE TABLE `li_contratos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_convenios`
--

CREATE TABLE `li_convenios` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_convenios_firma_convenio`
--

CREATE TABLE `li_convenios_firma_convenio` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_convenios_tipo_adenda`
--

CREATE TABLE `li_convenios_tipo_adenda` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_encuentros`
--

CREATE TABLE `li_encuentros` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_entrevistas`
--

CREATE TABLE `li_entrevistas` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_formacion`
--

CREATE TABLE `li_formacion` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `listas_entidades`
--

CREATE TABLE `listas_entidades` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_lista` int unsigned NOT NULL DEFAULT '0',
  `id_entidad` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key_id_lista_entidad` (`id_lista`,`id_entidad`),
  KEY `id_lista` (`id_lista`),
  KEY `fk-lista-entidades-entidades` (`id_entidad`),
  CONSTRAINT `listas_entidades_ibfk_1` FOREIGN KEY (`id_entidad`) REFERENCES `usuarios_cepaim`.`entidades` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1399 DEFAULT CHARSET=latin1;

--
-- Table structure for table `listas_nom`
--

CREATE TABLE `listas_nom` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(9) NOT NULL,
  `nombre` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=460 DEFAULT CHARSET=latin1;

--
-- Table structure for table `otras_activ`
--

CREATE TABLE `otras_activ` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `f_inicio` date DEFAULT NULL,
  `f_fin` date DEFAULT NULL,
  `inicemp` binary(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`)
) ENGINE=InnoDB AUTO_INCREMENT=533 DEFAULT CHARSET=latin1;

--
-- Table structure for table `tareas`
--

CREATE TABLE `tareas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora1` datetime DEFAULT NULL,
  `hora2` datetime DEFAULT NULL,
  `id_concepto` int unsigned NOT NULL,
  `concepto` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20606 DEFAULT CHARSET=latin1;

--
-- Current Database: `familias`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `familias` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `familias`;

--
-- Table structure for table `acciones_gru`
--

CREATE TABLE `acciones_gru` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `idfamilia` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL,
  `proyecto` int unsigned DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  CONSTRAINT `acciones_gru_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_acciones_gru` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6768 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acciones_ind`
--

CREATE TABLE `acciones_ind` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL,
  `duracion` smallint unsigned NOT NULL,
  `obs` text,
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  `proyecto` smallint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  CONSTRAINT `acciones_ind_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_acciones_ind` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14643 DEFAULT CHARSET=latin1;

--
-- Table structure for table `autoempleo`
--

CREATE TABLE `autoempleo` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` varchar(3) NOT NULL,
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint DEFAULT NULL,
  `derivacion` char(1) DEFAULT 'N',
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ayudas_eco`
--

CREATE TABLE `ayudas_eco` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `cuantia` float(8,2) NOT NULL,
  `concepto` varchar(80) NOT NULL,
  `tipo_ayuda` char(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1489 DEFAULT CHARSET=latin1;

--
-- Table structure for table `cif_municipios_csv`
--

CREATE TABLE `cif_municipios_csv` (
  `CDAD` varchar(1024) DEFAULT NULL,
  `PROV` varchar(1024) DEFAULT NULL,
  `CORP` varchar(1024) DEFAULT NULL,
  `TIPO1` varchar(1024) DEFAULT NULL,
  `TIPO2` varchar(1024) DEFAULT NULL,
  `TIPO3` varchar(1024) DEFAULT NULL,
  `NOMBRE` varchar(1024) DEFAULT NULL,
  `cif` varchar(1024) DEFAULT NULL,
  `CCAA` varchar(1024) DEFAULT NULL,
  `PROVINCIA` varchar(1024) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `deriv_cep`
--

CREATE TABLE `deriv_cep` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  CONSTRAINT `deriv_cep_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_deriv_cep` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=744 DEFAULT CHARSET=latin1;

--
-- Table structure for table `deriv_i3l`
--

CREATE TABLE `deriv_i3l` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_entidad` char(8) NOT NULL DEFAULT '',
  `tipo_motivo` char(2) NOT NULL,
  `id_prov` char(2) NOT NULL,
  `id_loc` char(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `form_ocup`
--

CREATE TABLE `form_ocup` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `id_sector_act` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `practicas` smallint unsigned NOT NULL DEFAULT '0',
  `mod_ma` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_si` tinyint unsigned NOT NULL DEFAULT '0',
  `cuantia` varchar(6) DEFAULT NULL,
  `concepto` varchar(80) DEFAULT NULL,
  `otros` varchar(80) DEFAULT NULL,
  `fin_formacion` date DEFAULT NULL,
  `mod_ig` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_lab` tinyint unsigned NOT NULL DEFAULT '0',
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  `id_curso` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `fk_id_curso` (`id_curso`),
  CONSTRAINT `fk_id_curso` FOREIGN KEY (`id_curso`) REFERENCES `i3l`.`curso` (`id`),
  CONSTRAINT `form_ocup_ibfk_1` FOREIGN KEY (`id_sector_act`) REFERENCES `usuarios_cepaim`.`sectores_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1110 DEFAULT CHARSET=latin1;

--
-- Table structure for table `formacion`
--

CREATE TABLE `formacion` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `f_fin` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL,
  `duracion` smallint unsigned NOT NULL,
  `obs` text,
  `derivacion` char(1) DEFAULT 'N',
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  `proyecto` smallint DEFAULT NULL,
  `id_curso` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cursos_preformacion` (`idusuario`,`centro_origen`,`id_curso`,`proyecto`),
  KEY `id_tipo` (`id_tipo`),
  KEY `fk_id_curso3` (`id_curso`),
  CONSTRAINT `fk_id_curso3` FOREIGN KEY (`id_curso`) REFERENCES `i3l`.`prefor` (`id`),
  CONSTRAINT `formacion_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_formacion` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3994 DEFAULT CHARSET=latin1;

--
-- Table structure for table `hist_social`
--

CREATE TABLE `hist_social` (
  `idfamilia` mediumint unsigned NOT NULL DEFAULT '0',
  `d1` text,
  `d2` text,
  `d3` text,
  `d4` text,
  `d5` text,
  `d6` text,
  `d7` text,
  `d8` text,
  `d9` text,
  `d10` text,
  PRIMARY KEY (`idfamilia`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `insercion`
--

CREATE TABLE `insercion` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` int DEFAULT NULL,
  `idusuario` int DEFAULT NULL,
  `tipo` char(2) NOT NULL,
  `duracion` char(2) DEFAULT NULL,
  `empresa_sector` char(1) DEFAULT NULL,
  `subsector` char(3) NOT NULL,
  `modalidad` char(1) NOT NULL,
  `motivo` char(1) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `fin` date DEFAULT NULL,
  `comentario` char(100) DEFAULT NULL,
  `autoempleo` char(1) DEFAULT NULL,
  `rel_form` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=325 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_acciones_gru`
--

CREATE TABLE `li_acciones_gru` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `id_i3l` char(2) DEFAULT NULL,
  `proyecto` int unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_acciones_ind`
--

CREATE TABLE `li_acciones_ind` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  `id_i3l` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_deriv_cep`
--

CREATE TABLE `li_deriv_cep` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_formacion`
--

CREATE TABLE `li_formacion` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  `id_i3l` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `mun_seguim`
--

CREATE TABLE `mun_seguim` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_municipio` int unsigned NOT NULL,
  `fecha` date NOT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `id_municipio` (`id_municipio`),
  CONSTRAINT `mun_seguim_ibfk_1` FOREIGN KEY (`id_municipio`) REFERENCES `municipios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4564 DEFAULT CHARSET=latin1;

--
-- Table structure for table `municipios`
--

CREATE TABLE `municipios` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `old_cif` varchar(9) DEFAULT NULL,
  `prov_mun` char(6) DEFAULT NULL,
  `num_habitantes` mediumint unsigned DEFAULT NULL,
  `superficie` smallint unsigned DEFAULT NULL,
  `comarca` varchar(100) DEFAULT NULL,
  `familias_inm` mediumint unsigned DEFAULT '0',
  `firma_convenio` date DEFAULT NULL,
  `firma_convenio_obs` varchar(255) DEFAULT NULL,
  `contacto` varchar(255) DEFAULT NULL,
  `contacto_tlf` varchar(100) DEFAULT NULL,
  `contacto_email` varchar(100) DEFAULT NULL,
  `contacto_direcc` text,
  `s1` tinyint(1) DEFAULT '0',
  `s1obs` varchar(255) DEFAULT NULL,
  `s2` tinyint(1) DEFAULT '0',
  `s2obs` varchar(255) DEFAULT NULL,
  `s3` tinyint(1) DEFAULT '0',
  `s3obs` varchar(255) DEFAULT NULL,
  `s4` tinyint(1) DEFAULT '0',
  `s4obs` varchar(255) DEFAULT NULL,
  `s5` tinyint(1) DEFAULT '0',
  `s5obs` varchar(255) DEFAULT NULL,
  `s6` tinyint(1) DEFAULT '0',
  `s6obs` varchar(255) DEFAULT NULL,
  `s7` tinyint(1) DEFAULT '0',
  `s7obs` varchar(255) DEFAULT NULL,
  `s8` tinyint(1) DEFAULT '0',
  `s8obs` varchar(255) DEFAULT NULL,
  `s9` tinyint(1) DEFAULT '0',
  `s9obs` varchar(255) DEFAULT NULL,
  `s10` tinyint(1) DEFAULT '0',
  `s10obs` varchar(255) DEFAULT NULL,
  `s11` tinyint(1) DEFAULT '0',
  `s11obs` varchar(255) DEFAULT NULL,
  `s12` tinyint(1) DEFAULT '0',
  `s12obs` varchar(255) DEFAULT NULL,
  `valoracion` text,
  `f_alta` date DEFAULT NULL,
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` date DEFAULT NULL,
  `modificador` varchar(9) NOT NULL DEFAULT '',
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1100 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ns_demandas`
--

CREATE TABLE `ns_demandas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `idfamilia` mediumint unsigned NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `carnet` tinyint(1) DEFAULT '0',
  `coche` tinyint(1) DEFAULT '0',
  `perfil` varchar(255) NOT NULL,
  `num_hijos` tinyint DEFAULT '0',
  `obs` text,
  `fecha_ins` date DEFAULT NULL,
  `caducad` tinyint(1) DEFAULT '0',
  `id_oferta` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_oferta` (`id_oferta`),
  CONSTRAINT `ns_demandas_ibfk_1` FOREIGN KEY (`id_oferta`) REFERENCES `ofertas_munic` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2830 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ns_seguimiento`
--

CREATE TABLE `ns_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `idfamilia` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `proyecto` int unsigned DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7101 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ofertas_munic`
--

CREATE TABLE `ofertas_munic` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_municipio` int unsigned NOT NULL,
  `prov_mun` char(6) DEFAULT NULL,
  `fecha` date NOT NULL,
  `nombre` varchar(100) NOT NULL,
  `cancelada` tinyint(1) NOT NULL DEFAULT '0',
  `tipo` varchar(20) DEFAULT NULL,
  `superficie` smallint unsigned DEFAULT NULL,
  `habitaciones` tinyint unsigned DEFAULT NULL,
  `modo` varchar(20) DEFAULT NULL,
  `mensualidad` float(8,2) unsigned NOT NULL,
  `condiciones` varchar(255) DEFAULT NULL,
  `puesto` varchar(255) NOT NULL,
  `salario` float(8,2) unsigned NOT NULL,
  `duracion_cont` tinyint unsigned DEFAULT NULL,
  `modalidad_cont` tinyint unsigned DEFAULT NULL,
  `num_hijos` tinyint DEFAULT '0',
  `carnet_conducir` tinyint(1) DEFAULT NULL,
  `coche_propio` tinyint(1) DEFAULT NULL,
  `discapacidad` tinyint(1) DEFAULT NULL,
  `exclusion_social` tinyint(1) DEFAULT NULL,
  `s1` tinyint(1) DEFAULT '0',
  `s1obs` varchar(255) DEFAULT NULL,
  `s2` tinyint(1) DEFAULT '0',
  `s2obs` varchar(255) DEFAULT NULL,
  `s3` tinyint(1) DEFAULT '0',
  `s3obs` varchar(255) DEFAULT NULL,
  `s4` tinyint(1) DEFAULT '0',
  `s4obs` varchar(255) DEFAULT NULL,
  `s5` tinyint(1) DEFAULT '0',
  `s5obs` varchar(255) DEFAULT NULL,
  `s6` tinyint(1) DEFAULT '0',
  `s6obs` varchar(255) DEFAULT NULL,
  `obs` text,
  `nif_tecnico` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_municipio` (`id_municipio`),
  CONSTRAINT `ofertas_munic_ibfk_1` FOREIGN KEY (`id_municipio`) REFERENCES `municipios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1100 DEFAULT CHARSET=latin1;

--
-- Table structure for table `seguimiento_i3l`
--

CREATE TABLE `seguimiento_i3l` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `seguimiento_6` char(2) DEFAULT NULL,
  `motivo_seg` char(2) DEFAULT NULL,
  `comentario_seg` varchar(100) DEFAULT NULL,
  `rel_formacion_seg` char(1) DEFAULT NULL,
  `observaciones_seg` varchar(200) DEFAULT NULL,
  `cierre_itinerario` char(1) DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=446 DEFAULT CHARSET=latin1;

--
-- Table structure for table `visitas_municip`
--

CREATE TABLE `visitas_municip` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_municipio` char(6) NOT NULL,
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=272 DEFAULT CHARSET=latin1;

--
-- Current Database: `foros`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `foros` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `foros`;

--
-- Table structure for table `anuncios`
--

CREATE TABLE `anuncios` (
  `id` int NOT NULL AUTO_INCREMENT,
  `titulo` varchar(100) NOT NULL DEFAULT '',
  `contenido` text NOT NULL,
  `fecha` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Table structure for table `foros`
--

CREATE TABLE `foros` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `descripcion` text NOT NULL,
  `anonimos` int NOT NULL DEFAULT '1',
  `abierto` int NOT NULL DEFAULT '1',
  `anoni_topic` int NOT NULL DEFAULT '0',
  `docsid` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=65 DEFAULT CHARSET=latin1;

--
-- Table structure for table `mensajes`
--

CREATE TABLE `mensajes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `f_id` int NOT NULL DEFAULT '0',
  `autor` varchar(100) NOT NULL DEFAULT '',
  `mensaje` longtext NOT NULL,
  `fecha` datetime DEFAULT NULL,
  `padre` int NOT NULL DEFAULT '0',
  `titulo` varchar(90) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=14210 DEFAULT CHARSET=latin1;

--
-- Table structure for table `paginas`
--

CREATE TABLE `paginas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `titulo` varchar(100) NOT NULL DEFAULT '',
  `contenido` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Table structure for table `usu_foro`
--

CREATE TABLE `usu_foro` (
  `foro_id` int NOT NULL DEFAULT '0',
  `nif` char(9) NOT NULL DEFAULT '',
  `esc` tinyint(1) NOT NULL DEFAULT '0',
  `coordina` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`foro_id`,`nif`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Current Database: `gastos_contabilidad`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `gastos_contabilidad` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `gastos_contabilidad`;

--
-- Table structure for table `bancos_bic`
--

CREATE TABLE `bancos_bic` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `codigo_banco` varchar(4) DEFAULT NULL,
  `nombre_banco` varchar(60) DEFAULT NULL,
  `BIC` varchar(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1;

--
-- Table structure for table `gastos`
--

CREATE TABLE `gastos` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `CodigoProveedor` int unsigned DEFAULT NULL,
  `RazonSocial` varchar(50) NOT NULL,
  `formaPago` varchar(35) DEFAULT NULL,
  `CifDni` varchar(13) DEFAULT NULL,
  `EjercicioFactura` smallint unsigned DEFAULT NULL,
  `SerieFactura` varchar(5) DEFAULT NULL,
  `NumeroFactura` mediumint unsigned DEFAULT NULL,
  `FechaFactura` date DEFAULT NULL,
  `SuFacturaN` varchar(35) DEFAULT NULL,
  `TotalFactura` decimal(10,2) unsigned DEFAULT NULL,
  `CodigoArticulo` varchar(50) DEFAULT NULL,
  `Reparto` tinyint unsigned DEFAULT NULL,
  `CodProyecto` smallint unsigned DEFAULT NULL,
  `proyecto` varchar(30) DEFAULT NULL,
  `CodDelegacion` varchar(4) DEFAULT NULL,
  `Actuacion` tinyint unsigned DEFAULT NULL,
  `Accion` tinyint unsigned DEFAULT NULL,
  `Detalle` tinyint unsigned DEFAULT NULL,
  `CodUbicacion` varchar(4) DEFAULT NULL,
  `CodSubDelegacion` smallint unsigned DEFAULT NULL,
  `partida` varchar(255) DEFAULT NULL,
  `per_ent` varchar(35) DEFAULT NULL,
  `lug_ent` varchar(35) DEFAULT NULL,
  `fecha_creacion` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `dni_creacion` varchar(12) DEFAULT NULL,
  `numero_envio` mediumint unsigned DEFAULT NULL,
  `fecha_envio` datetime DEFAULT NULL,
  `autor_envio` varchar(12) DEFAULT NULL,
  `fecha_exportacion` date DEFAULT NULL,
  `autor_exportacion` varchar(12) DEFAULT NULL,
  `devuelto` tinyint(1) NOT NULL DEFAULT '0',
  `observaciones` tinytext,
  `obs_inicio` varchar(50) DEFAULT NULL,
  `fecha_export_caja` date DEFAULT NULL,
  `autor_export_caja` varchar(9) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87235 DEFAULT CHARSET=latin1;

--
-- Table structure for table `usuarios_delegacion`
--

CREATE TABLE `usuarios_delegacion` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nif` varchar(10) NOT NULL,
  `area_centro` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unico` (`nif`,`area_centro`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=449 DEFAULT CHARSET=latin1;

--
-- Current Database: `i3l`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `i3l` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `i3l`;

--
-- Table structure for table `curso`
--

CREATE TABLE `curso` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `i3l_id` char(10) DEFAULT NULL,
  `centro` smallint unsigned NOT NULL,
  `localidad` char(5) DEFAULT NULL,
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `id_sector_act` char(1) DEFAULT NULL,
  `id_subsector_act` char(2) DEFAULT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `fecha_fin` date NOT NULL DEFAULT '0000-00-00',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `practicas` smallint unsigned NOT NULL DEFAULT '0',
  `mod_ma` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_si` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_lab` tinyint(1) DEFAULT '0',
  `mod_ig` tinyint(1) DEFAULT '0',
  `proyecto` smallint DEFAULT NULL,
  `modificado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `time_carga` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2151 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Cursos de Formación';

--
-- Table structure for table `estado_carga`
--

CREATE TABLE `estado_carga` (
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `programa` char(1) NOT NULL DEFAULT '',
  `modificado` datetime DEFAULT NULL,
  `time_carga` datetime DEFAULT NULL,
  `estado` char(1) DEFAULT NULL,
  `mensaje` varchar(350) DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`,`programa`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `i3l_deriv_fam`
--

CREATE TABLE `i3l_deriv_fam` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_entidad` char(8) NOT NULL DEFAULT '',
  `tipo_motivo` char(2) NOT NULL,
  `id_prov` char(2) NOT NULL,
  `id_loc` char(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `i3l_derivaciones`
--

CREATE TABLE `i3l_derivaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_entidad` char(8) NOT NULL DEFAULT '',
  `motivo` text NOT NULL,
  `tipo_motivo` char(2) NOT NULL,
  `id_prov` char(2) NOT NULL,
  `id_loc` char(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=761 DEFAULT CHARSET=latin1;

--
-- Table structure for table `i3l_entidades`
--

CREATE TABLE `i3l_entidades` (
  `id` char(8) NOT NULL,
  `nombre` char(50) DEFAULT NULL,
  `cepaim` char(1) DEFAULT NULL,
  `aut` char(1) DEFAULT NULL,
  `ind` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `localidad`
--

CREATE TABLE `localidad` (
  `id` char(5) NOT NULL,
  `localidad` char(60) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `prefor`
--

CREATE TABLE `prefor` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `i3l_id` char(10) DEFAULT NULL,
  `centro` smallint unsigned NOT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL,
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `idioma` char(2) DEFAULT NULL,
  `descripcion` varchar(100) DEFAULT NULL,
  `proyecto` smallint DEFAULT NULL,
  `modificado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `time_carga` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6149 DEFAULT CHARSET=latin1 COMMENT='Preformaciones';

--
-- Table structure for table `reserva`
--

CREATE TABLE `reserva` (
  `id_centro_origen` tinyint NOT NULL DEFAULT '0',
  `id_usuario` mediumint NOT NULL DEFAULT '0',
  `nif` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`id_usuario`,`id_centro_origen`,`nif`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Current Database: `insercion`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `insercion` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `insercion`;

--
-- Table structure for table `centros`
--

CREATE TABLE `centros` (
  `id` int NOT NULL DEFAULT '0',
  `nombre` varchar(25) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `entidades_sociales`
--

CREATE TABLE `entidades_sociales` (
  `id_centro` int NOT NULL DEFAULT '0',
  `id_user` int NOT NULL DEFAULT '0',
  `id` int NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `tipo` varchar(255) DEFAULT NULL,
  `contacto` varchar(255) DEFAULT NULL,
  `cargo` varchar(100) DEFAULT NULL,
  `dir0` varchar(255) DEFAULT NULL,
  `dir1` varchar(255) DEFAULT NULL,
  `dir2` varchar(255) DEFAULT NULL,
  `tlf` varchar(100) DEFAULT NULL,
  `fax` varchar(100) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `web` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_centro`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

CREATE TABLE `users` (
  `id` int NOT NULL DEFAULT '0',
  `username` varchar(16) NOT NULL DEFAULT '',
  `passwd` varchar(30) NOT NULL DEFAULT '',
  `email` varchar(100) NOT NULL DEFAULT '',
  `centro` int NOT NULL DEFAULT '0',
  `ultima_vez` datetime DEFAULT NULL,
  PRIMARY KEY (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Current Database: `laboral`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `laboral` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `laboral`;

--
-- Table structure for table `cvs`
--

CREATE TABLE `cvs` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(10) DEFAULT NULL,
  `nombre` varchar(255) NOT NULL,
  `id_prov` tinyint unsigned NOT NULL,
  `tlf` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `titulacion` varchar(255) NOT NULL,
  `cursos` varchar(255) DEFAULT NULL,
  `obs` varchar(255) DEFAULT NULL,
  `ultimo_modificador` varchar(10) NOT NULL,
  `actualizado` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Current Database: `participacion`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `participacion` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `participacion`;

--
-- Table structure for table `acc_medios`
--

CREATE TABLE `acc_medios` (
  `id_accion` int unsigned NOT NULL,
  `id_medio` tinyint unsigned NOT NULL,
  KEY `id_accion` (`id_accion`,`id_medio`),
  KEY `id_medio` (`id_medio`),
  CONSTRAINT `acc_medios_ibfk_1` FOREIGN KEY (`id_accion`) REFERENCES `acciones_colectivas` (`id`) ON DELETE CASCADE,
  CONSTRAINT `acc_medios_ibfk_2` FOREIGN KEY (`id_medio`) REFERENCES `li_mediosdifusion` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `acc_paises`
--

CREATE TABLE `acc_paises` (
  `id_accion` int unsigned NOT NULL,
  `id_pais` tinyint unsigned NOT NULL,
  `num` mediumint unsigned NOT NULL DEFAULT '0',
  KEY `id_accion` (`id_accion`,`id_pais`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `acciones_colect`
--

CREATE TABLE `acciones_colect` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `obs_fecha` varchar(30) DEFAULT NULL,
  `expediente` varchar(30) DEFAULT '(sin expediente)',
  `titulo` varchar(255) NOT NULL,
  `lugar` varchar(255) NOT NULL,
  `con_gasto` tinyint unsigned NOT NULL DEFAULT '0',
  `tipo` varchar(255) DEFAULT NULL,
  `objetivo` varchar(255) DEFAULT NULL,
  `n_participantes` mediumint unsigned NOT NULL DEFAULT '0',
  `n_hombres` mediumint unsigned NOT NULL DEFAULT '0',
  `n_mujeres` mediumint unsigned NOT NULL DEFAULT '0',
  `n_otros_no_binario` mediumint unsigned NOT NULL DEFAULT '0',
  `n_pax_alcanzadas` mediumint unsigned DEFAULT NULL,
  `materiales` text,
  `objetivos` text,
  `contenido` text,
  `desarrollo` text,
  `logros` text,
  `dificultades` text,
  `evaluacion` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1497 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acciones_colectivas`
--

CREATE TABLE `acciones_colectivas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date DEFAULT NULL,
  `proyecto` tinyint unsigned NOT NULL,
  `proy2` smallint unsigned DEFAULT NULL,
  `proy3` smallint unsigned DEFAULT NULL,
  `con_gasto` tinyint unsigned NOT NULL DEFAULT '0',
  `id_tipoaccion` tinyint unsigned NOT NULL DEFAULT '0',
  `caracter` tinyint(1) NOT NULL DEFAULT '0',
  `id_linea` tinyint DEFAULT NULL,
  `id_linea2` tinyint unsigned DEFAULT NULL,
  `id_linea3` tinyint unsigned DEFAULT NULL,
  `id_objetivos` int unsigned DEFAULT NULL,
  `id_indicadores` int unsigned DEFAULT NULL,
  `titulo` varchar(255) NOT NULL,
  `lugar` varchar(255) NOT NULL,
  `n_participantes` mediumint unsigned NOT NULL DEFAULT '0',
  `n_hombres` mediumint unsigned NOT NULL DEFAULT '0',
  `n_mujeres` mediumint unsigned NOT NULL DEFAULT '0',
  `n_menores12` mediumint unsigned NOT NULL DEFAULT '0',
  `n_13_17` mediumint unsigned NOT NULL DEFAULT '0',
  `n_18_24` mediumint unsigned NOT NULL DEFAULT '0',
  `n_25_34` mediumint unsigned NOT NULL DEFAULT '0',
  `n_35_45` mediumint unsigned NOT NULL DEFAULT '0',
  `n_mayor45` mediumint unsigned NOT NULL DEFAULT '0',
  `n_sinestudios` mediumint unsigned NOT NULL DEFAULT '0',
  `n_primarios` mediumint unsigned NOT NULL DEFAULT '0',
  `n_secundarios` mediumint unsigned NOT NULL DEFAULT '0',
  `n_bachillerato` mediumint unsigned NOT NULL DEFAULT '0',
  `n_universitarios` mediumint unsigned NOT NULL DEFAULT '0',
  `n_partic_indirectos` mediumint unsigned DEFAULT NULL,
  `materiales` text,
  `objetivos` text NOT NULL,
  `contenido` text,
  `desarrollo` text NOT NULL,
  `resultados` text,
  `logros` text NOT NULL,
  `dificultades` text NOT NULL,
  `evaluacion` text NOT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tipoaccion` (`id_tipoaccion`),
  CONSTRAINT `acciones_colectivas_ibfk_2` FOREIGN KEY (`id_tipoaccion`) REFERENCES `li_tipoaccion` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9042 DEFAULT CHARSET=latin1;

--
-- Table structure for table `fechas_accion`
--

CREATE TABLE `fechas_accion` (
  `id_accion` int unsigned NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (`id_accion`,`fecha`),
  KEY `id_accion` (`id_accion`,`fecha`),
  CONSTRAINT `fechas_accion_ibfk_1` FOREIGN KEY (`id_accion`) REFERENCES `acciones_colectivas` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_indicadores`
--

CREATE TABLE `li_indicadores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_lineatrabajo`
--

CREATE TABLE `li_lineatrabajo` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_mediosdifusion`
--

CREATE TABLE `li_mediosdifusion` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_multiples_catalogo_lineas_proy`
--

CREATE TABLE `li_multiples_catalogo_lineas_proy` (
  `id_linea` int NOT NULL,
  `id_catalogo` int unsigned NOT NULL,
  `campo` enum('objetivo','eje','medio') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id_linea`,`id_catalogo`,`campo`),
  CONSTRAINT `fk-li_multiples_catalogo_lineas_proy-lineas` FOREIGN KEY (`id_linea`) REFERENCES `usuarios_cepaim`.`li_lineas_proyectos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_objetivos`
--

CREATE TABLE `li_objetivos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tipoaccion`
--

CREATE TABLE `li_tipoaccion` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tiposeguim`
--

CREATE TABLE `li_tiposeguim` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `multiples_catalogo`
--

CREATE TABLE `multiples_catalogo` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `campo` enum('linea','eje','medio','pais') NOT NULL,
  `nombre` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;

--
-- Table structure for table `multiples_valores`
--

CREATE TABLE `multiples_valores` (
  `id_accion` int unsigned NOT NULL,
  `campo` enum('linea','eje','medio','pais') NOT NULL,
  `valor` varchar(255) NOT NULL,
  PRIMARY KEY (`id_accion`,`campo`,`valor`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `proyectos`
--

CREATE TABLE `proyectos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL,
  `nombre_largo` varchar(254) DEFAULT NULL,
  `financiador` varchar(255) DEFAULT NULL,
  `id_proy` int unsigned DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  `cod_proyecto` varchar(25) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=latin1;

--
-- Table structure for table `proyectos_centros`
--

CREATE TABLE `proyectos_centros` (
  `id_proyecto` mediumint unsigned NOT NULL,
  `id_centro` smallint unsigned NOT NULL,
  PRIMARY KEY (`id_proyecto`,`id_centro`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `proyectos_lineastrabajo`
--

CREATE TABLE `proyectos_lineastrabajo` (
  `id_proyecto` tinyint unsigned NOT NULL,
  `id_lineatrabajo` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id_proyecto`,`id_lineatrabajo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `proyectos_tiposacciones`
--

CREATE TABLE `proyectos_tiposacciones` (
  `id_proyecto` tinyint unsigned NOT NULL,
  `id_tipoaccion` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id_proyecto`,`id_tipoaccion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `seguimiento_prog`
--

CREATE TABLE `seguimiento_prog` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tiposeguim` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` varchar(255) NOT NULL,
  `lugar` varchar(255) NOT NULL,
  `participantes` text NOT NULL,
  `objetivos` text NOT NULL,
  `contenido` text,
  `desarrollo` text NOT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_tiposeguim` (`id_tiposeguim`),
  CONSTRAINT `seguimiento_prog_ibfk_2` FOREIGN KEY (`id_tiposeguim`) REFERENCES `li_tiposeguim` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Current Database: `usuarios`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `usuarios` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `usuarios`;

--
-- Table structure for table `accesos`
--

CREATE TABLE `accesos` (
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user` varchar(10) DEFAULT NULL,
  `pwd` varchar(10) DEFAULT NULL,
  `ip` varchar(15) NOT NULL DEFAULT '',
  `nav` varchar(150) NOT NULL DEFAULT '',
  `ok` tinyint(1) NOT NULL DEFAULT '0',
  `acceso_benef` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `adjuntos`
--

CREATE TABLE `adjuntos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tabla` varchar(50) NOT NULL,
  `campo` varchar(25) NOT NULL,
  `id_tabla` int NOT NULL,
  `filename` char(100) NOT NULL,
  `mimetype` varchar(30) DEFAULT NULL,
  `titulo` varchar(120) DEFAULT NULL,
  `fecha_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `nif_crea` char(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique-tabla-campo-id_tabla-titulo` (`tabla`,`campo`,`id_tabla`,`titulo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `autorizaciones`
--

CREATE TABLE `autorizaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `formato` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `tabla` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id_proyecto` smallint unsigned DEFAULT NULL,
  `id_tabla` int DEFAULT NULL,
  `estado` enum('Solicitada','Autorizada','Rechazada') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `fecha_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `fecha_resolucion` timestamp NULL DEFAULT NULL,
  `nif_crea` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `nif_resuelve` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `descripcion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `datos` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=406 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `centros`
--

CREATE TABLE `centros` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(25) NOT NULL DEFAULT '',
  `d1` varchar(100) DEFAULT NULL,
  `d2` varchar(100) DEFAULT NULL,
  `tlf` varchar(30) DEFAULT NULL,
  `fax` varchar(15) DEFAULT NULL,
  `provincia_cp` char(2) DEFAULT NULL,
  `mun_id` char(4) DEFAULT NULL,
  `coordinador` varchar(9) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  `iban` varchar(29) DEFAULT NULL,
  `id_contabilidad` varchar(4) DEFAULT NULL,
  `region_tipo` enum('A','B','C','D') DEFAULT NULL,
  `id_comunidad` tinyint unsigned DEFAULT NULL,
  `raiz` varchar(3) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1;

--
-- Table structure for table `comision_servicios`
--

CREATE TABLE `comision_servicios` (
  `id` int NOT NULL AUTO_INCREMENT,
  `codigo` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha_solicitud` date NOT NULL,
  `objeto` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `fecha_salida` date NOT NULL,
  `fecha_regreso` date DEFAULT NULL,
  `tipo_viaje` enum('Ida y vuelta','Ida','Vuelta') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT 'Ida y vuelta',
  `id_centro_destino` smallint unsigned DEFAULT NULL,
  `ciudad_destino` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `pref_manutencion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `otras_indicaciones` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `otras_anotaciones` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `id_proyecto` smallint unsigned NOT NULL,
  `usuarios_nif` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id_inmueble` mediumint NOT NULL,
  `estado` tinyint NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_nif_fecha` (`usuarios_nif`,`fecha_salida`),
  KEY `fk-comision_servicio_id_proyecto` (`id_proyecto`),
  KEY `fk-comision_servicio_usuarios_nif` (`usuarios_nif`),
  KEY `fk-comision_servicio_id_centro_destino` (`id_centro_destino`),
  CONSTRAINT `fk-comision_servicio_id_centro_destino` FOREIGN KEY (`id_centro_destino`) REFERENCES `centros` (`id`),
  CONSTRAINT `fk-comision_servicio_id_proyecto` FOREIGN KEY (`id_proyecto`) REFERENCES `usuarios_cepaim`.`proyectos` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `fk-comision_servicio_usuarios_nif` FOREIGN KEY (`usuarios_nif`) REFERENCES `usuarios` (`nif`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `comision_servicios_indemniz`
--

CREATE TABLE `comision_servicios_indemniz` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_comision_servicio` int NOT NULL,
  `descripcion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `importe` decimal(8,2) NOT NULL,
  `fecha` date NOT NULL,
  `tipo` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `obs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  PRIMARY KEY (`id`),
  KEY `fk-cs_indemniz_id_comision_servicio` (`id_comision_servicio`),
  CONSTRAINT `fk-cs_indemniz_ibfk_1` FOREIGN KEY (`id_comision_servicio`) REFERENCES `comision_servicios` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `comision_servicios_pref_alojam`
--

CREATE TABLE `comision_servicios_pref_alojam` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_comision_servicio` int NOT NULL,
  `tipo_alojamiento` enum('Hotel','Hostal','Albergue','Apartamento') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT 'Hotel',
  `nombre` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `lugar` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `fecha_entrada` date DEFAULT NULL,
  `fecha_salida` date DEFAULT NULL,
  `noches` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk-comision_servicio_pref_alojam-id_comision_servicio` (`id_comision_servicio`),
  CONSTRAINT `fk-comision_servicio_pref_alojam-id_comision_servicio` FOREIGN KEY (`id_comision_servicio`) REFERENCES `comision_servicios` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `comision_servicios_pref_desplz`
--

CREATE TABLE `comision_servicios_pref_desplz` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_comision_servicio` int NOT NULL,
  `tipo_recorrido` enum('Ida','Vuelta','Tránsito','Escala de ida','Escala de vuelta') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT 'Ida',
  `tipo_transporte` enum('Autobús','Avión','Tren','Vehículo entidad','Vehículo propio','Con escalas') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT 'Autobús',
  `lugar_salida` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `fecha_salida` datetime DEFAULT NULL,
  `lugar_llegada` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `fecha_llegada` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk-comision_servicio_pref_desplz-id_comision_servicio` (`id_comision_servicio`),
  CONSTRAINT `fk-comision_servicio_pref_desplz-id_comision_servicio` FOREIGN KEY (`id_comision_servicio`) REFERENCES `comision_servicios` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `compensaciones_sem`
--

CREATE TABLE `compensaciones_sem` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(10) NOT NULL,
  `ano` smallint NOT NULL,
  `sem_suma` tinyint unsigned NOT NULL,
  `sem_resta` tinyint unsigned NOT NULL,
  `minutos` smallint unsigned DEFAULT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20881 DEFAULT CHARSET=latin1;

--
-- Table structure for table `complementos`
--

CREATE TABLE `complementos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ano_mes` date NOT NULL,
  `nif` varchar(10) NOT NULL,
  `dias_noct` tinyint NOT NULL DEFAULT '0',
  `dias_turn` tinyint NOT NULL DEFAULT '0',
  `id_coord` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fecha` (`ano_mes`,`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=148 DEFAULT CHARSET=latin1;

--
-- Table structure for table `coord_nif`
--

CREATE TABLE `coord_nif` (
  `id_coord` tinyint unsigned NOT NULL,
  `nif` varchar(9) NOT NULL,
  UNIQUE KEY `id_coord` (`id_coord`,`nif`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `coordinaciones`
--

CREATE TABLE `coordinaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) NOT NULL,
  `id_centro` smallint unsigned NOT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=163 DEFAULT CHARSET=latin1;

--
-- Table structure for table `correos_tmp`
--

CREATE TABLE `correos_tmp` (
  `email` varchar(255) NOT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `eventos_calendario`
--

CREATE TABLE `eventos_calendario` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha1` date NOT NULL,
  `fecha2` date NOT NULL,
  `evento` varchar(50) NOT NULL,
  `descripcion` text NOT NULL,
  `id_user` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2332 DEFAULT CHARSET=latin1;

--
-- Table structure for table `expectativas`
--

CREATE TABLE `expectativas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ano_mes` date NOT NULL,
  `nif` varchar(10) NOT NULL,
  `dias` tinyint NOT NULL DEFAULT '0',
  `id_coord` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fecha` (`ano_mes`,`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=4975 DEFAULT CHARSET=latin1;

--
-- Table structure for table `horas_semanales`
--

CREATE TABLE `horas_semanales` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ano` smallint NOT NULL,
  `semana` tinyint unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `horas` double unsigned NOT NULL,
  `d1` smallint unsigned DEFAULT NULL,
  `d2` smallint unsigned DEFAULT NULL,
  `d3` smallint unsigned DEFAULT NULL,
  `d4` smallint unsigned DEFAULT NULL,
  `d5` smallint unsigned DEFAULT NULL,
  `d6` smallint unsigned DEFAULT NULL,
  `d7` smallint unsigned DEFAULT NULL,
  `s1` varchar(255) DEFAULT NULL,
  `s2` varchar(255) DEFAULT NULL,
  `s3` varchar(255) DEFAULT NULL,
  `s4` varchar(255) DEFAULT NULL,
  `s5` varchar(255) DEFAULT NULL,
  `s6` varchar(255) DEFAULT NULL,
  `s7` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ano` (`ano`,`semana`,`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=241428 DEFAULT CHARSET=latin1;

--
-- Table structure for table `inmuebles`
--

CREATE TABLE `inmuebles` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `codigo_inmueble` mediumint unsigned DEFAULT NULL,
  `direccion` varchar(255) NOT NULL DEFAULT '',
  `uso` varchar(100) NOT NULL,
  `regimen` varchar(100) NOT NULL,
  `prov_id` tinyint unsigned NOT NULL DEFAULT '0',
  `mun_id` char(6) NOT NULL,
  `localidad` varchar(100) NOT NULL DEFAULT '',
  `cod_postal` char(5) NOT NULL,
  `tlf` varchar(100) DEFAULT NULL,
  `n_plazas` tinyint unsigned DEFAULT NULL,
  `tipo_inmueble` varchar(100) NOT NULL,
  `superficie` smallint DEFAULT NULL,
  `id_centro` smallint unsigned DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=571 DEFAULT CHARSET=latin1;

--
-- Table structure for table `jornadas_semanales`
--

CREATE TABLE `jornadas_semanales` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ano` smallint NOT NULL,
  `semana` tinyint unsigned NOT NULL,
  `nif` varchar(10) NOT NULL,
  `id_proy_perfil` int NOT NULL,
  `horas` double unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ano` (`ano`,`semana`,`nif`,`id_proy_perfil`)
) ENGINE=InnoDB AUTO_INCREMENT=25068 DEFAULT CHARSET=latin1;

--
-- Table structure for table `log_altasbajas`
--

CREATE TABLE `log_altasbajas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `usuario` varchar(10) NOT NULL,
  `accion` enum('alta','baja','reactivación') NOT NULL,
  `autor` varchar(9) NOT NULL,
  `ip` varchar(15) NOT NULL DEFAULT '',
  `nav` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9670 DEFAULT CHARSET=latin1;

--
-- Table structure for table `modulos`
--

CREATE TABLE `modulos` (
  `id` varchar(15) NOT NULL DEFAULT '',
  `modulo` varchar(60) NOT NULL,
  `link` varchar(50) NOT NULL DEFAULT '',
  `mostrar` tinyint(1) NOT NULL DEFAULT '0',
  `comentario` varchar(255) DEFAULT NULL,
  `niveles` varchar(255) DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `no_laborales_global`
--

CREATE TABLE `no_laborales_global` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `id_ccaa` smallint unsigned DEFAULT NULL,
  `id_prov` varchar(2) DEFAULT NULL,
  `id_mun` varchar(6) DEFAULT NULL,
  `id_coordinacion` tinyint unsigned DEFAULT NULL,
  `obs` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=675 DEFAULT CHARSET=latin1;

--
-- Table structure for table `no_laborales_nif`
--

CREATE TABLE `no_laborales_nif` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `f1` date NOT NULL,
  `f2` date NOT NULL,
  `nif` varchar(10) NOT NULL,
  `tipo` enum('asuntos propios','asuntos propios centro','compensación guardias','baja','baja maternal','huelga','lactancia acumulada','matrimonio','otros permisos retribuidos art.15 conv.','permiso','permiso no retribuido','permiso por paternidad','vacaciones','reposo sin baja médica') NOT NULL,
  `anualidad` smallint unsigned NOT NULL,
  `num_dias` smallint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unica` (`f1`,`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=24721 DEFAULT CHARSET=latin1;

--
-- Table structure for table `noticias`
--

CREATE TABLE `noticias` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `id_user` varchar(10) NOT NULL,
  `titulo` varchar(100) NOT NULL,
  `detalle` text NOT NULL,
  `fecha` date NOT NULL,
  `publico` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=latin1;

--
-- Table structure for table `permisos`
--

CREATE TABLE `permisos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `modulo` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `nif` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id_tabla` int NOT NULL,
  `permiso` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `tabla` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `usuarios_permisos_unique` (`modulo`,`nif`,`id_tabla`,`tabla`),
  KEY `usuarios_permisos_nif` (`nif`),
  KEY `usuarios_permisos_id_area` (`id_tabla`),
  CONSTRAINT `usuarios_permisos_nif` FOREIGN KEY (`nif`) REFERENCES `usuarios` (`nif`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `procesos_selecc`
--

CREATE TABLE `procesos_selecc` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `coord_nif` varchar(10) NOT NULL DEFAULT '',
  `alta_prevista` date NOT NULL DEFAULT '0000-00-00',
  `id_provincia` tinyint unsigned NOT NULL,
  `municipio` varchar(50) NOT NULL DEFAULT '',
  `centro` varchar(50) NOT NULL,
  `proyecto` varchar(50) NOT NULL DEFAULT '',
  `modalidad_contrato` varchar(50) NOT NULL DEFAULT '',
  `categoria` varchar(50) NOT NULL DEFAULT '',
  `perfil` text,
  `funciones` text,
  `puesto` text,
  `desplazamiento` tinyint(1) NOT NULL DEFAULT '0',
  `jornada` varchar(50) DEFAULT NULL,
  `horario` varchar(50) DEFAULT NULL,
  `periodo_prueba` varchar(50) DEFAULT NULL,
  `bruto_convenio` decimal(8,2) NOT NULL DEFAULT '0.00',
  `bruto_propuest` decimal(8,2) NOT NULL DEFAULT '0.00',
  `enviado_rrhh` tinyint(1) NOT NULL DEFAULT '0',
  `enviado_coor` tinyint(1) NOT NULL DEFAULT '0',
  `cancelado` tinyint(1) NOT NULL DEFAULT '0',
  `enviado_dire` tinyint(1) NOT NULL DEFAULT '0',
  `enviado_resu` tinyint(1) NOT NULL DEFAULT '0',
  `resultado` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COMMENT='Procesos selección de personal';

--
-- Table structure for table `programa_proyecto`
--

CREATE TABLE `programa_proyecto` (
  `id_programa` tinyint NOT NULL,
  `id_proyecto` smallint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `programa_usuarios`
--

CREATE TABLE `programa_usuarios` (
  `id_programa` tinyint NOT NULL,
  `nif` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `programas`
--

CREATE TABLE `programas` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) NOT NULL,
  `id_contabilidad` tinyint unsigned DEFAULT NULL,
  `contador_expdte` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=latin1;

--
-- Table structure for table `puesto_usuario`
--

CREATE TABLE `puesto_usuario` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nif` varchar(9) NOT NULL,
  `puesto` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11342 DEFAULT CHARSET=latin1;

--
-- Table structure for table `puestos`
--

CREATE TABLE `puestos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `puesto` varchar(255) NOT NULL,
  `tipo_puesto_organo` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=latin1;

--
-- Table structure for table `recordatorios`
--

CREATE TABLE `recordatorios` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` varchar(10) NOT NULL DEFAULT '',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `semanas` smallint unsigned NOT NULL DEFAULT '0',
  `mensaje` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=407 DEFAULT CHARSET=latin1;

--
-- Table structure for table `registro_entradas_salidas`
--

CREATE TABLE `registro_entradas_salidas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `ip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `fecha` date NOT NULL,
  `ent` time DEFAULT NULL,
  `sal` time DEFAULT NULL,
  `duracion` mediumint DEFAULT NULL,
  `obs_duracion` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `valido` tinyint(1) NOT NULL DEFAULT '0',
  `ent_solicitada` time DEFAULT NULL,
  `sal_solicitada` time DEFAULT NULL,
  `tipo` enum('activación guardia','comisión de servicio','compensación horaria','formación','problema al fichar','traslado','visita médica familiar','visita médica propia','horas sindicales','reposo sin baja médica','examen titulación oficial','examen prenatal y técnicas de preparación al parto','lactancia') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `obs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `nif_autor` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `nif_autoriza` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `obs_autoriza` text CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `fecha_corrige_usuario` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=872281 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `registro_jornadas`
--

CREATE TABLE `registro_jornadas` (
  `nif` varchar(10) NOT NULL DEFAULT '',
  `anomes` varchar(6) NOT NULL,
  `man_entrada` text,
  `man_salida` text,
  `tar_entrada` text,
  `tar_salida` text,
  `obs` text,
  `horas_complement` text,
  `tipo_dias` text,
  `total_ordinarias` int unsigned NOT NULL,
  `total_complement` int unsigned NOT NULL,
  `jornada_semanal` decimal(3,1) unsigned DEFAULT NULL,
  `validado` tinyint(1) NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`nif`,`anomes`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `semanas_verano`
--

CREATE TABLE `semanas_verano` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nif` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `ano` smallint unsigned NOT NULL,
  `inicio` tinyint unsigned NOT NULL,
  `fin` tinyint unsigned NOT NULL,
  `obs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4349 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `usu_mod`
--

CREATE TABLE `usu_mod` (
  `mod_id` char(15) NOT NULL DEFAULT '',
  `nif` char(10) NOT NULL DEFAULT '',
  `esc` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`mod_id`,`nif`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `usuarios`
--

CREATE TABLE `usuarios` (
  `nif` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `apellidos` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `nombre` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `tlf` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_pais_origen` smallint DEFAULT NULL,
  `ad_user` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `ad_pass` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `passwd` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `fcambio_pass` date DEFAULT NULL,
  `multicentro` tinyint unsigned NOT NULL DEFAULT '0',
  `centro` smallint unsigned NOT NULL DEFAULT '0',
  `centros_posibles` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_inmueble` mediumint unsigned DEFAULT NULL,
  `jornada_semanal` decimal(5,3) unsigned DEFAULT NULL,
  `jornada_semanal_verano` decimal(5,3) unsigned DEFAULT NULL,
  `ultima_vez` datetime DEFAULT NULL,
  `tipo` enum('Trabajador','Voluntario','Otro') CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `activo` smallint unsigned NOT NULL DEFAULT '1',
  `cambio_estado` date DEFAULT NULL,
  `autor_cambio` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `intranet` tinyint(1) NOT NULL DEFAULT '1',
  `id_coordinacion` tinyint unsigned DEFAULT NULL,
  `horario` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `horario_verano` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  PRIMARY KEY (`nif`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `usuarios_area`
--

CREATE TABLE `usuarios_area` (
  `id_area` tinyint NOT NULL,
  `nif` varchar(10) NOT NULL,
  UNIQUE KEY `id_area` (`id_area`,`nif`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Current Database: `usuarios_cepaim`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `usuarios_cepaim` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `usuarios_cepaim`;

--
-- Table structure for table `134_actuaciones`
--

CREATE TABLE `134_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `fecha2` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `134_actuaciones_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `134_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=229 DEFAULT CHARSET=latin1;

--
-- Table structure for table `134_li_actuaciones`
--

CREATE TABLE `134_li_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `78_actuaciones`
--

CREATE TABLE `78_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `78_actuaciones_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `78_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=164 DEFAULT CHARSET=latin1;

--
-- Table structure for table `78_li_actuaciones`
--

CREATE TABLE `78_li_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `89_discriminaciones`
--

CREATE TABLE `89_discriminaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `id_centro` tinyint unsigned NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `expte` int NOT NULL,
  `persona_ref` varchar(255) NOT NULL,
  `responsable_cierre` varchar(255) DEFAULT NULL,
  `localidad` varchar(100) NOT NULL,
  `p1` tinyint unsigned NOT NULL,
  `p2` tinyint unsigned NOT NULL,
  `t2` varchar(255) DEFAULT NULL,
  `p3` text,
  `p4` tinyint unsigned NOT NULL,
  `p5` tinyint unsigned NOT NULL,
  `t5` varchar(255) DEFAULT NULL,
  `p6` tinyint unsigned NOT NULL,
  `p7` tinyint unsigned NOT NULL,
  `t7` varchar(255) DEFAULT NULL,
  `p8` tinyint unsigned NOT NULL,
  `t8` varchar(255) DEFAULT NULL,
  `p9` tinyint unsigned NOT NULL,
  `t9` varchar(255) DEFAULT NULL,
  `p10` varchar(50) NOT NULL,
  `t10` varchar(255) DEFAULT NULL,
  `p11` tinyint unsigned NOT NULL,
  `t11` varchar(255) DEFAULT NULL,
  `p12` varchar(255) NOT NULL,
  `p13` tinyint unsigned NOT NULL,
  `t13` varchar(255) DEFAULT NULL,
  `p14` varchar(255) NOT NULL,
  `p15` text,
  `p16` text,
  `p17` text,
  `p18` tinyint unsigned NOT NULL,
  `t18` varchar(255) DEFAULT NULL,
  `p19` text,
  `p20` text,
  `p21` tinyint unsigned NOT NULL,
  `p22` tinyint unsigned NOT NULL,
  `p23` tinyint unsigned NOT NULL,
  `p24` tinyint unsigned NOT NULL,
  `p25` text,
  `p26` tinyint unsigned NOT NULL,
  `t26` varchar(255) NOT NULL,
  `p27` text,
  `p28` date DEFAULT NULL,
  `p29` varchar(255) DEFAULT NULL,
  `p30` tinyint unsigned NOT NULL,
  `p31` text,
  `p32` tinyint unsigned NOT NULL,
  `p33` text,
  `p34` tinyint unsigned NOT NULL,
  `p35` text,
  `p36` tinyint unsigned NOT NULL,
  `p37` text,
  `p38` tinyint unsigned NOT NULL,
  `p39` text,
  `p40` text,
  `p41` text,
  `p42` tinyint unsigned NOT NULL,
  `t42` varchar(255) DEFAULT NULL,
  `p43` tinyint unsigned DEFAULT NULL,
  `t43` varchar(255) DEFAULT NULL,
  `p44` tinyint unsigned DEFAULT NULL,
  `t44` varchar(255) DEFAULT NULL,
  `p45` tinyint NOT NULL,
  `p46` tinyint NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=latin1;

--
-- Table structure for table `92_actuaciones`
--

CREATE TABLE `92_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_actuacion` tinyint unsigned NOT NULL,
  `id_centro` tinyint unsigned NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  CONSTRAINT `92_actuaciones_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `92_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=latin1;

--
-- Table structure for table `92_ayudas`
--

CREATE TABLE `92_ayudas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `tipo_ayuda` varchar(50) NOT NULL,
  `mes` varchar(12) NOT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `id_centro` tinyint DEFAULT NULL,
  `situacion` text,
  `pago` varchar(15) DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `92_ayudas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Table structure for table `92_li_actuaciones`
--

CREATE TABLE `92_li_actuaciones` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(155) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `92_otros_datos`
--

CREATE TABLE `92_otros_datos` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_sector_laboral` tinyint NOT NULL,
  `empadronamiento` varchar(50) NOT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  CONSTRAINT `92_otros_datos_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `92_seguimiento`
--

CREATE TABLE `92_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=latin1;

--
-- Table structure for table `95_actuaciones`
--

CREATE TABLE `95_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `fecha2` date DEFAULT NULL,
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `95_actuaciones_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `95_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=683 DEFAULT CHARSET=latin1;

--
-- Table structure for table `95_li_actuaciones`
--

CREATE TABLE `95_li_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;

--
-- Table structure for table `accion_com_acciones`
--

CREATE TABLE `accion_com_acciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `proyecto` smallint DEFAULT NULL,
  `tipo` varchar(255) NOT NULL,
  `herramienta` varchar(255) NOT NULL,
  `objetivo` text,
  `descripcion` text,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3135 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acercar_cursos`
--

CREATE TABLE `acercar_cursos` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_usuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_curso` tinyint unsigned NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`id_usuario`,`id_curso`),
  KEY `id_curso` (`id_curso`),
  CONSTRAINT `acercar_cursos_ibfk_1` FOREIGN KEY (`id_curso`) REFERENCES `acercar_li_cursos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `acercar_li_cursos`
--

CREATE TABLE `acercar_li_cursos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acog_emer`
--

CREATE TABLE `acog_emer` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL DEFAULT '0',
  `cie` varchar(30) NOT NULL DEFAULT '',
  `recogida` varchar(30) NOT NULL DEFAULT '',
  `destino` varchar(30) NOT NULL DEFAULT '',
  `id_ubicacion` int DEFAULT NULL,
  `obs` text,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `resultado` tinyint unsigned DEFAULT NULL,
  `provincia` tinyint unsigned DEFAULT NULL,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  `prov_des` char(2) DEFAULT NULL,
  `loc_des` char(4) DEFAULT NULL,
  `centro` tinyint DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`,`proyecto`),
  KEY `resultado` (`resultado`),
  KEY `provincia` (`provincia`),
  CONSTRAINT `acog_emer_ibfk_1` FOREIGN KEY (`resultado`) REFERENCES `li_acog_em_resultado` (`id`),
  CONSTRAINT `acog_emer_ibfk_2` FOREIGN KEY (`provincia`) REFERENCES `provincias_esp` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `acog_emer_ayudas`
--

CREATE TABLE `acog_emer_ayudas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned DEFAULT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_ayuda` tinyint unsigned NOT NULL DEFAULT '0',
  `dias` smallint unsigned DEFAULT NULL,
  `precio_dia` float(8,2) unsigned DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `id_centro` tinyint DEFAULT NULL,
  `situacion` text,
  `pago` varchar(15) DEFAULT NULL,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_ayuda` (`id_ayuda`),
  CONSTRAINT `acog_emer_ayudas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `acog_emer_ayudas_ibfk_2` FOREIGN KEY (`id_ayuda`) REFERENCES `li_acog_em_ayudas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30854 DEFAULT CHARSET=latin1 COMMENT='Ayudas en Acogida de Emergencia';

--
-- Table structure for table `acog_emer_gestiones`
--

CREATE TABLE `acog_emer_gestiones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_gestion` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(255) DEFAULT NULL,
  `id_actuacion` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_gestion` (`id_gestion`),
  CONSTRAINT `acog_emer_gestiones_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `acog_emer_gestiones_ibfk_2` FOREIGN KEY (`id_gestion`) REFERENCES `li_acog_em_gest` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22761 DEFAULT CHARSET=latin1 COMMENT='Gestiones en Acogida de Emergencia';

--
-- Table structure for table `acogida_acogidas_i`
--

CREATE TABLE `acogida_acogidas_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL,
  `baja` date DEFAULT NULL,
  `id_ubicacion` int NOT NULL DEFAULT '0',
  `observaciones` text,
  `proyecto` int unsigned DEFAULT NULL,
  `id_servicio` smallint unsigned DEFAULT NULL,
  `id_municipio` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `resultado` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `persona` (`centro_origen`,`idusuario`),
  KEY `fk-acogidas-servicios` (`id_servicio`),
  CONSTRAINT `fk-acogidas-servicios` FOREIGN KEY (`id_servicio`) REFERENCES `beneficiarios`.`proy_servicios` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=76242 DEFAULT CHARSET=latin1 COMMENT='Acogidas realizadas.';

--
-- Table structure for table `acogida_actuaciones`
--

CREATE TABLE `acogida_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `duracion` int NOT NULL DEFAULT '0',
  `id_actuacion` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint DEFAULT NULL,
  `act` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `acogida_actuaciones_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `acogida_lista_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=537424 DEFAULT CHARSET=latin1 COMMENT='Actuaciones de acogida.';

--
-- Table structure for table `acogida_alojamientos`
--

CREATE TABLE `acogida_alojamientos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `id_servicio` smallint unsigned DEFAULT NULL,
  `clas1` tinyint unsigned NOT NULL DEFAULT '0',
  `clas2` tinyint unsigned NOT NULL DEFAULT '0',
  `clas3` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `tipo` enum('CENTRO CONTRATADO','CENTRO CEDIDO','CENTRO PROPIO','CREADE') DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `dias` smallint unsigned DEFAULT NULL,
  `SIRIA_num` varchar(5) DEFAULT NULL,
  `SIRIA_nom` varchar(255) DEFAULT NULL,
  `perfil` varchar(254) DEFAULT NULL,
  `cp` char(5) DEFAULT NULL,
  `caducado` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `aloj-centro-proyecto` (`centro`,`proyecto`),
  KEY `fk-alojamientos-servicios` (`id_servicio`),
  CONSTRAINT `fk-alojamientos-servicios` FOREIGN KEY (`id_servicio`) REFERENCES `beneficiarios`.`proy_servicios` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14695 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_asentamientos`
--

CREATE TABLE `acogida_asentamientos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `caducado` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=462 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_asentamientos_i`
--

CREATE TABLE `acogida_asentamientos_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date DEFAULT NULL,
  `baja` date DEFAULT NULL,
  `id_asentamiento` int NOT NULL DEFAULT '0',
  `observaciones` text,
  `proyecto` tinyint unsigned DEFAULT NULL,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18220 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_entrevistas`
--

CREATE TABLE `acogida_entrevistas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_deriv_por` tinyint unsigned DEFAULT NULL,
  `id_deriv_a` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  `id_actuacion` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_deriv_por` (`id_deriv_por`),
  KEY `id_deriv_a` (`id_deriv_a`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `acogida_entrevistas_ibfk_1` FOREIGN KEY (`id_deriv_por`) REFERENCES `lista_deriv_por` (`id`),
  CONSTRAINT `acogida_entrevistas_ibfk_2` FOREIGN KEY (`id_deriv_a`) REFERENCES `lista_deriv_a` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5600 DEFAULT CHARSET=latin1 COMMENT='Entrevistas de acogida.';

--
-- Table structure for table `acogida_hogares_i`
--

CREATE TABLE `acogida_hogares_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `centro` tinyint unsigned DEFAULT NULL,
  `alta` date DEFAULT NULL,
  `baja` date DEFAULT NULL,
  `observaciones` text,
  `prov_des` char(2) DEFAULT NULL,
  `loc_des` char(4) DEFAULT NULL,
  `resultado` tinyint unsigned DEFAULT NULL,
  `proyecto` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `clave` (`centro_origen`,`idusuario`,`centro`)
) ENGINE=InnoDB AUTO_INCREMENT=18700 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_lista_actuaciones`
--

CREATE TABLE `acogida_lista_actuaciones` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `actuacion` tinyint unsigned DEFAULT NULL,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=945 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''actuacion'' de tabla actuaci';

--
-- Table structure for table `acogida_lista_otras_act`
--

CREATE TABLE `acogida_lista_otras_act` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''actuacion'' de tabla otras a';

--
-- Table structure for table `acogida_otras_act`
--

CREATE TABLE `acogida_otras_act` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `duracion` int NOT NULL DEFAULT '0',
  `id_actuacion` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `autor` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  KEY `id_actuacion_2` (`id_actuacion`),
  CONSTRAINT `acogida_otras_act_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `acogida_lista_otras_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5000 DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_otros`
--

CREATE TABLE `acogida_otros` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `d1` text,
  `d2` text,
  `d3` text,
  `d4` text,
  `d5` text,
  `d6` text,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Situación familiar, historia de emigración, ...';

--
-- Table structure for table `acogida_prop_ingreso`
--

CREATE TABLE `acogida_prop_ingreso` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `d1` text,
  `d2` text,
  `d3` text,
  `d4` text,
  `d5` text,
  `d6` text,
  `d7` text,
  `d8` text,
  `d9` text,
  `d10` text,
  `d11` text,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `acogida_seguimiento`
--

CREATE TABLE `acogida_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  `id_actuacion` tinyint unsigned NOT NULL,
  `proyecto` smallint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=41009 DEFAULT CHARSET=latin1 COMMENT='Seguimiento de acogida.';

--
-- Table structure for table `agcol_atendidas`
--

CREATE TABLE `agcol_atendidas` (
  `dni` varchar(10) NOT NULL,
  `anomes` char(6) NOT NULL,
  `desempleo` tinyint(1) NOT NULL,
  `dif_inserc` tinyint(1) NOT NULL,
  PRIMARY KEY (`dni`,`anomes`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `agcol_dnis`
--

CREATE TABLE `agcol_dnis` (
  `dni` varchar(10) NOT NULL,
  `anomes` char(6) NOT NULL,
  `enviado` tinyint(1) NOT NULL,
  PRIMARY KEY (`dni`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `agcol_enviadasoferta`
--

CREATE TABLE `agcol_enviadasoferta` (
  `dni` varchar(10) NOT NULL,
  `anomes` char(6) NOT NULL,
  PRIMARY KEY (`dni`,`anomes`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `agcol_envios`
--

CREATE TABLE `agcol_envios` (
  `anomes` char(6) NOT NULL,
  `generado` datetime NOT NULL,
  `num_registros` int unsigned NOT NULL,
  `enviado` datetime DEFAULT NULL,
  `contenido` text NOT NULL,
  PRIMARY KEY (`anomes`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `altas_bajas_siria`
--

CREATE TABLE `altas_bajas_siria` (
  `id_proy` smallint NOT NULL,
  `nif` varchar(10) NOT NULL,
  `nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(100) NOT NULL,
  `puesto` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `and_ori_seguimiento`
--

CREATE TABLE `and_ori_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=13633 DEFAULT CHARSET=latin1 COMMENT='Andalucía Orienta (Sevilla)';

--
-- Table structure for table `apres_retornos`
--

CREATE TABLE `apres_retornos` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `ase_cons_apr`
--

CREATE TABLE `ase_cons_apr` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_consulta` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_consulta` (`id_consulta`),
  CONSTRAINT `ase_cons_apr_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ase_cons_apr_ibfk_2` FOREIGN KEY (`id_consulta`) REFERENCES `ase_li_cons_apr` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Asesoramiento jurid. Consultas Apros.';

--
-- Table structure for table `ase_cons_sev`
--

CREATE TABLE `ase_cons_sev` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_consulta` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_consulta` (`id_consulta`),
  CONSTRAINT `ase_cons_sev_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ase_cons_sev_ibfk_2` FOREIGN KEY (`id_consulta`) REFERENCES `ase_li_cons_sev` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5284 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento jurid. Consultas Sev.';

--
-- Table structure for table `ase_consultas`
--

CREATE TABLE `ase_consultas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_consulta` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_consulta` (`id_consulta`),
  CONSTRAINT `ase_consultas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ase_consultas_ibfk_2` FOREIGN KEY (`id_consulta`) REFERENCES `ase_li_consultas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=65541 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento jurid. Consultas';

--
-- Table structure for table `ase_consultas_acog`
--

CREATE TABLE `ase_consultas_acog` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nivel` tinyint(1) NOT NULL DEFAULT '1',
  `id_situacion` tinyint unsigned NOT NULL,
  `id_consulta` tinyint unsigned NOT NULL,
  `observaciones` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_situacion` (`id_situacion`),
  KEY `id_consulta` (`id_consulta`),
  CONSTRAINT `ase_consultas_acog_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ase_consultas_acog_ibfk_2` FOREIGN KEY (`id_situacion`) REFERENCES `ase_li_consultas_acog2` (`id`),
  CONSTRAINT `ase_consultas_acog_ibfk_3` FOREIGN KEY (`id_consulta`) REFERENCES `ase_li_consultas_acog` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24243 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ase_li_centros`
--

CREATE TABLE `ase_li_centros` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento. Centros: Beniaján, Fte. Alamo, ...';

--
-- Table structure for table `ase_li_cons_apr`
--

CREATE TABLE `ase_li_cons_apr` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento. Lista de consultas Aprosers';

--
-- Table structure for table `ase_li_cons_sev`
--

CREATE TABLE `ase_li_cons_sev` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento. Lista de consultas Sevilla';

--
-- Table structure for table `ase_li_consultas`
--

CREATE TABLE `ase_li_consultas` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento. Lista de consultas: Estudios, permisos trabaj';

--
-- Table structure for table `ase_li_consultas_acog`
--

CREATE TABLE `ase_li_consultas_acog` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ase_li_consultas_acog2`
--

CREATE TABLE `ase_li_consultas_acog2` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ase_li_ocupaciones`
--

CREATE TABLE `ase_li_ocupaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 COMMENT='Asesoramiento. Ocupaciones: Albañil, agricultura, ...';

--
-- Table structure for table `ase_otros`
--

CREATE TABLE `ase_otros` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_centro` tinyint unsigned DEFAULT NULL,
  `id_ocupacion` tinyint unsigned DEFAULT NULL,
  `fecha_lleg` date DEFAULT NULL,
  `casado` tinyint unsigned DEFAULT NULL,
  `familia_esp` tinyint unsigned DEFAULT NULL,
  `familia_orig` tinyint unsigned DEFAULT NULL,
  `tipo_vivienda` tinyint unsigned DEFAULT NULL,
  `discapacidad` tinyint unsigned DEFAULT NULL,
  `violencia_genero` tinyint unsigned DEFAULT NULL,
  `exclusion_social` tinyint unsigned DEFAULT NULL,
  `perceptor_desempleo` tinyint unsigned DEFAULT NULL,
  `alta_SEPE` date DEFAULT NULL,
  `obs_inserc` text,
  `derivado_por` varchar(255) DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_centro` (`id_centro`),
  KEY `id_ocupacion` (`id_ocupacion`),
  KEY `centro_origen_2` (`centro_origen`,`idusuario`),
  CONSTRAINT `ase_otros_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ase_otros_ibfk_2` FOREIGN KEY (`id_centro`) REFERENCES `ase_li_centros` (`id`),
  CONSTRAINT `ase_otros_ibfk_3` FOREIGN KEY (`id_ocupacion`) REFERENCES `ase_li_ocupaciones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Asesoramiento jurid. Otros';

--
-- Table structure for table `aux_beneficiarios`
--

CREATE TABLE `aux_beneficiarios` (
  `id_original` mediumint unsigned NOT NULL DEFAULT '0',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `pais` tinyint unsigned DEFAULT NULL,
  `pasaporte` varchar(15) DEFAULT NULL,
  `nie` varchar(9) DEFAULT NULL,
  `s_adminis` varchar(15) DEFAULT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  `apellidos` varchar(100) DEFAULT NULL,
  `f_nacimiento` date NOT NULL DEFAULT '0000-00-00',
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `dir0` varchar(150) DEFAULT NULL,
  `dir1` varchar(150) DEFAULT NULL,
  `dir2` varchar(150) DEFAULT NULL,
  `tlf` varchar(150) DEFAULT NULL,
  `nivel_est` varchar(26) DEFAULT NULL,
  `s_laboral` varchar(7) DEFAULT NULL,
  `desempleo` varchar(15) DEFAULT NULL,
  `observaciones` text,
  `f_alta` date NOT NULL DEFAULT '0000-00-00',
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` date NOT NULL DEFAULT '0000-00-00',
  `modificador` varchar(9) NOT NULL DEFAULT '',
  `insertar` tinyint unsigned NOT NULL DEFAULT '0',
  `revisado` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_original`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `becas`
--

CREATE TABLE `becas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `serie` varchar(5) NOT NULL,
  `serie_id` int unsigned NOT NULL,
  `id_centro` tinyint NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `fecha1` date DEFAULT NULL,
  `fecha2` date DEFAULT NULL,
  `concepto` varchar(255) NOT NULL,
  `dias` smallint unsigned DEFAULT NULL,
  `precio_dia` float(8,2) unsigned DEFAULT NULL,
  `mes` date DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `situacion` text,
  `pago` varchar(15) DEFAULT NULL,
  `ccc` varchar(23) DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `fecha_exportacion` date DEFAULT NULL,
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `becas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=17324 DEFAULT CHARSET=latin1;

--
-- Table structure for table `bembea_actuaciones`
--

CREATE TABLE `bembea_actuaciones` (
  `centro_origen` smallint NOT NULL DEFAULT '0',
  `usuario_id` int NOT NULL DEFAULT '0',
  `act_id` smallint NOT NULL DEFAULT '0',
  PRIMARY KEY (`centro_origen`,`usuario_id`,`act_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `benef_extra`
--

CREATE TABLE `benef_extra` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `num_siria` varchar(12) DEFAULT NULL,
  `siria_fecha` date DEFAULT NULL,
  `sit_legal` varchar(50) DEFAULT NULL,
  `denegac_spi` date DEFAULT NULL,
  `alta_sanitaria` date DEFAULT NULL,
  `uc_tit_id` varchar(20) DEFAULT NULL,
  `uc_tit_nom` varchar(255) DEFAULT NULL,
  `uc_numero` tinyint(1) DEFAULT NULL,
  `vulnerable` tinyint(1) NOT NULL DEFAULT '0',
  `prorroga_incond` tinyint(1) NOT NULL DEFAULT '0',
  `entrada_sis` date DEFAULT NULL,
  `fase0_ini` date DEFAULT NULL,
  `fase0_fin` date DEFAULT NULL,
  `fase1_ini` date DEFAULT NULL,
  `fase2_ini` date DEFAULT NULL,
  `fase3_ini` date DEFAULT NULL,
  `fases_fin` date DEFAULT NULL,
  `autor` varchar(9) DEFAULT NULL,
  `edic` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `fin_estancia_empleo` date DEFAULT NULL,
  `exp_apatrida` varchar(20) DEFAULT NULL,
  `fase2_ini_real` date DEFAULT NULL,
  `fases_fin_real` date DEFAULT NULL,
  `id_motivo_salida_fase2` smallint unsigned DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  KEY `centro_origen` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `clases_cursos_i`
--

CREATE TABLE `clases_cursos_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `nivel1` tinyint unsigned NOT NULL,
  `baja` date DEFAULT '0000-00-00',
  `nivel2` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;

--
-- Table structure for table `clases_seguimientos`
--

CREATE TABLE `clases_seguimientos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;

--
-- Table structure for table `cno11`
--

CREATE TABLE `cno11` (
  `id` char(4) NOT NULL DEFAULT '',
  `nombre` varchar(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `cno94`
--

CREATE TABLE `cno94` (
  `id` char(2) NOT NULL DEFAULT '',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `comunidades_esp`
--

CREATE TABLE `comunidades_esp` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(22) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `coordina` varchar(9) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `demandas_lab`
--

CREATE TABLE `demandas_lab` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL,
  `cno` char(4) NOT NULL,
  `descripcion` varchar(255) NOT NULL DEFAULT '',
  `disp_geog` tinyint unsigned DEFAULT NULL,
  `disp_temp` varchar(30) DEFAULT NULL,
  `disp_temp1` tinyint unsigned NOT NULL DEFAULT '0',
  `disp_temp2` tinyint unsigned NOT NULL DEFAULT '0',
  `caducada` tinyint unsigned NOT NULL DEFAULT '0',
  `obs` text,
  `fecha_ins` date DEFAULT NULL,
  `rel_accion` tinyint unsigned DEFAULT NULL,
  `id_oferta` int unsigned DEFAULT NULL,
  `cif_contrato` varchar(9) DEFAULT NULL,
  `id_tipo_contrato` tinyint unsigned DEFAULT NULL,
  `id_mod_contrato` tinyint unsigned DEFAULT NULL,
  `id_sector_act` tinyint unsigned DEFAULT NULL,
  `fecha_renov` date DEFAULT NULL,
  `fecha_final` date DEFAULT NULL,
  `id_motivo` tinyint unsigned DEFAULT NULL,
  `id_sit_6meses` tinyint unsigned DEFAULT NULL,
  `id_sit_1ano` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `cno` (`cno`),
  KEY `disp_geog` (`disp_geog`),
  KEY `id_oferta` (`id_oferta`),
  KEY `id_tipo_contrato` (`id_tipo_contrato`),
  KEY `id_mod_contrato` (`id_mod_contrato`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `id_motivo` (`id_motivo`),
  KEY `id_sit_6meses` (`id_sit_6meses`),
  KEY `id_sit_1ano` (`id_sit_1ano`),
  KEY `disp_temp1` (`disp_temp1`),
  KEY `disp_temp2` (`disp_temp2`),
  CONSTRAINT `demandas_lab_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `demandas_lab_ibfk_10` FOREIGN KEY (`id_sit_1ano`) REFERENCES `li_ofert_situac` (`id`),
  CONSTRAINT `demandas_lab_ibfk_3` FOREIGN KEY (`disp_geog`) REFERENCES `li_disp_geog` (`id`),
  CONSTRAINT `demandas_lab_ibfk_4` FOREIGN KEY (`id_oferta`) REFERENCES `emp_ofertas` (`id`),
  CONSTRAINT `demandas_lab_ibfk_5` FOREIGN KEY (`id_tipo_contrato`) REFERENCES `emp_t_contrato` (`id`),
  CONSTRAINT `demandas_lab_ibfk_6` FOREIGN KEY (`id_mod_contrato`) REFERENCES `emp_m_contrato` (`id`),
  CONSTRAINT `demandas_lab_ibfk_7` FOREIGN KEY (`id_sector_act`) REFERENCES `sectores_act` (`id`),
  CONSTRAINT `demandas_lab_ibfk_8` FOREIGN KEY (`id_motivo`) REFERENCES `li_ofert_motivo` (`id`),
  CONSTRAINT `demandas_lab_ibfk_9` FOREIGN KEY (`id_sit_6meses`) REFERENCES `li_ofert_situac` (`id`),
  CONSTRAINT `demandas_lab_ibfka_10` FOREIGN KEY (`disp_temp1`) REFERENCES `li_disp_t1` (`id`),
  CONSTRAINT `demandas_lab_ibfka_11` FOREIGN KEY (`disp_temp2`) REFERENCES `li_disp_t2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=81358 DEFAULT CHARSET=latin1;

--
-- Table structure for table `direcc_postal`
--

CREATE TABLE `direcc_postal` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_provincia` tinyint unsigned NOT NULL,
  `id_municipio` tinyint unsigned NOT NULL,
  `calle_num` varchar(150) NOT NULL,
  `cp` char(5) NOT NULL,
  `poblacion` varchar(150) NOT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  KEY `id_provincia` (`id_provincia`),
  KEY `id_municipio` (`id_municipio`),
  CONSTRAINT `direcc_postal_ibfk_1` FOREIGN KEY (`id_provincia`) REFERENCES `provincias_esp` (`id`),
  CONSTRAINT `direcc_postal_ibfk_2` FOREIGN KEY (`id_municipio`) REFERENCES `municipios_esp` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `emer_tmp`
--

CREATE TABLE `emer_tmp` (
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`centro`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_cnae`
--

CREATE TABLE `emp_cnae` (
  `id` char(3) NOT NULL DEFAULT '',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_federaciones`
--

CREATE TABLE `emp_federaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_listsderiv`
--

CREATE TABLE `emp_listsderiv` (
  `id_oferta` int unsigned NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_proy` smallint unsigned DEFAULT NULL,
  `fecha_derivacion` date DEFAULT NULL,
  `fecha_entrevista` date DEFAULT NULL,
  `acude` binary(1) DEFAULT NULL,
  `fecha_result` date DEFAULT NULL,
  `selecc` binary(1) DEFAULT NULL,
  `obs` tinytext,
  PRIMARY KEY (`id_oferta`,`centro_origen`,`idusuario`),
  CONSTRAINT `emp_listsderiv_ibfk_1` FOREIGN KEY (`id_oferta`) REFERENCES `emp_ofertas` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_m_contrato`
--

CREATE TABLE `emp_m_contrato` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_ofertas`
--

CREATE TABLE `emp_ofertas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date DEFAULT NULL,
  `cno` char(4) NOT NULL,
  `descripcion` varchar(255) NOT NULL DEFAULT '',
  `tareas` varchar(255) DEFAULT NULL,
  `lugar` varchar(255) NOT NULL DEFAULT '',
  `puestos` smallint unsigned NOT NULL DEFAULT '0',
  `disponibles` smallint unsigned NOT NULL DEFAULT '0',
  `con_entrevista` tinyint unsigned NOT NULL DEFAULT '0',
  `tipo_contrato` tinyint unsigned DEFAULT NULL,
  `modalidad_contrato` tinyint unsigned DEFAULT NULL,
  `salario` varchar(255) DEFAULT NULL,
  `forma_pago` varchar(255) DEFAULT NULL,
  `sexo` enum('H','M') DEFAULT NULL,
  `edad_min` tinyint unsigned DEFAULT NULL,
  `edad_max` tinyint unsigned DEFAULT NULL,
  `disp_geog` tinyint unsigned DEFAULT NULL,
  `disp_temp` varchar(30) DEFAULT NULL,
  `disp_temp1` tinyint unsigned DEFAULT NULL,
  `disp_temp2` tinyint unsigned DEFAULT NULL,
  `regularizado` tinyint unsigned DEFAULT NULL,
  `discapacidad` tinyint unsigned DEFAULT NULL,
  `exclusion_social` tinyint unsigned DEFAULT NULL,
  `sector_eco` tinyint unsigned DEFAULT NULL,
  `amb_territorial` tinyint unsigned DEFAULT NULL,
  `nivel_estudios` tinyint unsigned DEFAULT NULL,
  `idioma1` tinyint unsigned DEFAULT NULL,
  `niv_idioma1` tinyint unsigned DEFAULT NULL,
  `idioma2` tinyint unsigned DEFAULT NULL,
  `niv_idioma2` tinyint unsigned DEFAULT NULL,
  `carnet_conducir` tinyint unsigned DEFAULT NULL,
  `coche_propio` tinyint unsigned DEFAULT NULL,
  `experiencia_min` tinyint unsigned DEFAULT NULL,
  `obs` text,
  `nif_tecnico` varchar(10) DEFAULT NULL,
  `id_entidad` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  KEY `cno` (`cno`),
  KEY `tipo_contrato` (`tipo_contrato`),
  KEY `modalidad_contrato` (`modalidad_contrato`),
  KEY `sector_eco` (`sector_eco`),
  KEY `amb_territorial` (`amb_territorial`),
  KEY `nivel_estudios` (`nivel_estudios`),
  KEY `idioma1` (`idioma1`),
  KEY `idioma2` (`idioma2`),
  KEY `disp_geog` (`disp_geog`),
  KEY `disp_temp1` (`disp_temp1`),
  KEY `disp_temp2` (`disp_temp2`),
  KEY `fk-entidades-id_entidad` (`id_entidad`),
  CONSTRAINT `emp_ofertas_ibfk_10` FOREIGN KEY (`disp_geog`) REFERENCES `li_disp_geog` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_3` FOREIGN KEY (`tipo_contrato`) REFERENCES `emp_t_contrato` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_4` FOREIGN KEY (`modalidad_contrato`) REFERENCES `emp_m_contrato` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_5` FOREIGN KEY (`sector_eco`) REFERENCES `li_permiso_sector_eco` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_6` FOREIGN KEY (`amb_territorial`) REFERENCES `li_permiso_amb_territ` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_7` FOREIGN KEY (`nivel_estudios`) REFERENCES `li_nivel_est` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_8` FOREIGN KEY (`idioma1`) REFERENCES `li_idiomas` (`id`),
  CONSTRAINT `emp_ofertas_ibfk_9` FOREIGN KEY (`idioma2`) REFERENCES `li_idiomas` (`id`),
  CONSTRAINT `emp_ofertas_ibfka_10` FOREIGN KEY (`disp_temp1`) REFERENCES `li_disp_t1` (`id`),
  CONSTRAINT `emp_ofertas_ibfka_11` FOREIGN KEY (`disp_temp2`) REFERENCES `li_disp_t2` (`id`),
  CONSTRAINT `fk-entidades-id_entidad` FOREIGN KEY (`id_entidad`) REFERENCES `entidades` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9330 DEFAULT CHARSET=latin1;

--
-- Table structure for table `emp_seguimiento`
--

CREATE TABLE `emp_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_empresa` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`id_empresa`),
  CONSTRAINT `emp_seguimiento_ibfk_1` FOREIGN KEY (`centro_origen`, `id_empresa`) REFERENCES `empresas` (`centro_origen`, `id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9201 DEFAULT CHARSET=latin1 COMMENT='Seguimiento de empresas';

--
-- Table structure for table `emp_t_contrato`
--

CREATE TABLE `emp_t_contrato` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

--
-- Table structure for table `empresas`
--

CREATE TABLE `empresas` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `cif` varchar(9) DEFAULT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  `marca` varchar(100) DEFAULT NULL,
  `n_trabaj` varchar(20) DEFAULT NULL,
  `id_federacion` tinyint unsigned DEFAULT NULL,
  `id_sector_act` tinyint unsigned NOT NULL DEFAULT '0',
  `id_cnae` char(3) NOT NULL DEFAULT '',
  `contactos` text,
  `atencion_de` varchar(150) DEFAULT NULL,
  `dir0` varchar(150) DEFAULT NULL,
  `dir1` varchar(150) DEFAULT NULL,
  `dir2` varchar(150) DEFAULT NULL,
  `tlf` varchar(150) DEFAULT NULL,
  `fax` varchar(150) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `web` varchar(150) DEFAULT NULL,
  `observaciones` text,
  `activo` tinyint(1) DEFAULT NULL,
  `f_alta` date NOT NULL DEFAULT '1900-01-01',
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` date NOT NULL DEFAULT '1900-01-01',
  `modificador` varchar(9) NOT NULL DEFAULT '',
  `estadist` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`centro_origen`,`id`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `id_federacion` (`id_federacion`),
  KEY `id_cnae` (`id_cnae`),
  CONSTRAINT `empresas_ibfk_1` FOREIGN KEY (`id_sector_act`) REFERENCES `sectores_act` (`id`),
  CONSTRAINT `empresas_ibfk_2` FOREIGN KEY (`id_federacion`) REFERENCES `emp_federaciones` (`id`),
  CONSTRAINT `empresas_ibfk_3` FOREIGN KEY (`id_cnae`) REFERENCES `emp_cnae` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `ent_cnae`
--

CREATE TABLE `ent_cnae` (
  `id` char(3) NOT NULL,
  `padre` char(3) DEFAULT NULL,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `entidades`
--

CREATE TABLE `entidades` (
  `id` int NOT NULL AUTO_INCREMENT,
  `cif` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id_pais` tinyint unsigned NOT NULL DEFAULT '67',
  `nombre` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `marca` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `n_trabaj` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_federacion` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_sector_act` tinyint(1) DEFAULT NULL,
  `id_cnae` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `web` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `observaciones` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci,
  `activo` tinyint(1) NOT NULL,
  `f_alta` date NOT NULL,
  `f_modif` date DEFAULT NULL,
  `creador` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `modificador` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `estadist` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `id_madre` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_cif_pais_id` (`cif`,`id_pais`,`id`),
  UNIQUE KEY `unique_cif_pais_nombre` (`cif`,`id_pais`,`nombre`,`id_madre`),
  KEY `id_madre` (`id_madre`)
) ENGINE=InnoDB AUTO_INCREMENT=10463 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `entidades_subs`
--

CREATE TABLE `entidades_subs` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `entidad_cif` varchar(9) NOT NULL,
  `entidad_pais` tinyint NOT NULL DEFAULT '67',
  `nombre` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=220 DEFAULT CHARSET=latin1;

--
-- Table structure for table `entidades_tipos`
--

CREATE TABLE `entidades_tipos` (
  `id_tipo` varchar(30) NOT NULL,
  `id_entidad` int NOT NULL,
  PRIMARY KEY (`id_tipo`,`id_entidad`),
  KEY `entidades_tipos_ibfk_1` (`id_entidad`),
  CONSTRAINT `entidades_tipos_ibfk_1` FOREIGN KEY (`id_entidad`) REFERENCES `entidades` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `epes_becas`
--

CREATE TABLE `epes_becas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ano` char(4) NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `fecha1` date NOT NULL DEFAULT '0000-00-00',
  `fecha2` date NOT NULL DEFAULT '0000-00-00',
  `faltas` tinyint NOT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `id_centro` tinyint NOT NULL,
  `ccc` varchar(23) NOT NULL,
  `funcion` varchar(100) NOT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  CONSTRAINT `epes_becas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=1869 DEFAULT CHARSET=latin1;

--
-- Table structure for table `epes_compromisos`
--

CREATE TABLE `epes_compromisos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ano` char(4) NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `empresa` varchar(250) NOT NULL,
  `repre_empresa` varchar(100) DEFAULT NULL,
  `cargo_empresa` varchar(50) DEFAULT NULL,
  `meses` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  CONSTRAINT `epes_compromisos_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=870 DEFAULT CHARSET=latin1;

--
-- Table structure for table `epes_seguim`
--

CREATE TABLE `epes_seguim` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  `nif` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=8407 DEFAULT CHARSET=latin1;

--
-- Table structure for table `estadist_tablas_proy`
--

CREATE TABLE `estadist_tablas_proy` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `tabla` varchar(40) DEFAULT NULL,
  `id_proyecto` int unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=463 DEFAULT CHARSET=latin1;

--
-- Table structure for table `estancias_previas`
--

CREATE TABLE `estancias_previas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha_ini` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `centro` varchar(255) DEFAULT NULL,
  `obs` varchar(255) DEFAULT NULL,
  `meses_ministerio` tinyint NOT NULL DEFAULT '0',
  `dias_ministerio` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1433 DEFAULT CHARSET=latin1;

--
-- Table structure for table `familias`
--

CREATE TABLE `familias` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL,
  `idusuario` mediumint unsigned NOT NULL,
  `idfamilia` mediumint unsigned NOT NULL,
  `idparentesco` tinyint unsigned NOT NULL,
  `obs` char(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `centro_origen_2` (`centro_origen`,`idusuario`),
  KEY `idparentesco` (`idparentesco`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `idfamilia` (`idfamilia`),
  CONSTRAINT `familias_ibfk_1` FOREIGN KEY (`idparentesco`) REFERENCES `parentescos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53953 DEFAULT CHARSET=latin1;

--
-- Table structure for table `form_carm_seg`
--

CREATE TABLE `form_carm_seg` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=713 DEFAULT CHARSET=latin1;

--
-- Table structure for table `form_gv_seg`
--

CREATE TABLE `form_gv_seg` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=3072 DEFAULT CHARSET=latin1;

--
-- Table structure for table `form_idiomas`
--

CREATE TABLE `form_idiomas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_idioma` tinyint unsigned NOT NULL DEFAULT '0',
  `id_nivel_hablado` tinyint unsigned NOT NULL DEFAULT '0',
  `id_nivel_escrito` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_idioma` (`id_idioma`),
  KEY `id_nivel_hablado` (`id_nivel_hablado`),
  KEY `id_nivel_escrito` (`id_nivel_escrito`),
  CONSTRAINT `form_idiomas_ibfk_1` FOREIGN KEY (`id_idioma`) REFERENCES `li_idiomas` (`id`),
  CONSTRAINT `form_idiomas_ibfk_2` FOREIGN KEY (`id_nivel_hablado`) REFERENCES `li_idiomas_niveles` (`id`),
  CONSTRAINT `form_idiomas_ibfk_3` FOREIGN KEY (`id_nivel_escrito`) REFERENCES `li_idiomas_niveles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=68993 DEFAULT CHARSET=latin1 COMMENT='Formación - Nivel de idiomas';

--
-- Table structure for table `form_no_reglada`
--

CREATE TABLE `form_no_reglada` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) NOT NULL DEFAULT '',
  `ano` smallint unsigned NOT NULL DEFAULT '0',
  `horas` smallint unsigned NOT NULL DEFAULT '0',
  `centro` varchar(80) NOT NULL DEFAULT '',
  `certificada` tinyint unsigned NOT NULL DEFAULT '0',
  `id_pais` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=52431 DEFAULT CHARSET=latin1 COMMENT='Formaciones NO regladas';

--
-- Table structure for table `form_otros`
--

CREATE TABLE `form_otros` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_carnet` tinyint unsigned DEFAULT '0',
  `convalidado` tinyint unsigned DEFAULT NULL,
  `coche_propio` tinyint unsigned DEFAULT NULL,
  `AM` tinyint(1) DEFAULT NULL,
  `A1` tinyint(1) DEFAULT NULL,
  `A2` tinyint(1) DEFAULT NULL,
  `A` tinyint(1) DEFAULT NULL,
  `B` tinyint(1) DEFAULT NULL,
  `B_E` tinyint(1) DEFAULT NULL,
  `C1` tinyint(1) DEFAULT NULL,
  `C1_E` tinyint(1) DEFAULT NULL,
  `C` tinyint(1) DEFAULT NULL,
  `C_E` tinyint(1) DEFAULT NULL,
  `D1` tinyint(1) DEFAULT NULL,
  `D1_E` tinyint(1) DEFAULT NULL,
  `D` tinyint(1) DEFAULT NULL,
  `D_E` tinyint(1) DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_carnet` (`id_carnet`),
  CONSTRAINT `form_otros_ibfk_1` FOREIGN KEY (`id_carnet`) REFERENCES `li_carnets_conducir` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19208 DEFAULT CHARSET=latin1 COMMENT='Historial formativo. Otros';

--
-- Table structure for table `form_reglada`
--

CREATE TABLE `form_reglada` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_ins_est` tinyint unsigned NOT NULL DEFAULT '0',
  `especialidad` varchar(80) DEFAULT NULL,
  `ano` smallint unsigned DEFAULT NULL,
  `convalidado` tinyint unsigned NOT NULL DEFAULT '0',
  `id_pais` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_ins_est` (`id_ins_est`),
  CONSTRAINT `form_reglada_ibfk_1` FOREIGN KEY (`id_ins_est`) REFERENCES `li_ins_estudios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30113 DEFAULT CHARSET=latin1 COMMENT='Formaciones regladas';

--
-- Table structure for table `formacioncarm_cursos`
--

CREATE TABLE `formacioncarm_cursos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `nivel1` tinyint unsigned NOT NULL,
  `baja` date DEFAULT '0000-00-00',
  `nivel2` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_actividades_i`
--

CREATE TABLE `ig_actividades_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL,
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `actividad` varchar(255) DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6919 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_curso_sa_i`
--

CREATE TABLE `ig_curso_sa_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=435 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_curso_sara_i`
--

CREATE TABLE `ig_curso_sara_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_cursos_i`
--

CREATE TABLE `ig_cursos_i` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint NOT NULL,
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2430 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_orientaciones`
--

CREATE TABLE `ig_orientaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=963 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_seguim`
--

CREATE TABLE `ig_seguim` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=7595 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_seguim_sa`
--

CREATE TABLE `ig_seguim_sa` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=1054 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ig_seguim_sara`
--

CREATE TABLE `ig_seguim_sara` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=latin1;

--
-- Table structure for table `incluye_t`
--

CREATE TABLE `incluye_t` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha_alta` date NOT NULL,
  `fecha_baja` date DEFAULT NULL,
  `situacion_laboral` varchar(100) NOT NULL,
  `nivel_educativo` varchar(100) NOT NULL,
  `hogar` varchar(100) NOT NULL,
  `sociales` varchar(100) NOT NULL,
  `ayudas` varchar(100) NOT NULL,
  `diag01` enum('1','2','3') DEFAULT NULL,
  `diag02` enum('1','2','3') DEFAULT NULL,
  `diag03` enum('1','2','3') DEFAULT NULL,
  `diag04` enum('1','2','3') DEFAULT NULL,
  `diag05` enum('1','2','3') DEFAULT NULL,
  `diag06` enum('1','2','3') DEFAULT NULL,
  `diag07` enum('1','2','3') DEFAULT NULL,
  `diag08` enum('1','2','3') DEFAULT NULL,
  `diag09` enum('1','2','3') DEFAULT NULL,
  `diag10` enum('1','2','3') DEFAULT NULL,
  `diag11` enum('1','2','3') DEFAULT NULL,
  `diag12` enum('1','2','3') DEFAULT NULL,
  `diag13` enum('1','2','3') DEFAULT NULL,
  `diag14` enum('1','2','3') DEFAULT NULL,
  `diag15` enum('1','2','3') DEFAULT NULL,
  `diag01_obs` varchar(255) DEFAULT NULL,
  `diag02_obs` varchar(255) DEFAULT NULL,
  `diag03_obs` varchar(255) DEFAULT NULL,
  `diag04_obs` varchar(255) DEFAULT NULL,
  `diag05_obs` varchar(255) DEFAULT NULL,
  `diag06_obs` varchar(255) DEFAULT NULL,
  `diag07_obs` varchar(255) DEFAULT NULL,
  `diag08_obs` varchar(255) DEFAULT NULL,
  `diag09_obs` varchar(255) DEFAULT NULL,
  `diag10_obs` varchar(255) DEFAULT NULL,
  `diag11_obs` varchar(255) DEFAULT NULL,
  `diag12_obs` varchar(255) DEFAULT NULL,
  `diag13_obs` varchar(255) DEFAULT NULL,
  `diag14_obs` varchar(255) DEFAULT NULL,
  `diag15_obs` varchar(255) DEFAULT NULL,
  `obs` text,
  `diag_social` text,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  KEY `centro_origen` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `incluye_t_niveles`
--

CREATE TABLE `incluye_t_niveles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `valor` enum('1','2','3') NOT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=latin1;

--
-- Table structure for table `info_nexos`
--

CREATE TABLE `info_nexos` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL DEFAULT '0',
  `completado` tinyint(1) NOT NULL DEFAULT '0',
  `actuacion` tinyint unsigned DEFAULT NULL,
  `migrante` varchar(40) DEFAULT NULL,
  `discapacidad` varchar(30) DEFAULT NULL,
  `otras_discrim` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='información específica proyecto NEXOS';

--
-- Table structure for table `informes_sociales`
--

CREATE TABLE `informes_sociales` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date DEFAULT NULL,
  `informador` varchar(255) DEFAULT NULL,
  `ciudad_origen` varchar(255) DEFAULT NULL,
  `estado_civil` varchar(255) DEFAULT NULL,
  `obs_personales` varchar(255) DEFAULT NULL,
  `dir_retorno` varchar(255) DEFAULT NULL,
  `dir_espana` varchar(255) DEFAULT NULL,
  `tlf_retorno` varchar(255) DEFAULT NULL,
  `obs_contacto` varchar(255) DEFAULT NULL,
  `sit_economica` text,
  `sit_habitacional` text,
  `otros_familia` varchar(255) DEFAULT NULL,
  `redes_apoyo` text,
  `obs_familia` varchar(255) DEFAULT NULL,
  `obs_estudios` varchar(255) DEFAULT NULL,
  `motivo_retorno` varchar(255) DEFAULT NULL,
  `tipo_vulnerabilidad` varchar(255) DEFAULT NULL,
  `vulnerabilidades` text,
  `documentacion_vul` varchar(255) DEFAULT NULL,
  `proyecto_retorno` varchar(255) DEFAULT NULL,
  `obs_proyecto` varchar(255) DEFAULT NULL,
  `obs_generales` text,
  `familiares_depend_origen` varchar(255) DEFAULT NULL,
  `familiares_depend_espana` varchar(255) DEFAULT NULL,
  `historia` text,
  `situacion` text,
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_autoempleo_i3l`
--

CREATE TABLE `ins_autoempleo_i3l` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` varchar(3) NOT NULL,
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint DEFAULT NULL,
  `derivacion` char(1) DEFAULT 'N',
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_autoempleo_ins`
--

CREATE TABLE `ins_autoempleo_ins` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` int DEFAULT NULL,
  `idusuario` int DEFAULT NULL,
  `inicio` date DEFAULT NULL,
  `empresa_sector` char(1) DEFAULT NULL,
  `fin` date DEFAULT NULL,
  `motivo` varchar(100) DEFAULT NULL,
  `situacion` char(3) DEFAULT NULL,
  `estado_actual` char(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_autoempleo_pe`
--

CREATE TABLE `ins_autoempleo_pe` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` int DEFAULT NULL,
  `idusuario` int DEFAULT NULL,
  `plan_empresa` char(1) DEFAULT NULL,
  `empresa_sector` char(1) DEFAULT NULL,
  `solicitado` float(8,2) DEFAULT NULL,
  `concedido` float(8,2) DEFAULT NULL,
  `banco` varchar(100) DEFAULT NULL,
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_autoempleo_seg`
--

CREATE TABLE `ins_autoempleo_seg` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `seguimiento_6` char(2) DEFAULT NULL,
  `motivo_seg` char(2) DEFAULT NULL,
  `comentario_seg` varchar(100) DEFAULT NULL,
  `rel_formacion_seg` char(1) DEFAULT NULL,
  `observaciones_seg` varchar(200) DEFAULT NULL,
  `cierre_itinerario` char(1) DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=774 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_ayudas_eco`
--

CREATE TABLE `ins_ayudas_eco` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `cuantia` varchar(6) DEFAULT NULL,
  `concepto` varchar(80) DEFAULT NULL,
  `tipo_ayuda` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2934 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Ayudas económicas';

--
-- Table structure for table `ins_ayudas_eco_carm`
--

CREATE TABLE `ins_ayudas_eco_carm` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `cuantia` varchar(6) DEFAULT NULL,
  `concepto` varchar(80) DEFAULT NULL,
  `tipo_ayuda` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Ayudas económicas';

--
-- Table structure for table `ins_becas`
--

CREATE TABLE `ins_becas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `fecha1` date DEFAULT NULL,
  `fecha2` date DEFAULT NULL,
  `dias` varchar(255) DEFAULT NULL,
  `taller` varchar(255) DEFAULT NULL,
  `concepto` varchar(255) DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `ingresos_mensuales` float(8,2) unsigned DEFAULT NULL,
  `gastos_fijos` float(8,2) unsigned DEFAULT NULL,
  `concepto_ingresos` varchar(50) DEFAULT NULL,
  `id_centro` mediumint NOT NULL,
  `pago` varchar(15) NOT NULL,
  `ccc` varchar(23) DEFAULT NULL,
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `situacion` text,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `fecha_exportacion` date DEFAULT NULL,
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_becas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=2355 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_deriv_a`
--

CREATE TABLE `ins_deriv_a` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_entidad` mediumint unsigned NOT NULL DEFAULT '0',
  `motivo` text NOT NULL,
  `tipo_motivo` char(2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_entidad` (`id_entidad`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_deriv_a_ibfk_1` FOREIGN KEY (`id_entidad`) REFERENCES `li_ins_deriv_a` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17585 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Derivado a otra entidad';

--
-- Table structure for table `ins_deriv_a_carm`
--

CREATE TABLE `ins_deriv_a_carm` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_entidad` mediumint unsigned NOT NULL DEFAULT '0',
  `motivo` text NOT NULL,
  `tipo_motivo` char(2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_entidad` (`id_entidad`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_deriv_a_carm_ibfk_1` FOREIGN KEY (`id_entidad`) REFERENCES `li_ins_deriv_a` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Derivado a otra entidad';

--
-- Table structure for table `ins_deriv_por`
--

CREATE TABLE `ins_deriv_por` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_deriv_por` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_deriv_por` (`id_deriv_por`),
  CONSTRAINT `ins_deriv_por_ibfk_1` FOREIGN KEY (`id_deriv_por`) REFERENCES `li_ins_deriv_por` (`id`),
  CONSTRAINT `ins_deriv_por_ibfk_2` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=24330 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_form_ocup`
--

CREATE TABLE `ins_form_ocup` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `id_sector_act` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `practicas` smallint unsigned NOT NULL DEFAULT '0',
  `mod_ma` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_si` tinyint unsigned NOT NULL DEFAULT '0',
  `cuantia` varchar(6) DEFAULT NULL,
  `concepto` varchar(80) DEFAULT NULL,
  `otros` varchar(80) DEFAULT NULL,
  `fin_formacion` date DEFAULT NULL,
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  `mod_lab` tinyint DEFAULT '0',
  `mod_ig` tinyint DEFAULT '0',
  `proyecto` smallint DEFAULT NULL,
  `id_curso` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cursos_formacion` (`idusuario`,`centro_origen`,`id_curso`,`proyecto`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `expte` (`centro_origen`,`idusuario`),
  KEY `fk_id_curso` (`id_curso`),
  CONSTRAINT `fk_id_curso` FOREIGN KEY (`id_curso`) REFERENCES `i3l`.`curso` (`id`),
  CONSTRAINT `ins_form_ocup_ibfk_1` FOREIGN KEY (`id_sector_act`) REFERENCES `sectores_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6224 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Formaciones ocupacionales';

--
-- Table structure for table `ins_form_ocup_carm`
--

CREATE TABLE `ins_form_ocup_carm` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `nombre` varchar(100) NOT NULL DEFAULT '',
  `id_sector_act` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `practicas` smallint unsigned NOT NULL DEFAULT '0',
  `mod_ma` tinyint unsigned NOT NULL DEFAULT '0',
  `mod_si` tinyint unsigned NOT NULL DEFAULT '0',
  `cuantia` varchar(6) DEFAULT NULL,
  `concepto` varchar(80) DEFAULT NULL,
  `otros` varchar(80) DEFAULT NULL,
  `fin_formacion` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_form_ocup_carm_ibfk_1` FOREIGN KEY (`id_sector_act`) REFERENCES `sectores_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Formaciones ocupacionales';

--
-- Table structure for table `ins_hist_laboral`
--

CREATE TABLE `ins_hist_laboral` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_sector_act` tinyint unsigned NOT NULL DEFAULT '0',
  `cno` char(4) NOT NULL,
  `descripcion` varchar(255) NOT NULL DEFAULT '',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `motivo_cese` varchar(255) DEFAULT NULL,
  `empresa` text,
  `id_pais` tinyint unsigned NOT NULL DEFAULT '0',
  `ano` smallint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_sector_act` (`id_sector_act`),
  KEY `cno` (`cno`),
  CONSTRAINT `ins_hist_laboral_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `ins_hist_laboral_ibfk_2` FOREIGN KEY (`id_sector_act`) REFERENCES `sectores_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137812 DEFAULT CHARSET=latin1 COMMENT='Inserción. Historial laboral';

--
-- Table structure for table `ins_iti_cerrados`
--

CREATE TABLE `ins_iti_cerrados` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `seguimiento_6` char(2) DEFAULT NULL,
  `motivo_seg` char(2) DEFAULT NULL,
  `comentario_seg` varchar(100) DEFAULT NULL,
  `rel_formacion_seg` char(1) DEFAULT NULL,
  `observaciones_seg` varchar(200) DEFAULT NULL,
  `proyecto` int DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_itiautoemp`
--

CREATE TABLE `ins_itiautoemp` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `duracion` int unsigned NOT NULL DEFAULT '0',
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_itiautoemp_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_ins_itiautoemp` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9203 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ins_orient`
--

CREATE TABLE `ins_orient` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_orient_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_ins_orient` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=169837 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Orientaciones sociolaborales';

--
-- Table structure for table `ins_orient_carm`
--

CREATE TABLE `ins_orient_carm` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_orient_carm_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_ins_orient` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1422 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Orientaciones sociolaborales';

--
-- Table structure for table `ins_prefor`
--

CREATE TABLE `ins_prefor` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  `derivacion` char(1) DEFAULT NULL,
  `der_entidad` char(8) DEFAULT NULL,
  `der_desc` varchar(50) DEFAULT NULL,
  `der_mot` varchar(100) DEFAULT NULL,
  `proyecto` smallint DEFAULT NULL,
  `id_curso` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  KEY `fk_id_curso4` (`id_curso`),
  CONSTRAINT `fk_id_curso4` FOREIGN KEY (`id_curso`) REFERENCES `i3l`.`prefor` (`id`),
  CONSTRAINT `ins_prefor_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_ins_prefor` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20804 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Preformaciones';

--
-- Table structure for table `ins_prefor_carm`
--

CREATE TABLE `ins_prefor_carm` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_tipo` tinyint unsigned NOT NULL DEFAULT '0',
  `duracion` smallint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_tipo` (`id_tipo`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ins_prefor_carm_ibfk_1` FOREIGN KEY (`id_tipo`) REFERENCES `li_ins_prefor` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=latin1 COMMENT='Itinerario. Preformaciones';

--
-- Table structure for table `ins_seguimiento`
--

CREATE TABLE `ins_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=214339 DEFAULT CHARSET=latin1 COMMENT='Seguimiento de insercion';

--
-- Table structure for table `insercion_actuaciones`
--

CREATE TABLE `insercion_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `proyecto` int unsigned NOT NULL,
  `tipo` varchar(255) NOT NULL,
  `actuacion` varchar(255) NOT NULL,
  `duracion` int unsigned NOT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=4084 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ja_actuaciones`
--

CREATE TABLE `ja_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_actuacion` tinyint unsigned NOT NULL,
  `id_centro` tinyint unsigned NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  CONSTRAINT `ja_actuaciones_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `ja_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5877 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ja_ayudas`
--

CREATE TABLE `ja_ayudas` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `tipo_ayuda` varchar(35) NOT NULL,
  `mes` varchar(12) NOT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `id_centro` tinyint DEFAULT NULL,
  `situacion` text,
  `pago` varchar(15) DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `fecha_exportacion` date DEFAULT NULL,
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `ja_ayudas_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=282 DEFAULT CHARSET=latin1;

--
-- Table structure for table `ja_li_actuaciones`
--

CREATE TABLE `ja_li_actuaciones` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(155) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_acog_em_ayudas`
--

CREATE TABLE `li_acog_em_ayudas` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `cta_contable` char(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_acog_em_gest`
--

CREATE TABLE `li_acog_em_gest` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_acog_em_resultado`
--

CREATE TABLE `li_acog_em_resultado` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `dispositivo` char(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_carnets_conducir`
--

CREATE TABLE `li_carnets_conducir` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COMMENT='Lista: moto, coche, camión, bus...';

--
-- Table structure for table `li_disp_geog`
--

CREATE TABLE `li_disp_geog` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_disp_t1`
--

CREATE TABLE `li_disp_t1` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_disp_t2`
--

CREATE TABLE `li_disp_t2` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_idiomas`
--

CREATE TABLE `li_idiomas` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_idiomas_niveles`
--

CREATE TABLE `li_idiomas_niveles` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COMMENT='Lista: nada, bajo, medio, alto...';

--
-- Table structure for table `li_ins_deriv_a`
--

CREATE TABLE `li_ins_deriv_a` (
  `id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=390 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''id_entidad'' de tabla ins_de';

--
-- Table structure for table `li_ins_deriv_por`
--

CREATE TABLE `li_ins_deriv_por` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''id_deriv_por'' tabla ins_der';

--
-- Table structure for table `li_ins_estudios`
--

CREATE TABLE `li_ins_estudios` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''estudios'' de tabla form_reg';

--
-- Table structure for table `li_ins_itiautoemp`
--

CREATE TABLE `li_ins_itiautoemp` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `id_i3l` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_ins_orient`
--

CREATE TABLE `li_ins_orient` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `id_i3l` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''id_tipo'' de tabla ins_orien';

--
-- Table structure for table `li_ins_prefor`
--

CREATE TABLE `li_ins_prefor` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  `id_i3l` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''id_tipo'' de tabla ins_prefo';

--
-- Table structure for table `li_lineas_proyectos`
--

CREATE TABLE `li_lineas_proyectos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_area` tinyint NOT NULL,
  `nombre_largo` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `nombre` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx-id_area-nombre-unique` (`id_area`,`nombre`),
  UNIQUE KEY `idx-nombre_largo-unique` (`nombre_largo`),
  CONSTRAINT `fk-li_lineas_proyectos-areas` FOREIGN KEY (`id_area`) REFERENCES `usuarios`.`programas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1271 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_lineas_proyectos_proyectos`
--

CREATE TABLE `li_lineas_proyectos_proyectos` (
  `id_proyecto` smallint unsigned NOT NULL,
  `id_linea` int NOT NULL,
  PRIMARY KEY (`id_proyecto`,`id_linea`),
  KEY `fk-li_lineas_proyectos_proyectos-li_lineas` (`id_linea`),
  CONSTRAINT `fk-li_lineas_proyectos-proyectos` FOREIGN KEY (`id_proyecto`) REFERENCES `proyectos` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `fk-li_lineas_proyectos_proyectos-li_lineas` FOREIGN KEY (`id_linea`) REFERENCES `li_lineas_proyectos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_lineas_proyectos_usuarios`
--

CREATE TABLE `li_lineas_proyectos_usuarios` (
  `id_linea` int NOT NULL,
  `nif` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  PRIMARY KEY (`id_linea`,`nif`),
  KEY `fk-li_lineas_proyectos_usuarios-usuarios` (`nif`),
  CONSTRAINT `fk-li_lineas_proyectos_usuarios-li_lineas` FOREIGN KEY (`id_linea`) REFERENCES `li_lineas_proyectos` (`id`),
  CONSTRAINT `fk-li_lineas_proyectos_usuarios-usuarios` FOREIGN KEY (`nif`) REFERENCES `usuarios`.`usuarios` (`nif`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_multiples_catalogo_lineas_proy`
--

CREATE TABLE `li_multiples_catalogo_lineas_proy` (
  `id_linea` int NOT NULL,
  `id_catalogo` int unsigned NOT NULL,
  PRIMARY KEY (`id_linea`,`id_catalogo`),
  KEY `fk-li_multiples_catalogo_lineas_proy-catalogo` (`id_catalogo`),
  CONSTRAINT `fk-li_multiples_catalogo_lineas_proy-catalogo` FOREIGN KEY (`id_catalogo`) REFERENCES `beneficiarios`.`multiples_catalogo` (`id`),
  CONSTRAINT `fk-li_multiples_catalogo_lineas_proy-lineas` FOREIGN KEY (`id_linea`) REFERENCES `li_lineas_proyectos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `li_nivel_est`
--

CREATE TABLE `li_nivel_est` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_nivel_idioma`
--

CREATE TABLE `li_nivel_idioma` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_ofert_motivo`
--

CREATE TABLE `li_ofert_motivo` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_ofert_situac`
--

CREATE TABLE `li_ofert_situac` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_permiso_amb_territ`
--

CREATE TABLE `li_permiso_amb_territ` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_permiso_sector_eco`
--

CREATE TABLE `li_permiso_sector_eco` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tipo_notif`
--

CREATE TABLE `li_tipo_notif` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tipo` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_tipos_entidad`
--

CREATE TABLE `li_tipos_entidad` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_v_asignacion`
--

CREATE TABLE `li_v_asignacion` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_v_aytos`
--

CREATE TABLE `li_v_aytos` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `li_v_tenencia`
--

CREATE TABLE `li_v_tenencia` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `lista_deriv_a`
--

CREATE TABLE `lista_deriv_a` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''derivado_a'' de tabla acog';

--
-- Table structure for table `lista_deriv_por`
--

CREATE TABLE `lista_deriv_por` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `proyecto` smallint unsigned NOT NULL DEFAULT '1',
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=latin1 COMMENT='Lista de valores posibles campo ''derivado_por'' de tabla acog';

--
-- Table structure for table `med_acciones`
--

CREATE TABLE `med_acciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_ambito` tinyint unsigned NOT NULL,
  `id_tipointerv` tinyint unsigned NOT NULL,
  `id_programa` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_ambito` (`id_ambito`),
  KEY `id_tipointerv` (`id_tipointerv`),
  KEY `id_programa` (`id_programa`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `med_acciones_ibfk_1` FOREIGN KEY (`id_ambito`) REFERENCES `med_li_ambito` (`id`),
  CONSTRAINT `med_acciones_ibfk_2` FOREIGN KEY (`id_tipointerv`) REFERENCES `med_li_tipointerv` (`id`),
  CONSTRAINT `med_acciones_ibfk_3` FOREIGN KEY (`id_programa`) REFERENCES `med_li_programa` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10418 DEFAULT CHARSET=latin1;

--
-- Table structure for table `med_com_seguimiento`
--

CREATE TABLE `med_com_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=8737 DEFAULT CHARSET=latin1 COMMENT='Mediac. comunitaria (Sevilla)';

--
-- Table structure for table `med_informes`
--

CREATE TABLE `med_informes` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `d1` text,
  `d2` text,
  `d3` text,
  `d4` text,
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `med_li_ambito`
--

CREATE TABLE `med_li_ambito` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Table structure for table `med_li_programa`
--

CREATE TABLE `med_li_programa` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;

--
-- Table structure for table `med_li_tipointerv`
--

CREATE TABLE `med_li_tipointerv` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `memoria`
--

CREATE TABLE `memoria` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  `fecha` date DEFAULT NULL,
  `tabla` varchar(255) NOT NULL,
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`id`),
  KEY `tabla` (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `mnd`
--

CREATE TABLE `mnd` (
  `id_modulo` int unsigned NOT NULL DEFAULT '0',
  `id_modulo_fam` int unsigned DEFAULT NULL,
  `id_proyecto` int unsigned NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `modulos`
--

CREATE TABLE `modulos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(75) NOT NULL,
  `link` varchar(50) NOT NULL DEFAULT '',
  `tipo` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=295 DEFAULT CHARSET=latin1;

--
-- Table structure for table `modulos_proy`
--

CREATE TABLE `modulos_proy` (
  `id_modulo` int unsigned NOT NULL DEFAULT '0',
  `id_modulo_fam` int unsigned DEFAULT NULL,
  `id_proyecto` int unsigned NOT NULL DEFAULT '0',
  UNIQUE KEY `unique_modulos_proy` (`id_modulo`,`id_modulo_fam`,`id_proyecto`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `municipios`
--

CREATE TABLE `municipios` (
  `prov_id` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `mun_id` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL DEFAULT '',
  `nombre` varchar(70) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `id` int NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `prov-mun-unique` (`prov_id`,`mun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8116 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `municipios_esp`
--

CREATE TABLE `municipios_esp` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `id_provincia` tinyint unsigned NOT NULL,
  `nombre` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_provincia` (`id_provincia`),
  CONSTRAINT `municipios_esp_ibfk_1` FOREIGN KEY (`id_provincia`) REFERENCES `provincias_esp` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;

--
-- Table structure for table `nexos_actuaciones`
--

CREATE TABLE `nexos_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `proyecto` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(60) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 COMMENT='Actuaciones proyecto NEXOS';

--
-- Table structure for table `nies`
--

CREATE TABLE `nies` (
  `nie` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `notificaciones`
--

CREATE TABLE `notificaciones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_tipo` int NOT NULL,
  `id_proy` int DEFAULT NULL,
  `centro` smallint DEFAULT NULL,
  `Observaciones` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `Usuario` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci NOT NULL,
  `Fecha_creacion` date NOT NULL,
  `Resuelto` tinyint(1) NOT NULL DEFAULT '0',
  `Autor` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci DEFAULT NULL,
  `Fecha_res` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25967 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `pagos_alquileres`
--

CREATE TABLE `pagos_alquileres` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `serie` varchar(5) NOT NULL,
  `serie_id` int unsigned NOT NULL,
  `id_centro` tinyint NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `mes` date DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `dni_arrendador` varchar(10) NOT NULL,
  `nombre_arrendador` varchar(255) NOT NULL,
  `domicilio_vivienda` varchar(255) NOT NULL,
  `observaciones` varchar(255) DEFAULT NULL,
  `historia` text,
  `situacion` text,
  `pago` varchar(15) DEFAULT NULL,
  `ccc` varchar(23) DEFAULT NULL,
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `fecha_exportacion` date DEFAULT NULL,
  `impresa` binary(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `pagos_alquileres_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=402 DEFAULT CHARSET=latin1;

--
-- Table structure for table `paises`
--

CREATE TABLE `paises` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` char(35) DEFAULT NULL,
  `iso` smallint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=latin1;

--
-- Table structure for table `parentescos`
--

CREATE TABLE `parentescos` (
  `id` tinyint unsigned NOT NULL,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `pat_2016_antiguo`
--

CREATE TABLE `pat_2016_antiguo` (
  `nom_centro` varchar(25) DEFAULT '',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `tabla` varchar(255) NOT NULL,
  `actuacion` varchar(255) DEFAULT NULL,
  `nom_area` varchar(80) DEFAULT NULL,
  `nom` varchar(201) DEFAULT NULL,
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `f_nacimiento` date NOT NULL,
  `origen` char(35) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `pat_2016_nuevo`
--

CREATE TABLE `pat_2016_nuevo` (
  `nom_centro` varchar(25) DEFAULT '',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `nom_proy` varchar(80) DEFAULT NULL,
  `fmto` varchar(80) DEFAULT NULL,
  `actuacion` varchar(255) DEFAULT NULL,
  `nom_area` varchar(80) DEFAULT NULL,
  `nom` varchar(201) DEFAULT NULL,
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `f_nacimiento` date NOT NULL,
  `origen` char(35) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `pat_2017_antiguo`
--

CREATE TABLE `pat_2017_antiguo` (
  `nom_centro` varchar(25) DEFAULT '',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `tabla` varchar(255) NOT NULL,
  `actuacion` varchar(255) DEFAULT NULL,
  `nom_area` varchar(80) DEFAULT NULL,
  `nom` varchar(201) DEFAULT NULL,
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `f_nacimiento` date NOT NULL,
  `origen` char(35) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `pat_2017_nuevo`
--

CREATE TABLE `pat_2017_nuevo` (
  `nom_centro` varchar(25) DEFAULT '',
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `nom_proy` varchar(80) DEFAULT NULL,
  `fmto` varchar(80) DEFAULT NULL,
  `actuacion` varchar(255) DEFAULT NULL,
  `nom_area` varchar(80) DEFAULT NULL,
  `nom` varchar(201) DEFAULT NULL,
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `f_nacimiento` date NOT NULL,
  `origen` char(35) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `pat_tabla_actuacion`
--

CREATE TABLE `pat_tabla_actuacion` (
  `tabla` varchar(255) NOT NULL,
  `actuacion` varchar(255) NOT NULL,
  `area` int NOT NULL,
  PRIMARY KEY (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `periodos`
--

CREATE TABLE `periodos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `idusuario` int NOT NULL,
  `centro_origen` int NOT NULL,
  `fecha_ini` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Table structure for table `personas_vulnerables`
--

CREATE TABLE `personas_vulnerables` (
  `id` enum('Personas pertenecientes a una minoría étnica','Personas víctimas de violencia de género','Personas víctimas de trata o prostituidas','Personas sin hogar','Personas que sufren de privación material severa','Personaspenadas en instituciones penitenciarias o con medidas judiciales','Personas con algún tipo de enfermedad mental','Personas con problemas de adicción') NOT NULL,
  `centro_origen` tinyint NOT NULL,
  `idusuario` mediumint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `plazas_acogida_diarias`
--

CREATE TABLE `plazas_acogida_diarias` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `id_comunidad` tinyint unsigned DEFAULT NULL,
  `nom_comunidad` varchar(22) DEFAULT NULL,
  `cod_post` char(2) DEFAULT NULL,
  `nom_provincia` varchar(25) DEFAULT NULL,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `nom_centro` varchar(25) DEFAULT '',
  `nom_direcc` varchar(255) DEFAULT '',
  `SIRIA_num` varchar(5) DEFAULT NULL,
  `SIRIA_nom` varchar(255) DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `nom_usuario` varchar(201) DEFAULT NULL,
  `num_siria` varchar(12) DEFAULT NULL,
  `covid19` enum('aislamiento','cuarentena','diagnosticado') DEFAULT NULL,
  `nom_proyecto` varchar(150) DEFAULT NULL,
  `tipo` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `estado` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=978841 DEFAULT CHARSET=latin1;

--
-- Table structure for table `poblaciones`
--

CREATE TABLE `poblaciones` (
  `cod_postal` varchar(5) NOT NULL DEFAULT '0',
  `poblacion` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`cod_postal`,`poblacion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `provincias_esp`
--

CREATE TABLE `provincias_esp` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(25) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `cod_post` char(2) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `comunidad` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cod_post` (`cod_post`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;

--
-- Table structure for table `proyectos`
--

CREATE TABLE `proyectos` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  `nombre_financiador` varchar(500) DEFAULT NULL,
  `f_ini` date DEFAULT NULL,
  `f_fin` date DEFAULT NULL,
  `id_area` tinyint unsigned DEFAULT NULL,
  `registro_horario` tinyint(1) DEFAULT NULL,
  `fse` tinyint(1) DEFAULT NULL,
  `fse_eje` enum('POISES_empleo','POISES_igualdad','POEJ','POISES_diversidad') DEFAULT NULL,
  `tipo` tinyint DEFAULT NULL,
  `iti_entidad` varchar(30) DEFAULT NULL,
  `iti_proyecto` varchar(50) DEFAULT NULL,
  `centro` tinyint unsigned DEFAULT NULL,
  `caducado` tinyint(1) NOT NULL DEFAULT '0',
  `visibilidad` enum('sólo informática','nadie (caducado)','sólo coordinación y proyectos') DEFAULT NULL,
  `registro_actuaciones` tinyint(1) DEFAULT NULL,
  `exportacion_I3L` enum('A','M','P') DEFAULT NULL,
  `fecha_alta` date DEFAULT NULL,
  `imagen1` varchar(255) DEFAULT NULL,
  `ancho1` tinyint unsigned DEFAULT NULL,
  `imagen2` varchar(255) DEFAULT NULL,
  `ancho2` tinyint unsigned DEFAULT NULL,
  `imagen3` varchar(255) DEFAULT NULL,
  `ancho3` tinyint unsigned DEFAULT NULL,
  `imagen4` varchar(255) DEFAULT NULL,
  `ancho4` tinyint unsigned DEFAULT NULL,
  `exp_financiador` varchar(255) DEFAULT NULL,
  `alta_baja_siria` tinyint(1) NOT NULL DEFAULT '0',
  `f_mem_intermedia` date DEFAULT NULL,
  `f_mem_final` date DEFAULT NULL,
  `creacion_formaciones` tinyint(1) NOT NULL DEFAULT '0',
  `gestion_nueva_formaciones` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8889 DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_actuac_centros`
--

CREATE TABLE `rd4_actuac_centros` (
  `id_centro` tinyint unsigned NOT NULL DEFAULT '0',
  `id_actuacion` tinyint unsigned NOT NULL DEFAULT '0',
  `otras_ayudas` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_centro`,`id_actuacion`),
  KEY `rd4_actuac_centros_ibfk_1` (`id_actuacion`),
  CONSTRAINT `rd4_actuac_centros_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `rd4_li_actuaciones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_cursos`
--

CREATE TABLE `rd4_cursos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `nivel1` tinyint unsigned NOT NULL,
  `baja` date DEFAULT '0000-00-00',
  `nivel2` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1557 DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_e_autonomia`
--

CREATE TABLE `rd4_e_autonomia` (
  `centro_origen` tinyint unsigned NOT NULL,
  `id` mediumint unsigned NOT NULL,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_e_centros`
--

CREATE TABLE `rd4_e_centros` (
  `centro_origen` tinyint unsigned NOT NULL,
  `id` mediumint unsigned NOT NULL,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_e_hogares`
--

CREATE TABLE `rd4_e_hogares` (
  `centro_origen` tinyint unsigned NOT NULL,
  `id` mediumint unsigned NOT NULL,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_e_urgencia`
--

CREATE TABLE `rd4_e_urgencia` (
  `centro_origen` tinyint unsigned NOT NULL,
  `id` mediumint unsigned NOT NULL,
  PRIMARY KEY (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_especie`
--

CREATE TABLE `rd4_especie` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_centro` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned DEFAULT NULL,
  `actuacion` tinyint unsigned DEFAULT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `fecha1` date DEFAULT NULL,
  `fecha2` date DEFAULT NULL,
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `n_factura` varchar(255) DEFAULT NULL,
  `proveedor` varchar(255) DEFAULT NULL,
  `tipo_ayuda` varchar(255) NOT NULL,
  `obs` text,
  `id_actuacion` tinyint unsigned NOT NULL,
  `impresa` binary(1) DEFAULT '0',
  `listada` binary(1) NOT NULL DEFAULT '0',
  `exportada` binary(1) NOT NULL DEFAULT '0',
  `fecha_exportacion` date DEFAULT NULL,
  `concepto` varchar(255) DEFAULT NULL,
  `historia` text,
  `situacion` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=26989 DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_li_actuaciones`
--

CREATE TABLE `rd4_li_actuaciones` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  `enlace` varchar(20) DEFAULT NULL,
  `proyecto` mediumint DEFAULT NULL,
  `descripcion` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_li_servicios`
--

CREATE TABLE `rd4_li_servicios` (
  `id` tinyint unsigned NOT NULL DEFAULT '0',
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `rd4_seguimientos`
--

CREATE TABLE `rd4_seguimientos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `obs` text,
  `id_actuacion` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=32813 DEFAULT CHARSET=latin1 COMMENT='Seguimientos de RD441/07';

--
-- Table structure for table `rd4_servicios_cd`
--

CREATE TABLE `rd4_servicios_cd` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_servicio` tinyint unsigned NOT NULL,
  `proyecto` smallint DEFAULT NULL,
  `observaciones` text,
  `id_actuacion` tinyint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_servicio` (`id_servicio`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `rd4_servicios_cd_ibfk_1` FOREIGN KEY (`id_servicio`) REFERENCES `rd4_li_servicios` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=90690 DEFAULT CHARSET=latin1;

--
-- Table structure for table `recepc_atenciones`
--

CREATE TABLE `recepc_atenciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_derivado_por` tinyint unsigned NOT NULL,
  `id_programa` tinyint unsigned DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `id_programa` (`id_programa`),
  KEY `expte` (`centro_origen`,`idusuario`),
  CONSTRAINT `recepc_atenciones_ibfk_1` FOREIGN KEY (`id_programa`) REFERENCES `med_li_programa` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27827 DEFAULT CHARSET=latin1;

--
-- Table structure for table `recibis`
--

CREATE TABLE `recibis` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `proyecto` tinyint unsigned NOT NULL,
  `lugar` varchar(255) NOT NULL,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `cantidad` decimal(5,2) NOT NULL DEFAULT '0.00',
  `concepto1` varchar(255) DEFAULT '',
  `concepto2` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `retorno_cheques_prod`
--

CREATE TABLE `retorno_cheques_prod` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `expediente_convocatoria` varchar(7) NOT NULL,
  `id_pago` varchar(15) NOT NULL,
  `importe` decimal(8,2) unsigned NOT NULL,
  `num_pagare1` varchar(7) DEFAULT NULL,
  `num_pagare2` tinyint(1) DEFAULT NULL,
  `fecha_imp_pagare` date DEFAULT NULL,
  `autor_imp_pagare` varchar(9) DEFAULT NULL,
  `fecha_cobro` date DEFAULT NULL,
  `fecha_exportacion` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_pago` (`id_pago`)
) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=latin1;

--
-- Table structure for table `retorno_gestionviajes`
--

CREATE TABLE `retorno_gestionviajes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_actuacion` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1367 DEFAULT CHARSET=latin1;

--
-- Table structure for table `retorno_incidencias`
--

CREATE TABLE `retorno_incidencias` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  `fecha_resolucion` date DEFAULT NULL,
  `obs_resolucion` text,
  PRIMARY KEY (`id`),
  KEY `expte` (`centro_origen`,`idusuario`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

--
-- Table structure for table `retorno_otros`
--

CREATE TABLE `retorno_otros` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `sit_laboral` varchar(100) NOT NULL,
  `id_sector_actividad` tinyint unsigned DEFAULT NULL,
  `vulnerabilidad` varchar(150) DEFAULT NULL,
  `estancia_previa` varchar(20) NOT NULL,
  `forma_entrada` varchar(100) DEFAULT NULL,
  `motivo_retorno` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `retorno_seguim`
--

CREATE TABLE `retorno_seguim` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL,
  `obs` text,
  `id_proy` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9318 DEFAULT CHARSET=latin1 COMMENT='Seguimientos de retorno voluntario';

--
-- Table structure for table `retornos`
--

CREATE TABLE `retornos` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `tipo` enum('I','H') NOT NULL DEFAULT 'H',
  `fecha_dgii` date DEFAULT NULL,
  `confirma_dgii` binary(1) NOT NULL DEFAULT '0',
  `personas_cargo` tinyint DEFAULT NULL,
  `ss` varchar(30) DEFAULT NULL,
  `fecha_capitalizacion` date DEFAULT NULL,
  `obs` text,
  `billete_internac` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `desplazamiento` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `ayuda_viaje` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `imprevistos` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fecha_salida` date DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `retornos_apre`
--

CREATE TABLE `retornos_apre` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `centro_origen_tit` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario_tit` mediumint unsigned NOT NULL DEFAULT '0',
  `id_pais_destino` tinyint unsigned NOT NULL,
  `ciudad_destino` varchar(50) DEFAULT NULL,
  `id_pais_origen` tinyint unsigned DEFAULT NULL,
  `ciudad_origen` varchar(255) NOT NULL,
  `fecha` date NOT NULL,
  `fecha_impresion` date DEFAULT NULL,
  `csrv` varchar(20) DEFAULT NULL,
  `provincia` varchar(50) NOT NULL,
  `centro` smallint unsigned NOT NULL,
  `fecha_capitalizacion` date DEFAULT NULL,
  `fecha_solicitud_ok` date DEFAULT NULL,
  `confirma_dgii` binary(1) NOT NULL DEFAULT '0',
  `fecha_resolucion` date DEFAULT NULL,
  `obs` text,
  `ss` varchar(30) DEFAULT NULL,
  `menor` tinyint(1) DEFAULT NULL,
  `billete` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_billete` varchar(30) DEFAULT NULL,
  `tren` decimal(8,2) NOT NULL DEFAULT '0.00',
  `fra_tren` varchar(30) DEFAULT NULL,
  `desplazamiento` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `ayuda_viaje` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `ayuda_viaje_ampliada` tinyint(1) NOT NULL DEFAULT '0',
  `imprevistos` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_imprevistos` varchar(30) DEFAULT NULL,
  `acompanamiento` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_acompanamiento` varchar(30) DEFAULT NULL,
  `instalacion1` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `alojamiento` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_alojamiento` varchar(30) DEFAULT NULL,
  `covid19` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_covid19` varchar(30) DEFAULT NULL,
  `covid19_2` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_covid19_2` varchar(30) DEFAULT NULL,
  `docs_billete` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_docs_billete` varchar(30) DEFAULT NULL,
  `docs_tasas` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `trans_menores_avion` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_trans_menores_avion` varchar(30) DEFAULT NULL,
  `trans_menores_tren` decimal(8,2) unsigned NOT NULL DEFAULT '0.00',
  `fra_trans_menores_tren` varchar(30) DEFAULT NULL,
  `fecha_salida` date DEFAULT NULL,
  `num_vuelo` varchar(50) DEFAULT NULL,
  `destino` varchar(50) DEFAULT NULL,
  `hora_salida` varchar(50) DEFAULT NULL,
  `fecha_exportacion` date DEFAULT NULL,
  `proyecto` varchar(4) NOT NULL,
  `microempresa_nombre` varchar(255) DEFAULT NULL,
  `microempresa_importe` decimal(8,2) unsigned DEFAULT NULL,
  `f_recibi_bill` date DEFAULT NULL,
  `recibi_billete` text,
  `expediente_convocatoria` varchar(7) DEFAULT NULL,
  `modificado_por` varchar(9) DEFAULT NULL,
  `nie_fronteras` varchar(10) DEFAULT NULL,
  `enviado_viernes` tinyint(1) NOT NULL DEFAULT '0',
  `fecha_dptoviajes` date DEFAULT NULL,
  `fecha_comunic_vuelo` date DEFAULT NULL,
  `f_deseada_vuelo` date DEFAULT NULL,
  `origen_vuelo` varchar(255) DEFAULT NULL,
  `destino_vuelo` varchar(255) DEFAULT NULL,
  `obs_vuelo` text,
  `num_pagare1` varchar(7) DEFAULT NULL,
  `num_pagare2` tinyint(1) DEFAULT NULL,
  `fecha_imp_pagare` date DEFAULT NULL,
  `autor_imp_pagare` varchar(9) DEFAULT NULL,
  `fecha_cobro` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `benef` (`centro_origen`,`idusuario`,`expediente_convocatoria`) USING BTREE,
  KEY `tit` (`centro_origen_tit`,`idusuario_tit`)
) ENGINE=InnoDB AUTO_INCREMENT=104145 DEFAULT CHARSET=latin1;

--
-- Table structure for table `retornos_fallidos`
--

CREATE TABLE `retornos_fallidos` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `entidad` varchar(255) DEFAULT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  `apellidos` varchar(100) DEFAULT NULL,
  `pasaporte` varchar(15) DEFAULT NULL,
  `nie` varchar(10) DEFAULT NULL,
  `pais` tinyint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=latin1;

--
-- Table structure for table `salida_17`
--

CREATE TABLE `salida_17` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  `fecha` date DEFAULT NULL,
  `tabla` varchar(255) NOT NULL,
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`id`),
  KEY `tabla` (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `salida_17_nuev`
--

CREATE TABLE `salida_17_nuev` (
  `id_actuacion` int unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `id_centro` mediumint unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `sectores_act`
--

CREATE TABLE `sectores_act` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1;

--
-- Table structure for table `sit_adminis`
--

CREATE TABLE `sit_adminis` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `tipo_permiso` tinyint unsigned NOT NULL DEFAULT '0',
  `tipo_otro` varchar(50) DEFAULT NULL,
  `f_expedicion` date DEFAULT NULL,
  `f_validez` date DEFAULT NULL,
  `ss` varchar(30) DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`centro_origen`,`idusuario`),
  KEY `tipo_permiso` (`tipo_permiso`),
  CONSTRAINT `sit_adminis_ibfk_1` FOREIGN KEY (`tipo_permiso`) REFERENCES `tipos_permisos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tabla_2016`
--

CREATE TABLE `tabla_2016` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  `fecha` date DEFAULT NULL,
  `tabla` varchar(255) NOT NULL,
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`id`),
  KEY `tabla` (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tabla_2016_nuev`
--

CREATE TABLE `tabla_2016_nuev` (
  `id_actuacion` int unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `id_centro` mediumint unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tabla_2017`
--

CREATE TABLE `tabla_2017` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  `fecha` date DEFAULT NULL,
  `tabla` varchar(255) NOT NULL,
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`id`),
  KEY `tabla` (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tabla_2017_nuev`
--

CREATE TABLE `tabla_2017_nuev` (
  `id_actuacion` int unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `id_centro` mediumint unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tipos_permisos`
--

CREATE TABLE `tipos_permisos` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=latin1;

--
-- Table structure for table `tmp`
--

CREATE TABLE `tmp` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  PRIMARY KEY (`centro_origen`,`id`),
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`centro_origen`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `tmp_users`
--

CREATE TABLE `tmp_users` (
  `id_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_usuario` mediumint unsigned NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `users_nexos_act`
--

CREATE TABLE `users_nexos_act` (
  `nif` varchar(10) NOT NULL DEFAULT '',
  `id_nexos_act` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`nif`,`id_nexos_act`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Relación usuarios sistema - acciones NEXOS';

--
-- Table structure for table `users_proy`
--

CREATE TABLE `users_proy` (
  `nif` varchar(10) NOT NULL DEFAULT '',
  `id_proyecto` smallint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`nif`,`id_proyecto`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Relación usuarios del sistema y proyectos con acceso';

--
-- Table structure for table `usu_proy`
--

CREATE TABLE `usu_proy` (
  `id_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_usuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_proyecto` smallint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_centro_origen`,`id_usuario`,`id_proyecto`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `usu_rd4_actuaciones`
--

CREATE TABLE `usu_rd4_actuaciones` (
  `id_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id_usuario` mediumint unsigned NOT NULL DEFAULT '0',
  `id_actuacion` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_centro_origen`,`id_usuario`,`id_actuacion`),
  KEY `id_actuacion` (`id_actuacion`),
  CONSTRAINT `usu_rd4_actuaciones_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `rd4_li_actuaciones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `usuarios`
--

CREATE TABLE `usuarios` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `origen` tinyint unsigned DEFAULT NULL,
  `pais` tinyint unsigned DEFAULT NULL,
  `pasaporte` varchar(15) DEFAULT NULL,
  `nie` varchar(10) DEFAULT NULL,
  `expte_asilo` varchar(12) DEFAULT NULL,
  `s_adminis` varchar(15) DEFAULT NULL,
  `nombre` varchar(100) DEFAULT NULL,
  `apellidos` varchar(100) DEFAULT NULL,
  `f_nacimiento` date NOT NULL DEFAULT '1900-01-01',
  `sexo` enum('H','M') NOT NULL DEFAULT 'H',
  `genero_otros` tinyint(1) NOT NULL DEFAULT '0',
  `dir0` varchar(150) DEFAULT NULL,
  `dir1` varchar(150) DEFAULT NULL,
  `dir2` varchar(150) DEFAULT NULL,
  `domicilio` varchar(100) DEFAULT NULL,
  `cp` varchar(5) DEFAULT NULL,
  `localidad` varchar(100) DEFAULT NULL,
  `tlf` varchar(150) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `nivel_est` varchar(26) DEFAULT NULL,
  `s_laboral` varchar(7) DEFAULT NULL,
  `desempleo` varchar(15) DEFAULT NULL,
  `observaciones` text,
  `f_alta` date NOT NULL,
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` date DEFAULT NULL,
  `modificador` varchar(9) NOT NULL DEFAULT '',
  `estadist` tinyint unsigned NOT NULL DEFAULT '0',
  `f_entrada` date DEFAULT NULL,
  `lopd` tinyint(1) NOT NULL DEFAULT '2',
  `trat_datos` tinyint(1) NOT NULL DEFAULT '0',
  `mailing` tinyint(1) NOT NULL DEFAULT '0',
  `ces_imagen` tinyint(1) NOT NULL DEFAULT '0',
  `ces_sanidad` tinyint(1) NOT NULL DEFAULT '0',
  `serv_sociales` tinyint(1) NOT NULL DEFAULT '0',
  `iban` varchar(29) DEFAULT NULL,
  `tarjeta_banc` varchar(19) DEFAULT NULL,
  `vulnerable` tinyint(1) NOT NULL DEFAULT '0',
  `covid19` enum('aislamiento','cuarentena','diagnosticado') DEFAULT NULL,
  `tarjeta_sanitaria` varchar(20) DEFAULT NULL,
  `nombre_completo` varchar(100) GENERATED ALWAYS AS (concat(`apellidos`,_latin1', ',`nombre`)) VIRTUAL,
  PRIMARY KEY (`centro_origen`,`id`),
  KEY `nie` (`nie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `usuarios_suspensiones`
--

CREATE TABLE `usuarios_suspensiones` (
  `id` int NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha_ini` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `tipo` enum('Ingresos superiores','Baja Cautelar/Obligatoria','Justificación incorrecta','Documentación caducada sin autorización del ministerio','Fuera del sistema') NOT NULL,
  `obs` varchar(255) DEFAULT NULL,
  `meses_ministerio` tinyint NOT NULL DEFAULT '0',
  `dias_ministerio` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=574 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Table structure for table `v_recibos_canon`
--

CREATE TABLE `v_recibos_canon` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `id_contrato_uso` int unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `importe` double(6,2) unsigned NOT NULL DEFAULT '0.00',
  `ccc` varchar(23) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_contrato_uso` (`id_contrato_uso`),
  CONSTRAINT `v_recibos_canon_ibfk_1` FOREIGN KEY (`id_contrato_uso`) REFERENCES `viv_contratos_uso` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24167 DEFAULT CHARSET=latin1 COMMENT='Recibos de Canon de los contratos de uso';

--
-- Temporary view structure for view `valojamientos`
--

/*!50001 DROP VIEW IF EXISTS `valojamientos`*/;
/*!50001 CREATE VIEW `valojamientos` AS SELECT
 1 AS `id`,
 1 AS `centro_id`,
 1 AS `proyecto_id`,
 1 AS `clas1`,
 1 AS `clas2`,
 1 AS `clas3`,
 1 AS `nombre`,
 1 AS `alojamiento`,
 1 AS `centro_origen`,
 1 AS `idusuario`,
 1 AS `dias`,
 1 AS `caducado`,
 1 AS `centro`,
 1 AS `d1`,
 1 AS `d2`,
 1 AS `tlf`,
 1 AS `fax`,
 1 AS `provincia_cp`,
 1 AS `mun_id`,
 1 AS `proyecto`,
 1 AS `tipo`,
 1 AS `iti_entidad`,
 1 AS `iti_proyecto`,
 1 AS `municipio`,
 1 AS `provincia`,
 1 AS `comunidad`*/;

--
-- Temporary view structure for view `vcentros_acogida`
--

/*!50001 DROP VIEW IF EXISTS `vcentros_acogida`*/;
/*!50001 CREATE VIEW `vcentros_acogida` AS SELECT
 1 AS `id`,
 1 AS `centro_id`,
 1 AS `clas1`,
 1 AS `proyecto_id`,
 1 AS `proyecto`,
 1 AS `nombre`,
 1 AS `centro`,
 1 AS `municipio`*/;

--
-- Temporary view structure for view `vcentros_capacidad`
--

/*!50001 DROP VIEW IF EXISTS `vcentros_capacidad`*/;
/*!50001 CREATE VIEW `vcentros_capacidad` AS SELECT
 1 AS `centro`,
 1 AS `proyecto_id`,
 1 AS `clas1`,
 1 AS `alojamiento`,
 1 AS `capacidad`*/;

--
-- Table structure for table `vi_alquiler`
--

CREATE TABLE `vi_alquiler` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `viv_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `importe` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `pagado` float(8,2) unsigned DEFAULT NULL,
  `fecha_pago` date DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `vi_comunidad`
--

CREATE TABLE `vi_comunidad` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `viv_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `importe` float(8,2) unsigned DEFAULT NULL,
  `fecha_pago` date DEFAULT NULL,
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `vi_contrato`
--

CREATE TABLE `vi_contrato` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `viv_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `entrada_vivienda` date DEFAULT NULL,
  `importe_alquiler` float(8,2) unsigned NOT NULL DEFAULT '0.00',
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `vi_ocupacion`
--

CREATE TABLE `vi_ocupacion` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `viv_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `vi_seguimiento`
--

CREATE TABLE `vi_seguimiento` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `viv_centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `observaciones` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `vi_vivienda`
--

CREATE TABLE `vi_vivienda` (
  `id` mediumint NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `centro` tinyint unsigned NOT NULL DEFAULT '0',
  `direccion_viv` varchar(255) NOT NULL,
  `cp` char(5) NOT NULL,
  `localidad_viv` varchar(100) NOT NULL,
  `provincia_viv` tinyint unsigned NOT NULL,
  `num_IPRA` varchar(12) DEFAULT NULL,
  `tipologia` varchar(255) NOT NULL,
  `num_habitaciones` tinyint unsigned NOT NULL,
  `superficie` smallint unsigned NOT NULL,
  `comunidad_cif` varchar(9) DEFAULT NULL,
  `comunidad_direcc` varchar(255) DEFAULT NULL,
  `comunidad_tlf` varchar(100) DEFAULT NULL,
  `comunidad_email` varchar(100) DEFAULT NULL,
  `comunidad_fax` varchar(100) DEFAULT NULL,
  `comunidad_persona_contacto` varchar(100) DEFAULT NULL,
  `comunidad_importe` float(8,2) unsigned DEFAULT NULL,
  `observaciones` text,
  `f_alta` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modificador` varchar(9) NOT NULL DEFAULT '',
  PRIMARY KEY (`centro_origen`,`viv_id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;

--
-- Table structure for table `viejo_2016`
--

CREATE TABLE `viejo_2016` (
  `centro_origen` int NOT NULL,
  `id` int NOT NULL,
  `fecha` date DEFAULT NULL,
  `tabla` varchar(255) NOT NULL,
  KEY `expte` (`centro_origen`),
  KEY `centro_origen` (`id`),
  KEY `tabla` (`tabla`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `viejo_2016_nuev`
--

CREATE TABLE `viejo_2016_nuev` (
  `id_actuacion` int unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `id_formato` tinyint unsigned NOT NULL DEFAULT '0',
  `id_complementaria` int unsigned DEFAULT NULL,
  `centro_origen` tinyint unsigned DEFAULT NULL,
  `idusuario` mediumint unsigned DEFAULT NULL,
  `id_proyecto` mediumint unsigned DEFAULT NULL,
  `id_centro` mediumint unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `viv_actuaciones`
--

CREATE TABLE `viv_actuaciones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_actuaciones` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_actuaciones` (`id_actuaciones`),
  CONSTRAINT `viv_actuaciones_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `viv_actuaciones_ibfk_2` FOREIGN KEY (`id_actuaciones`) REFERENCES `viv_li_actuaciones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7537 DEFAULT CHARSET=latin1 COMMENT='Consultas Vivienda Columbares';

--
-- Table structure for table `viv_actuaciones_sev`
--

CREATE TABLE `viv_actuaciones_sev` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `id_actuaciones` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `id_actuaciones` (`id_actuaciones`),
  CONSTRAINT `viv_actuaciones_sev_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `viv_actuaciones_sev_ibfk_2` FOREIGN KEY (`id_actuaciones`) REFERENCES `viv_li_actuaciones_sev` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12558 DEFAULT CHARSET=latin1 COMMENT='Consultas Vivienda Columbares';

--
-- Table structure for table `viv_contratos_uso`
--

CREATE TABLE `viv_contratos_uso` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `fin` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `viv_centro` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `canon` double(6,2) unsigned NOT NULL DEFAULT '0.00',
  `ccc` varchar(23) DEFAULT NULL,
  `observaciones` text,
  `fianza` double(6,2) unsigned DEFAULT NULL,
  `dev_fianza` double(6,2) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `vivienda` (`viv_centro`,`viv_id`),
  CONSTRAINT `viv_contratos_uso_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `viv_contratos_uso_ibfk_2` FOREIGN KEY (`viv_centro`, `viv_id`) REFERENCES `viviendas_columbares` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=1423 DEFAULT CHARSET=latin1 COMMENT='Contratos de uso (canons)';

--
-- Table structure for table `viv_equipamiento`
--

CREATE TABLE `viv_equipamiento` (
  `id` int unsigned NOT NULL DEFAULT '0',
  `viv_centro` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `descripcion` varchar(150) NOT NULL DEFAULT '',
  `cantidad` smallint unsigned NOT NULL DEFAULT '0',
  `importe` double(6,2) unsigned DEFAULT NULL,
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `obs` text,
  PRIMARY KEY (`id`),
  KEY `vivienda` (`viv_centro`,`viv_id`),
  CONSTRAINT `viv_equipamiento_ibfk_1` FOREIGN KEY (`viv_centro`, `viv_id`) REFERENCES `viviendas_columbares` (`centro_origen`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Equipamiento viviendas Columbares';

--
-- Table structure for table `viv_li_actuaciones`
--

CREATE TABLE `viv_li_actuaciones` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 COMMENT='Vivienda. Lista de actuaciones: Demanda de vivienda, mediaci';

--
-- Table structure for table `viv_li_actuaciones_sev`
--

CREATE TABLE `viv_li_actuaciones_sev` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=latin1 COMMENT='Vivienda. Lista de actuaciones de Sevilla Acoge';

--
-- Table structure for table `viv_li_otras_act`
--

CREATE TABLE `viv_li_otras_act` (
  `id` tinyint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COMMENT='Lista de valores otras actuaciones vivienda';

--
-- Table structure for table `viv_otras_act`
--

CREATE TABLE `viv_otras_act` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `fecha` date NOT NULL DEFAULT '0000-00-00',
  `duracion` int NOT NULL DEFAULT '0',
  `id_actuacion` tinyint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  `autor` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `id_actuacion` (`id_actuacion`),
  CONSTRAINT `viv_otras_act_ibfk_1` FOREIGN KEY (`id_actuacion`) REFERENCES `viv_li_otras_act` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4416 DEFAULT CHARSET=latin1;

--
-- Table structure for table `viv_seg_ext`
--

CREATE TABLE `viv_seg_ext` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `idusuario` mediumint unsigned NOT NULL DEFAULT '0',
  `alta` date NOT NULL DEFAULT '0000-00-00',
  `baja` date DEFAULT NULL,
  `viv_centro` tinyint unsigned NOT NULL DEFAULT '0',
  `viv_id` mediumint unsigned NOT NULL DEFAULT '0',
  `observaciones` text,
  PRIMARY KEY (`id`),
  KEY `centro_origen` (`centro_origen`,`idusuario`),
  KEY `vivienda` (`viv_centro`,`viv_id`),
  CONSTRAINT `viv_seg_ext_ibfk_1` FOREIGN KEY (`centro_origen`, `idusuario`) REFERENCES `usuarios` (`centro_origen`, `id`),
  CONSTRAINT `viv_seg_ext_ibfk_2` FOREIGN KEY (`viv_centro`, `viv_id`) REFERENCES `viviendas_columbares` (`centro_origen`, `id`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1 COMMENT='Seguimientos externos';

--
-- Table structure for table `viviendas_columbares`
--

CREATE TABLE `viviendas_columbares` (
  `centro_origen` tinyint unsigned NOT NULL DEFAULT '0',
  `id` mediumint unsigned NOT NULL DEFAULT '0',
  `direccion` varchar(100) NOT NULL DEFAULT '',
  `localidad` varchar(100) NOT NULL DEFAULT '',
  `id_ayto` tinyint unsigned NOT NULL DEFAULT '0',
  `id_tenencia` tinyint unsigned NOT NULL DEFAULT '0',
  `id_asignacion` tinyint unsigned NOT NULL DEFAULT '0',
  `contacto` varchar(80) DEFAULT NULL,
  `capacidad` smallint unsigned NOT NULL DEFAULT '0',
  `seg_compania` varchar(80) DEFAULT NULL,
  `seg_poliza` varchar(30) DEFAULT NULL,
  `seg_f_alta` date DEFAULT NULL,
  `prop_oficina` varchar(80) DEFAULT NULL,
  `prop_estado` varchar(15) DEFAULT NULL,
  `prop_ref` varchar(30) DEFAULT NULL,
  `prop_valor` double(8,2) unsigned DEFAULT NULL,
  `but_compania` varchar(80) DEFAULT NULL,
  `but_f_revision` date DEFAULT NULL,
  `but_ref_contrato` varchar(30) DEFAULT NULL,
  `agua_compania` varchar(80) DEFAULT NULL,
  `agua_ref_contrato` varchar(30) DEFAULT NULL,
  `agua_cargo` varchar(15) DEFAULT NULL,
  `elec_compania` varchar(80) DEFAULT NULL,
  `elec_ref_contrato` varchar(30) DEFAULT NULL,
  `elec_cargo` varchar(15) DEFAULT NULL,
  `ext_compania` varchar(80) DEFAULT NULL,
  `ext_f_revision` date DEFAULT NULL,
  `ext_ref_contrato` varchar(30) DEFAULT NULL,
  `suministros_obs` text,
  `observaciones` text,
  `f_alta` date NOT NULL DEFAULT '0000-00-00',
  `creador` varchar(9) NOT NULL DEFAULT '',
  `f_modif` date NOT NULL DEFAULT '0000-00-00',
  `modificador` varchar(9) NOT NULL DEFAULT '',
  `f_baja` date DEFAULT NULL,
  PRIMARY KEY (`centro_origen`,`id`),
  KEY `id_tenencia` (`id_tenencia`),
  KEY `id_asignacion` (`id_asignacion`),
  KEY `id_ayto` (`id_ayto`),
  CONSTRAINT `viviendas_columbares_ibfk_1` FOREIGN KEY (`id_tenencia`) REFERENCES `li_v_tenencia` (`id`),
  CONSTRAINT `viviendas_columbares_ibfk_2` FOREIGN KEY (`id_asignacion`) REFERENCES `li_v_asignacion` (`id`),
  CONSTRAINT `viviendas_columbares_ibfk_3` FOREIGN KEY (`id_ayto`) REFERENCES `li_v_aytos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Temporary view structure for view `vmunicipios`
--

/*!50001 DROP VIEW IF EXISTS `vmunicipios`*/;
/*!50001 CREATE VIEW `vmunicipios` AS SELECT
 1 AS `cod_post`,
 1 AS `mun_id`,
 1 AS `municipio`,
 1 AS `provincia`,
 1 AS `comunidad`*/;

--
-- Current Database: `administracion`
--

USE `administracion`;

--
-- Current Database: `beneficiarios`
--

USE `beneficiarios`;

--
-- Current Database: `citas`
--

USE `citas`;

--
-- Current Database: `contactos`
--

USE `contactos`;

--
-- Current Database: `directorio`
--

USE `directorio`;

--
-- Current Database: `documentos`
--

USE `documentos`;

--
-- Current Database: `empresas`
--

USE `empresas`;

--
-- Current Database: `familias`
--

USE `familias`;

--
-- Current Database: `foros`
--

USE `foros`;

--
-- Current Database: `gastos_contabilidad`
--

USE `gastos_contabilidad`;

--
-- Current Database: `i3l`
--

USE `i3l`;

--
-- Current Database: `insercion`
--

USE `insercion`;

--
-- Current Database: `laboral`
--

USE `laboral`;

--
-- Current Database: `participacion`
--

USE `participacion`;

--
-- Current Database: `usuarios`
--

USE `usuarios`;

--
-- Current Database: `usuarios_cepaim`
--

USE `usuarios_cepaim`;

--
-- Final view structure for view `valojamientos`
--

/*!50001 DROP VIEW IF EXISTS `valojamientos`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`red_user`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `valojamientos` AS select `a`.`id` AS `id`,`c`.`id` AS `centro_id`,`p`.`id` AS `proyecto_id`,`a`.`clas1` AS `clas1`,`a`.`clas2` AS `clas2`,`a`.`clas3` AS `clas3`,`a`.`nombre` AS `nombre`,`aa`.`nombre` AS `alojamiento`,`a`.`centro_origen` AS `centro_origen`,`a`.`idusuario` AS `idusuario`,`a`.`dias` AS `dias`,`a`.`caducado` AS `caducado`,`c`.`nombre` AS `centro`,`c`.`d1` AS `d1`,`c`.`d2` AS `d2`,`c`.`tlf` AS `tlf`,`c`.`fax` AS `fax`,`c`.`provincia_cp` AS `provincia_cp`,`c`.`mun_id` AS `mun_id`,`p`.`nombre` AS `proyecto`,`p`.`tipo` AS `tipo`,`p`.`iti_entidad` AS `iti_entidad`,`p`.`iti_proyecto` AS `iti_proyecto`,`m`.`municipio` AS `municipio`,`m`.`provincia` AS `provincia`,`m`.`comunidad` AS `comunidad` from ((((`acogida_alojamientos` `a` join `acogida_alojamientos` `aa`) join `proyectos` `p`) join `usuarios`.`centros` `c`) join `vmunicipios` `m`) where ((`a`.`centro` = `aa`.`centro`) and (`a`.`proyecto` = `aa`.`proyecto`) and (`a`.`clas1` = `aa`.`clas1`) and (`aa`.`clas2` = 0) and (`aa`.`clas3` = 0) and (`a`.`centro` = `c`.`id`) and (convert(`c`.`provincia_cp` using utf8mb4) = convert(`m`.`cod_post` using utf8mb4)) and (convert(`c`.`mun_id` using utf8mb4) = convert(`m`.`mun_id` using utf8mb4)) and (`a`.`proyecto` = `p`.`id`)) */;

--
-- Final view structure for view `vcentros_acogida`
--

/*!50001 DROP VIEW IF EXISTS `vcentros_acogida`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`red_user`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vcentros_acogida` AS select `valojamientos`.`id` AS `id`,`valojamientos`.`centro_id` AS `centro_id`,`valojamientos`.`clas1` AS `clas1`,`valojamientos`.`proyecto_id` AS `proyecto_id`,`valojamientos`.`proyecto` AS `proyecto`,`valojamientos`.`nombre` AS `nombre`,`valojamientos`.`centro` AS `centro`,`valojamientos`.`municipio` AS `municipio` from `valojamientos` where ((`valojamientos`.`clas1` > 0) and (`valojamientos`.`clas2` = 0) and (`valojamientos`.`clas3` = 0) and (`valojamientos`.`caducado` <> '1')) order by `valojamientos`.`centro_id`,`valojamientos`.`clas1` */;

--
-- Final view structure for view `vcentros_capacidad`
--

/*!50001 DROP VIEW IF EXISTS `vcentros_capacidad`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`red_user`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vcentros_capacidad` AS select `valojamientos`.`centro` AS `centro`,`valojamientos`.`proyecto_id` AS `proyecto_id`,`valojamientos`.`clas1` AS `clas1`,`valojamientos`.`alojamiento` AS `alojamiento`,sum(1) AS `capacidad` from `valojamientos` where ((`valojamientos`.`clas1` > 0) and (`valojamientos`.`clas2` > 0) and (`valojamientos`.`clas3` > 0) and (`valojamientos`.`caducado` <> '1')) group by `valojamientos`.`centro`,`valojamientos`.`proyecto_id`,`valojamientos`.`clas1`,`valojamientos`.`alojamiento` */;

--
-- Final view structure for view `vmunicipios`
--

/*!50001 DROP VIEW IF EXISTS `vmunicipios`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`red_user`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vmunicipios` AS select `m`.`prov_id` AS `cod_post`,`m`.`mun_id` AS `mun_id`,`m`.`nombre` AS `municipio`,`p`.`nombre` AS `provincia`,`c`.`nombre` AS `comunidad` from ((`municipios` `m` join `provincias_esp` `p`) join `comunidades_esp` `c`) where ((convert(`m`.`prov_id` using utf8mb4) = convert(`p`.`cod_post` using utf8mb4)) and (`p`.`comunidad` = `c`.`id`)) */;


