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,
|
bookingId NUMBER NOT NULL,
|
||||||
personId NUMBER NOT NULL,
|
personId NUMBER NOT NULL,
|
||||||
PRIMARY KEY(bookingId, personId),
|
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)
|
FOREIGN KEY (personId) REFERENCES Person(personId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ CREATE TABLE BookingRoom (
|
||||||
bookingId NUMBER NOT NULL,
|
bookingId NUMBER NOT NULL,
|
||||||
roomNumber NUMBER NOT NULL,
|
roomNumber NUMBER NOT NULL,
|
||||||
PRIMARY KEY(bookingId, roomNumber),
|
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)
|
FOREIGN KEY (roomNumber) REFERENCES Room(roomNumber)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue