text: -- MySQL Script generated by MySQL Workbench
  -- 07/14/16 13:15:57
  -- Model: New Model    Version: 1.0
  -- MySQL Workbench Forward Engineering
  
  SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
  SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
  SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
  
  -- -----------------------------------------------------
  -- Schema intranetjhsdb
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema intranetjhsdb
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `intranetjhsdb` DEFAULT CHARACTER SET utf8 ;
  USE `intranetjhsdb` ;
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Rol`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Rol` (
    `RolID` INT NOT NULL,
    `RolNombre` VARCHAR(40) NOT NULL,
    `RolDescripcion` VARCHAR(100) NULL,
    `RolFechaReg` DATE NOT NULL,
    PRIMARY KEY (`RolID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Empresa`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Empresa` (
    `EmpresaID` INT NOT NULL,
    `EmpresaNombre` VARCHAR(50) NOT NULL,
    `EmpresaDescripcion` VARCHAR(100) NULL,
    `EmpresaFechaReg` DATE NOT NULL,
    `EmpresaRIF` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`EmpresaID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Cargo`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Cargo` (
    `CargoID` INT NOT NULL,
    `CargoNombre` VARCHAR(45) NOT NULL,
    `CargoDescripcion` VARCHAR(45) NULL,
    `CargoFechaReg` DATE NOT NULL,
    PRIMARY KEY (`CargoID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Usuario`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Usuario` (
    `UsuarioID` INT NOT NULL,
    `UsuarioNombre` VARCHAR(100) NOT NULL,
    `UsuarioApellido` VARCHAR(100) NOT NULL,
    `UsuarrioCedula` VARCHAR(20) NOT NULL,
    `UsuarioCorreo` VARCHAR(100) NOT NULL,
    `UsuarioClave` VARCHAR(100) NOT NULL,
    `UsuarioFechaNac` DATE NULL,
    `UsuarioFechaIng` DATE NOT NULL,
    `UsuarioBanco` VARCHAR(50) NOT NULL,
    `UsuarioCuentaBanco` VARCHAR(100) NULL,
    `UsuarioFechaReg` DATE NOT NULL,
    `RolID` INT NOT NULL,
    `EmpresaID` INT NOT NULL,
    `CargoID` INT NOT NULL,
    PRIMARY KEY (`UsuarioID`),
    UNIQUE INDEX `UsuarrioCedula_UNIQUE` (`UsuarrioCedula` ASC),
    UNIQUE INDEX `UsuarioCorreo_UNIQUE` (`UsuarioCorreo` ASC),
    INDEX `fk_Usuario_Rol_idx` (`RolID` ASC),
    INDEX `fk_Usuario_Empresa1_idx` (`EmpresaID` ASC),
    INDEX `fk_Usuario_Cargo1_idx` (`CargoID` ASC),
    CONSTRAINT `fk_Usuario_Rol`
      FOREIGN KEY (`RolID`)
      REFERENCES `intranetjhsdb`.`Rol` (`RolID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Usuario_Empresa1`
      FOREIGN KEY (`EmpresaID`)
      REFERENCES `intranetjhsdb`.`Empresa` (`EmpresaID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Usuario_Cargo1`
      FOREIGN KEY (`CargoID`)
      REFERENCES `intranetjhsdb`.`Cargo` (`CargoID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Recibo`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Recibo` (
    `ReciboID` INT NOT NULL,
    `ReciboFechaInicio` DATE NULL,
    `ReciboFechaFin` DATE NULL,
    `ReciboNumero` INT NULL,
    `Recibocol` VARCHAR(45) NULL,
    `UsuarioID` INT NOT NULL,
    PRIMARY KEY (`ReciboID`),
    INDEX `fk_Recibo_Usuario1_idx` (`UsuarioID` ASC),
    CONSTRAINT `fk_Recibo_Usuario1`
      FOREIGN KEY (`UsuarioID`)
      REFERENCES `intranetjhsdb`.`Usuario` (`UsuarioID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Parametro`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Parametro` (
    `ParametroID` INT NOT NULL,
    `ParametroCodigo` VARCHAR(10) NULL,
    `ParametroDescripcion` VARCHAR(100) NULL,
    `ParametroValorAuxiliar` VARCHAR(20) NULL,
    `ParametroAsignaciones` DOUBLE NULL,
    `ParametroDeducciones` DOUBLE NULL,
    `ParametroNetoaCobrar` DOUBLE NULL,
    `ParametroFechaReg` DATE NOT NULL,
    `ReciboID` INT NOT NULL,
    PRIMARY KEY (`ParametroID`),
    INDEX `fk_Parametro_Recibo1_idx` (`ReciboID` ASC),
    CONSTRAINT `fk_Parametro_Recibo1`
      FOREIGN KEY (`ReciboID`)
      REFERENCES `intranetjhsdb`.`Recibo` (`ReciboID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Departamento`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Departamento` (
    `DepartamentoID` INT NOT NULL,
    `DepartamentoNombre` VARCHAR(50) NULL,
    `DepartamentoDescripcion` VARCHAR(200) NULL,
    `DepartamentoFechaReg` DATE NULL,
    `EmpresaID` INT NOT NULL,
    PRIMARY KEY (`DepartamentoID`),
    INDEX `fk_Departamento_Empresa1_idx` (`EmpresaID` ASC),
    CONSTRAINT `fk_Departamento_Empresa1`
      FOREIGN KEY (`EmpresaID`)
      REFERENCES `intranetjhsdb`.`Empresa` (`EmpresaID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`ParametroEmpresa`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`ParametroEmpresa` (
    `ParametroID` INT NOT NULL,
    `ParametroNombre` VARCHAR(20) NULL,
    `ParametroValor` VARCHAR(1000) NULL,
    `ParametroFechaReg` DATE NULL,
    `EmpresaID` INT NOT NULL,
    `Departamento_DepartamentoID` INT NOT NULL,
    PRIMARY KEY (`ParametroID`),
    INDEX `fk_Parametro_Empresa1_idx` (`EmpresaID` ASC),
    INDEX `fk_Parametro_Departamento1_idx` (`Departamento_DepartamentoID` ASC),
    CONSTRAINT `fk_Parametro_Empresa1`
      FOREIGN KEY (`EmpresaID`)
      REFERENCES `intranetjhsdb`.`Empresa` (`EmpresaID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Parametro_Departamento1`
      FOREIGN KEY (`Departamento_DepartamentoID`)
      REFERENCES `intranetjhsdb`.`Departamento` (`DepartamentoID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Archivo`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Archivo` (
    `ArchivoID` INT NOT NULL,
    `ArchivoNombre` VARCHAR(50) NULL,
    `ArchivoDescripcion` VARCHAR(200) NULL,
    `ArchivoRuta` VARCHAR(100) NULL,
    `ArchivoFechaReg` DATE NULL,
    `EmpresaID` INT NOT NULL,
    PRIMARY KEY (`ArchivoID`),
    INDEX `fk_Archivo_Empresa1_idx` (`EmpresaID` ASC),
    CONSTRAINT `fk_Archivo_Empresa1`
      FOREIGN KEY (`EmpresaID`)
      REFERENCES `intranetjhsdb`.`Empresa` (`EmpresaID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Sexo`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Sexo` (
    `SexoID` INT NOT NULL,
    `SexoNombre` VARCHAR(45) NULL,
    `SexoDescripcion` VARCHAR(45) NULL,
    PRIMARY KEY (`SexoID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `intranetjhsdb`.`Curriculum`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `intranetjhsdb`.`Curriculum` (
    `CurriculumID` INT NOT NULL AUTO_INCREMENT,
    `CurriculumNombre` VARCHAR(45) NULL,
    `CurriculumApellido` VARCHAR(45) NULL,
    `CurriculumCedula` VARCHAR(45) NULL,
    `CurriculumFechNaci` DATETIME NULL,
    `CurriculumLugNaci` VARCHAR(45) NULL,
    `CurriculumDireccion` VARCHAR(200) NULL,
    `CurriculumTeleFijo` VARCHAR(45) NULL,
    `CurriculumTeleCelu` VARCHAR(45) NULL,
    `CurriculumEmail` VARCHAR(100) NULL,
    `CurriculumExpeLabo` VARCHAR(200) NULL,
    `CurriculumEstuReal` VARCHAR(100) NULL,
    `CurriculumCursReal` VARCHAR(100) NULL,
    `CurriculumDisponibilidad` VARCHAR(45) NULL,
    `CurriculumArchivo` BLOB NULL,
    `Sexo_SexoID` INT NOT NULL,
    PRIMARY KEY (`CurriculumID`),
    INDEX `fk_Curriculum_Sexo1_idx` (`Sexo_SexoID` ASC),
    CONSTRAINT `fk_Curriculum_Sexo1`
      FOREIGN KEY (`Sexo_SexoID`)
      REFERENCES `intranetjhsdb`.`Sexo` (`SexoID`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  