camper/deploy/booking_option.sql

25 lines
684 B
PL/PgSQL

-- Deploy camper:booking_option to pg
-- requires: roles
-- requires: schema_camper
-- requires: booking
-- requires: campsite_type_option
-- requires: positive_integer
-- requires: nonnegative_integer
begin;
set search_path to camper, public;
create table booking_option (
booking_id integer not null references booking,
campsite_type_option_id integer not null references campsite_type_option,
units positive_integer not null,
subtotal nonnegative_integer not null,
primary key (booking_id, campsite_type_option_id)
);
grant select, insert, update, delete on table booking_option to employee;
grant select, insert, update, delete on table booking_option to admin;
commit;