Commit db1d33fa authored by M1888's avatar M1888

constraint

parent b536d741
...@@ -250,7 +250,12 @@ CREATE TABLE IF NOT EXISTS `M1888`.`ottelutapahtuma` ( ...@@ -250,7 +250,12 @@ CREATE TABLE IF NOT EXISTS `M1888`.`ottelutapahtuma` (
FOREIGN KEY (`maali_id`) FOREIGN KEY (`maali_id`)
REFERENCES `M1888`.`maali` (`maali_id`) REFERENCES `M1888`.`maali` (`maali_id`)
ON DELETE NO ACTION 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; 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