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='STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Table `templateT` -- ----------------------------------------------------- DROP TABLE IF EXISTS `templateT` ; CREATE TABLE IF NOT EXISTS `templateT` ( `srcNodeTypeId` INT UNSIGNED NOT NULL, `dstNodeId` INT UNSIGNED NOT NULL, `dstNodeTypeId` INT UNSIGNED NOT NULL COMMENT 'filled in automatically by trigger', `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`srcNodeTypeId`, `dstNodeId`), INDEX `fk_templateT_nodeT1_idx` (`dstNodeId` ASC, `dstNodeTypeId` ASC), INDEX `fk_templateT_allowedNodeLinkT1_idx` (`srcNodeTypeId` ASC, `dstNodeTypeId` ASC), CONSTRAINT `fk_attributeTemplateT_nodeTypeT1` FOREIGN KEY (`srcNodeTypeId`) REFERENCES `nodeTypeT` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `fk_templateT_nodeT1` FOREIGN KEY (`dstNodeId` , `dstNodeTypeId`) REFERENCES `nodeT` (`id` , `nodeTypeId`) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `fk_templateT_allowedNodeLinkT1` FOREIGN KEY (`srcNodeTypeId` , `dstNodeTypeId`) REFERENCES `allowedNodeLinkT` (`srcNodeTypeId` , `dstNodeTypeId`) ON DELETE CASCADE 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;