diff --git a/db/routines/vn/triggers/claimRatio_afterInsert.sql b/db/routines/vn/triggers/claimRatio_afterInsert.sql new file mode 100644 index 000000000..ca618bb89 --- /dev/null +++ b/db/routines/vn/triggers/claimRatio_afterInsert.sql @@ -0,0 +1,11 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`claimRatio_afterInsert` + AFTER INSERT ON `claimRatio` + FOR EACH ROW +BEGIN + INSERT INTO clientRate(clientFk, `value`) + VALUES(NEW.clientFk, NEW.priceIncreasing) + ON DUPLICATE KEY UPDATE + `value` = VALUES(`value`); +END$$ +DELIMITER ; diff --git a/db/versions/11082-goldenCordyline/00-firstScript.sql b/db/versions/11082-goldenCordyline/00-firstScript.sql new file mode 100644 index 000000000..71b98f4a9 --- /dev/null +++ b/db/versions/11082-goldenCordyline/00-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE vn.country DROP COLUMN country; diff --git a/db/versions/11084-whitePalmetto/00-firstScript.sql b/db/versions/11084-whitePalmetto/00-firstScript.sql new file mode 100644 index 000000000..c5f841ea4 --- /dev/null +++ b/db/versions/11084-whitePalmetto/00-firstScript.sql @@ -0,0 +1,9 @@ +CREATE TABLE `vn`.`clientRate` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `clientFk` int(11) NOT NULL, + `dated` date NOT NULL DEFAULT current_timestamp(), + `value` decimal(10,2) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `clientRate_unique` (`clientFk`,`dated`), + CONSTRAINT `clientRate_client_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; \ No newline at end of file