Add cascade deletes for Reservation foreign keys (part h)

master
Nick Krichevsky 2019-08-26 23:15:59 -04:00
parent d03d0f5069
commit 0a79f86be8
1 changed files with 3 additions and 3 deletions

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;