Bug 14570: Add a UNIQUE constraint on guarantor_id+guarantee_id
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
5d2a082647
commit
abb801ebbc
|
|
@ -10,6 +10,7 @@ if( CheckVersion( $DBversion ) ) {
|
|||
guarantee_id INT(11) NOT NULL,
|
||||
relationship VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY `guarantor_guarantee_idx` ( `guarantor_id`, `guarantee_id` ),
|
||||
CONSTRAINT r_guarantor FOREIGN KEY ( guarantor_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT r_guarantee FOREIGN KEY ( guarantee_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
|
|
|||
|
|
@ -4080,6 +4080,7 @@ CREATE TABLE `borrower_relationships` (
|
|||
guarantee_id INT(11) NOT NULL,
|
||||
relationship VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY `guarantor_guarantee_idx` ( `guarantor_id`, `guarantee_id` ),
|
||||
CONSTRAINT r_guarantor FOREIGN KEY ( guarantor_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT r_guarantee FOREIGN KEY ( guarantee_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
|
|
|||
Loading…
Reference in New Issue