Created
September 8, 2012 16:46
-
-
Save javadabadoo/3677009 to your computer and use it in GitHub Desktop.
SCRIPT_CREACION_BD_ERIKA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | |
CREATE DATABASE `formulario` DEFAULT CHARACTER SET utf8 ; | |
USE `formulario` ; | |
-- ----------------------------------------------------- | |
-- Table `formulario`.`proyecto` | |
-- ----------------------------------------------------- | |
CREATE TABLE `formulario`.`proyecto` ( | |
`id` INT NOT NULL AUTO_INCREMENT , | |
`tipo_servicio` VARCHAR(100) NULL , | |
`metodo_estimacion` VARCHAR(100) NULL , | |
`agrupacion_tec` VARCHAR(100) NULL , | |
`tecnologia` VARCHAR(100) NULL , | |
`factor_tec` DECIMAL(1.2) NULL , | |
`factor_categoria` INT(11) NULL , | |
`tipo_unidad_pago` VARCHAR(10) NULL , | |
`total_unidad_pago` DECIMAL(10.2) NULL , | |
`total_horas_esfuerzo` DECIMAL(10.2) NULL , | |
PRIMARY KEY (`id`) ) | |
ENGINE = InnoDB; | |
-- ----------------------------------------------------- | |
-- Table `formulario`.`horas` | |
-- ----------------------------------------------------- | |
CREATE TABLE `formulario`.`horas` ( | |
`id` INT NOT NULL AUTO_INCREMENT , | |
`producto` INT NOT NULL , | |
`administracion` INT NOT NULL , | |
`desarrollo` INT NOT NULL , | |
`proyecto_id` INT NOT NULL , | |
PRIMARY KEY (`id`) , | |
INDEX `fk_horas_proyecto` (`proyecto_id` ASC) , | |
CONSTRAINT `fk_horas_proyecto` | |
FOREIGN KEY (`proyecto_id` ) | |
REFERENCES `formulario`.`proyecto` (`id` ) | |
ON DELETE NO ACTION | |
ON UPDATE NO ACTION) | |
ENGINE = InnoDB; | |
-- ----------------------------------------------------- | |
-- Table `formulario`.`riegos` | |
-- ----------------------------------------------------- | |
CREATE TABLE `formulario`.`riegos` ( | |
`id` INT NOT NULL AUTO_INCREMENT , | |
`tipo` VARCHAR(10) NOT NULL , | |
`probabilidad` VARCHAR(10) NOT NULL , | |
`impacto` VARCHAR(10) NOT NULL , | |
`ponderacion` INT NOT NULL , | |
`riegoscol` VARCHAR(45) NOT NULL , | |
`proyecto_id` INT NOT NULL , | |
PRIMARY KEY (`id`) , | |
INDEX `fk_riegos_proyecto1` (`proyecto_id` ASC) , | |
CONSTRAINT `fk_riegos_proyecto1` | |
FOREIGN KEY (`proyecto_id` ) | |
REFERENCES `formulario`.`proyecto` (`id` ) | |
ON DELETE NO ACTION | |
ON UPDATE NO ACTION) | |
ENGINE = InnoDB; | |
-- ----------------------------------------------------- | |
-- Table `formulario`.`recursos` | |
-- ----------------------------------------------------- | |
CREATE TABLE `formulario`.`recursos` ( | |
`id` INT NOT NULL AUTO_INCREMENT , | |
`cantidad` INT NULL , | |
`recurso` VARCHAR(15) NULL , | |
`costo_total` INT NULL , | |
`detalle_semanal` TEXT NULL , | |
`esfuerzo_total` INT NULL , | |
`proyecto_id` INT NOT NULL , | |
PRIMARY KEY (`id`) , | |
INDEX `fk_recursos_proyecto1` (`proyecto_id` ASC) , | |
CONSTRAINT `fk_recursos_proyecto1` | |
FOREIGN KEY (`proyecto_id` ) | |
REFERENCES `formulario`.`proyecto` (`id` ) | |
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment