camper/deploy/booking__campsite_id.sql

14 lines
314 B
PL/PgSQL

-- Deploy camper:booking__campsite_id to pg
-- requires: booking
begin;
set search_path to camper, public;
alter table booking
add column campsite_id integer references campsite
, add constraint booking_needs_campsite check ( booking_status in ('created', 'cancelled') or campsite_id is not null )
;
commit;