camper/revert/booking__stay.sql

24 lines
397 B
PL/PgSQL

-- Revert camper:booking__stay from pg
begin;
set search_path to camper, public;
alter table booking
add column arrival_date date
, add column departure_date date
;
update booking
set arrival_date = lower(stay)
, departure_date = upper(stay)
;
alter table booking
drop column if exists stay
, alter column arrival_date set not null
, alter column departure_date set not null
;
commit;