Merge pull request 'fix: refs #4988 insert into agencyWorkCenter' (!2442) from 4988-fixInsert-into-agencyWorkCenter into test
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
Reviewed-on: #2442 Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
commit
db9c20fb22
|
@ -10,9 +10,10 @@ CREATE TABLE IF NOT EXISTS `vn`.`agencyWorkCenter` (
|
|||
CONSTRAINT `agencyWorkCenter_agency_FK` FOREIGN KEY (`agencyFk`) REFERENCES `agency` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `agencyWorkCenter_user_FK` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `agencyWorkCenter_workCenter_FK` FOREIGN KEY (`workCenterFk`) REFERENCES `workCenter` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='refs #4988';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
INSERT INTO vn.agencyWorkCenter (agencyFk, workCenterFk)
|
||||
SELECT id, workCenterFk
|
||||
FROM vn.agency
|
||||
WHERE workCenterFk IS NOT NULL;
|
||||
SELECT a.id, wc.id
|
||||
FROM vn.agency a
|
||||
JOIN vn.warehouse w ON w.id = a.warehouseFk
|
||||
JOIN vn.workCenter wc ON wc.warehouseFk = w.id;
|
Loading…
Reference in New Issue