campingmontagut/deploy/acsi_calendar.sql
jordi fita mas 0412ffca05 Compute ACSI discount
After months of keeping what does the ACSI checkbox mean, now customer
told us that we should add a discount based on a series of
arbitrary conditions that, and need to be done NOW!

There is no UI to edit the conditions due to lack of time.
2024-03-14 22:08:01 +01:00

22 lines
581 B
PL/PgSQL

-- Deploy camper:acsi_calendar to pg
-- requires: roles
-- requires: schema_camper
-- requires: acsi
begin;
set search_path to camper, public;
create table acsi_calendar (
campsite_type_id integer not null references acsi,
acsi_range daterange not null,
primary key (campsite_type_id, acsi_range),
constraint disallow_acsi_overlap exclude using gist (campsite_type_id with =, acsi_range with &&)
);
grant select on table acsi_calendar to guest;
grant select on table acsi_calendar to employee;
grant select, insert, update, delete on table acsi_calendar to admin;
commit;