feat: cascade on delete for bookings
This commit is contained in:
parent
7e193adad7
commit
6abfbe17d0
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ CREATE TABLE BookingGuest (
|
|||
bookingId NUMBER NOT NULL,
|
||||
personId NUMBER NOT NULL,
|
||||
PRIMARY KEY(bookingId, personId),
|
||||
FOREIGN KEY (bookingId) REFERENCES Booking(bookingId),
|
||||
FOREIGN KEY (bookingId) REFERENCES Booking(bookingId) ON DELETE CASCADE,
|
||||
FOREIGN KEY (personId) REFERENCES Person(personId)
|
||||
);
|
||||
|
||||
|
@ -100,7 +100,7 @@ CREATE TABLE BookingRoom (
|
|||
bookingId NUMBER NOT NULL,
|
||||
roomNumber NUMBER NOT NULL,
|
||||
PRIMARY KEY(bookingId, roomNumber),
|
||||
FOREIGN KEY (bookingId) REFERENCES Booking(bookingId),
|
||||
FOREIGN KEY (bookingId) REFERENCES Booking(bookingId) ON DELETE CASCADE,
|
||||
FOREIGN KEY (roomNumber) REFERENCES Room(roomNumber)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue