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`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF (NEW.code IS NULL) THEN
|
||||
SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT
|
||||
FROM information_schema.TABLES
|
||||
WHERE TABLE_SCHEMA='vn' and TABLE_NAME='mandate'));
|
||||
END IF;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue