feat: Enhance reservation functionality
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- The overlap exclusion constraint must not apply to cancelled reservations,
|
||||
-- so that a cancelled slot can be re-booked by another member.
|
||||
|
||||
alter table public.reservations
|
||||
drop constraint no_overlapping_reservations;
|
||||
|
||||
alter table public.reservations
|
||||
add constraint no_overlapping_reservations
|
||||
exclude using gist (
|
||||
boat_id with =,
|
||||
tstzrange(start_time, end_time, '[)') with &&
|
||||
) where (status <> 'cancelled');
|
||||
Reference in New Issue
Block a user