Merge pull request 'master' (!2811) from master into test
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2811
Reviewed-by: Jorge Penades <jorgep@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-07-30 14:49:38 +00:00
commit a61f68cbc9
2 changed files with 60 additions and 54 deletions

View File

@ -30,12 +30,12 @@ BEGIN
FROM itemShelvingSale iss
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
WHERE iss.itemShelvingFk = vItemShelvingFk
AND iss.itemFk = vItemFk
AND ish.itemFk = vItemFk
AND NOT iss.isPicked
FOR UPDATE;
INSERT INTO itemShelvingSaleReserve (saleFk, vSectorFk)
SELECT DISTINCT iss.saleFk
INSERT INTO itemShelvingSaleReserve (saleFk, sectorFk)
SELECT DISTINCT iss.saleFk, vSectorFk
FROM itemShelvingSale iss
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
WHERE iss.itemShelvingFk = vItemShelvingFk

View File

@ -0,0 +1,6 @@
-- Place your SQL code here
ALTER TABLE vn.itemShelvingSaleReserve DROP FOREIGN KEY IF EXISTS itemShelvingSaleReserve_sector_FK;
ALTER TABLE vn.itemShelvingSaleReserve ADD CONSTRAINT itemShelvingSaleReserve_sector_FK
FOREIGN KEY IF NOT EXISTS (sectorFk) REFERENCES vn.sector(id) ON DELETE RESTRICT ON UPDATE CASCADE;