Commit 8e375dad authored by M1888's avatar M1888

sql v2

parent c533a34d
......@@ -251,7 +251,12 @@ CREATE TABLE IF NOT EXISTS `M1888`.`ottelutapahtuma` (
FOREIGN KEY (`maali_id`)
REFERENCES `M1888`.`maali` (`maali_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ON UPDATE NO ACTION,
CONSTRAINT `CK_tapahtumaid` CHECK (
CASE WHEN aikalisa_id IS NULL THEN 0 ELSE 1 END +
CASE WHEN jaahy_id IS NULL THEN 0 ELSE 1 END +
CASE WHEN rankkari_id IS NULL THEN 0 ELSE 1 END +
CASE WHEN maali_id IS NULL THEN 0 ELSE 1 END = 1))
ENGINE = InnoDB;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment