fix: refs #5919 unique key & unassigned locker

This commit is contained in:
Jorge Penadés 2024-04-29 16:05:36 +02:00
parent be69b5e2c4
commit 9802f0066c
2 changed files with 5 additions and 1 deletions

View File

@ -28,5 +28,9 @@ mainLabel:BEGIN
UPDATE `client` c
SET c.salesPersonFk = null
WHERE c.salesPersonFk = vUserId;
UPDATE locker l
SET l.workerFk = NULL
WHERE l.workerFk = vUserId;
END$$
DELIMITER ;

View File

@ -9,7 +9,7 @@ CREATE TABLE `vn`.`locker` (
`workerFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `workerFk` (`workerFk`),
UNIQUE KEY `workerFk` (`workerFk`),
CONSTRAINT `locker_ibfk_1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;