Created
November 5, 2013 13:39
-
-
Save ricardosiri68/7319144 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| CREATE TABLE IF NOT EXISTS `imagenes` ( | |
| `imagen_id` int(11) NOT NULL AUTO_INCREMENT, | |
| `imagen` varchar(255) DEFAULT NULL, | |
| PRIMARY KEY (`imagen_id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; | |
| -- Table `nueva`.`galeria` | |
| -- ----------------------------------------------------- | |
| CREATE TABLE IF NOT EXISTS `nueva`.`galeria` ( | |
| `galeria_id` INT NOT NULL, | |
| `nombre_galeria` VARCHAR(45) NULL, | |
| `imagen_galeria` VARCHAR(45) NULL, | |
| PRIMARY KEY (`galeria_id`)) | |
| ENGINE = InnoDB; | |
| -- ----------------------------------------------------- | |
| -- Table `nueva`.`imagenes` | |
| -- ----------------------------------------------------- | |
| CREATE TABLE IF NOT EXISTS `nueva`.`imagenes` ( | |
| `imagen_id` INT NOT NULL, | |
| `imagen` VARCHAR(45) NOT NULL, | |
| `galeria_galeria_id` INT NOT NULL, | |
| PRIMARY KEY (`imagen_id`), | |
| INDEX `fk_imagen_galeria_idx` (`galeria_galeria_id` ASC), | |
| CONSTRAINT `fk_imagen_galeria` | |
| FOREIGN KEY (`galeria_galeria_id`) | |
| REFERENCES `nueva`.`galeria` (`galeria_id`) | |
| ON DELETE NO ACTION | |
| ON UPDATE NO ACTION) | |
| ENGINE = InnoDB; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment