From 0a79f86be88837632bdf90c18c307c1dc44664df Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Mon, 26 Aug 2019 23:15:59 -0400 Subject: [PATCH] Add cascade deletes for Reservation foreign keys (part h) --- Cruise.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cruise.sql b/Cruise.sql index 0a344e2..da03cb4 100644 --- a/Cruise.sql +++ b/Cruise.sql @@ -49,8 +49,8 @@ CREATE TABLE Reservation( travelAgentID NUMBER, travelDate DATE, CONSTRAINT Reservation_pk PRIMARY KEY(reservationID), - CONSTRAINT Reservation_customerID_fk FOREIGN KEY (customerID) REFERENCES Customer(customerID), - CONSTRAINT Reservation_cruiseID_fk FOREIGN KEY (cruiseID) REFERENCES Cruise(cruiseID), - CONSTRAINT Reservation_travelAgentID_fk FOREIGN KEY (travelAgentID) REFERENCES TravelAgent(travelAgentID) + CONSTRAINT Reservation_customerID_fk FOREIGN KEY (customerID) REFERENCES Customer(customerID) ON DELETE CASCADE, + CONSTRAINT Reservation_cruiseID_fk FOREIGN KEY (cruiseID) REFERENCES Cruise(cruiseID) ON DELETE CASCADE, + CONSTRAINT Reservation_travelAgentID_fk FOREIGN KEY (travelAgentID) REFERENCES TravelAgent(travelAgentID) ON DELETE CASCADE ); CREATE SEQUENCE reservationID_seq; \ No newline at end of file