24 lines
346 B
PL/PgSQL
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;
|