camper/deploy/acsi.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

24 lines
606 B
PL/PgSQL

-- Deploy camper:acsi to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
begin;
set search_path to camper, public;
create table acsi (
campsite_type_id integer primary key references campsite_type,
number_adults positive_integer not null,
number_teenagers nonnegative_integer not null,
number_children nonnegative_integer not null,
number_dogs nonnegative_integer not null,
cost_per_night nonnegative_integer not null
);
grant select on table acsi to guest;
grant select on table acsi to employee;
grant select, insert, update, delete on table acsi to admin;
commit;