DO $$ 
begin
if(not exists(
SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'pharm'
   AND table_name   = 't_product_form'
	and column_name = 'appointment'
))
then
alter table PHARM.T_PRODUCT_FORM ADD Appointment boolean;
update PHARM.T_PRODUCT_FORM set Appointment = '0';
alter table PHARM.T_PRODUCT_FORM ALTER Column Appointment set not null;
end if;
	end;
$$