This commit is contained in:
parent
37b735b988
commit
9b2c0f1c48
|
@ -3,12 +3,12 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`mandate_beforeInsert`
|
||||||
BEFORE INSERT ON `mandate`
|
BEFORE INSERT ON `mandate`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
IF (NEW.code IS NULL) THEN
|
IF (NEW.code IS NULL) THEN
|
||||||
SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
|
SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
|
||||||
FROM information_schema.TABLES
|
FROM information_schema.TABLES
|
||||||
WHERE TABLE_SCHEMA='vn' and TABLE_NAME='mandate'));
|
WHERE TABLE_SCHEMA='vn' and TABLE_NAME='mandate'));
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue