fix: refs #7187 sql for pdaFreelancer
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-04-24 11:08:57 +02:00
parent fbc1614132
commit a15970c95f
3 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,8 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`deviceProductionUser_afterInsert`
AFTER INSERT ON `deviceProductionUser`
FOR EACH ROW
BEGIN
CALL worker_checkMultipleDevice(NEW.userFk);
END$$
DELIMITER ;

View File

@ -3,7 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`deviceProductionUser_
BEFORE INSERT ON `deviceProductionUser`
FOR EACH ROW
BEGIN
CALL worker_checkMultipleDevice(NEW.userFk);
SET NEW.editorFk = account.myUser_getId();
END$$
DELIMITER ;

View File

@ -4,3 +4,7 @@ ALTER TABLE vn.deviceProductionUser DROP FOREIGN KEY deviceProductionUser_FK;
ALTER TABLE vn.deviceProductionUser DROP PRIMARY KEY;
ALTER TABLE vn.deviceProductionUser ADD id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY FIRST;
ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_deviceProduction_FK FOREIGN KEY (deviceProductionFk) REFERENCES vn.deviceProduction(id);
ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_unique UNIQUE KEY (deviceProductionFk);