Add cascade deletes for Reservation foreign keys (part h)

This commit is contained in:
Nick Krichevsky 2019-08-26 23:15:59 -04:00
parent d03d0f5069
commit 0a79f86be8

View file

@ -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;