model image我有错误1022。
请帮我找一个决定。 SQL代码:
-- Table `db`.`VagOut`
CREATE TABLE IF NOT EXISTS `db`.`VagOut` (
`VagOutRecNum` INT NOT NULL,
`VagNum` INT NULL,
`CargoName` VARCHAR(45) NULL,
`TrNumOutRec` INT NULL,
`Netto` INT NULL,
`Brutto` INT NULL,
PRIMARY KEY (`VagOutRecNum`),
INDEX `VagNum_idx` (`VagNum` ASC),
INDEX `CargoNam_idx` (`CargoName` ASC),
INDEX `TrNumOutRec_idx` (`TrNumOutRec` ASC),
CONSTRAINT `VagNum`
FOREIGN KEY (`VagNum`)
REFERENCES `db`.`Vagon` (`VagNum`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `CargoNam`
FOREIGN KEY (`CargoName`)
REFERENCES `db`.`Cargos` (`CargoName`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `TrNumOutRec`
FOREIGN KEY (`TrNumOutRec`)
REFERENCES `db`.`TrainOut` (`TrNumOutRec`)
ON DELETE CASCADE
ON UPDATE CASCADE)
ENGINE = InnoDB
非常感谢你
我检查了其他表格中fk的相似名称,但没有找到