Merge pull request 'refactor: refs #8613 add fk to claimEnd.claimDestinationFk' (!3479) from 8613-addFkClaimDestinationFk into dev
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: #3479 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
3330db84fa
|
@ -0,0 +1,8 @@
|
||||||
|
UPDATE vn.claimEnd ce
|
||||||
|
JOIN(
|
||||||
|
SELECT id
|
||||||
|
FROM vn.claimEnd
|
||||||
|
WHERE claimDestinationFk NOT IN
|
||||||
|
(SELECT id FROM vn.claimDestination WHERE id IS NOT NULL)
|
||||||
|
) s ON ce.id = s.id
|
||||||
|
SET ce.claimDestinationFk = 1;
|
|
@ -0,0 +1,7 @@
|
||||||
|
ALTER TABLE vn.claimEnd
|
||||||
|
MODIFY COLUMN claimDestinationFk tinyint(3) unsigned NOT NULL DEFAULT 1,
|
||||||
|
ADD CONSTRAINT fk_claimEnd_claimDestination
|
||||||
|
FOREIGN KEY (claimDestinationFk)
|
||||||
|
REFERENCES claimDestination(id)
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
ON DELETE RESTRICT;
|
Loading…
Reference in New Issue