campingmontagut/revert/contact_email.sql
jordi fita mas 17f7520876 Add customer and invoices sections
Copied as much as i could from Numerus, and made as few modifications as
i could to adapt to this code base; it is, quite frankly, a piece of
shit.

We need to be able to create invoices from scratch “just in case”,
apparently, but it is not yet possible to create an invoice from a
booking.
2024-04-28 20:28:45 +02:00

24 lines
346 B
PL/PgSQL

-- Revert camper:contact_email from pg
begin;
set search_path to camper, public;
alter table contact
add column email email
;
update contact
set email = email.email
from contact_email as email
where email.contact_id = email.contact_id
;
alter table contact
alter column email set not null
;
drop table if exists contact_email;
commit;