Initial commit

This commit is contained in:
user
2026-07-12 13:47:34 +04:00
commit 51e2e789d0
37 changed files with 2005 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
CREATE TRIGGER IF NOT EXISTS CHK_Bookings_Insert BEFORE INSERT ON Bookings BEGIN
SELECT
RAISE (
FAIL,
"Reservation of table is not possible due to the existing reservation"
)
FROM
(
SELECT
datetime (NEW.reservation) AS new_res_dt,
datetime (reservation) AS res_dt,
datetime (reservation, time_reserve) AS reserved_until
FROM
Bookings
)
WHERE
new_res_dt >= res_dt
OR new_res_dt < reserved_until;
--
END;