fix: remove orphaned agencyIncoming records with null agencyModeFk
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javi Gallego 2025-01-27 16:34:28 +01:00
parent 1261722943
commit 8cbe64eedd
1 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,9 @@
DELETE ai from
`vn`.`agencyIncoming` ai
LEFT JOIN `vn`.`agencyMode` am ON
am.id = ai.agencyModeFk
WHERE am.id IS null
ALTER TABLE `vn`.`agencyIncoming`
ADD CONSTRAINT `fk_agencyIncoming_agencyMode`
FOREIGN KEY (`agencyModeFk`)