· 8 years ago · Dec 05, 2017, 02:00 PM
1-- -----------------------------------------------------
2-- Table `mydb`.`images`
3-- -----------------------------------------------------
4CREATE TABLE IF NOT EXISTS `mydb`.`images` (
5 `id` INT NOT NULL AUTO_INCREMENT ,
6 `filename` VARCHAR(100) NULL COMMENT 'this is a sha256 value\ncreated as \nsha256(concat(sha256(image), timestamp))\nsuffix is image type, after \'.\'' ,
7 `createtime` TIMESTAMP NULL ,
8 `blocked` TINYINT(1) NULL ,
9 `active` TINYINT(1) NULL ,
10 `lastchangetime` TIMESTAMP NULL COMMENT 'whenever was the last time \nthe image got blocked or\nactive flags changed' ,
11 `metainfo_id` INT NULL ,
12 PRIMARY KEY (`id`) ,
13 INDEX `fk_images_imagemetainfo1` (`metainfo_id` ASC) ,
14 CONSTRAINT `fk_images_imagemetainfo1`
15 FOREIGN KEY (`metainfo_id` )
16 REFERENCES `mydb`.`imagemetainfo` (`id` )
17 ON DELETE NO ACTION
18 ON UPDATE NO ACTION,
19 CONSTRAINT `fk_images_profiles1`
20 FOREIGN KEY (`id` )
21 REFERENCES `mydb`.`profiles` (`profileimage_id` )
22 ON DELETE NO ACTION
23 ON UPDATE NO ACTION)
24ENGINE = InnoDB;