do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'RDS' and tablename ilike 'T_ELECTRONIC_CERTIFICATE_MESSAGE' and indexname ilike 'UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_CertificateApplicationEgissoStatus')
THEN
drop index RDS.UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_CertificateApplicationEgissoStatus;
END IF;
end; $$;
ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_MESSAGE DROP CONSTRAINT if exists UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_CertificateApplicationEgissoStatus;
ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_MESSAGE DROP COLUMN if exists CertificateApplicationEgissoStatus_UQ;


do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'RDS' and tablename ilike 'T_ELECTRONIC_CERTIFICATE_MESSAGE' and indexname ilike 'UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_ElectronicCertificateStatus')
THEN
drop index RDS.UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_ElectronicCertificateStatus;
END IF;
end; $$;
ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_MESSAGE DROP CONSTRAINT if exists UQ_T_ELECTRONIC_CERTIFICATE_MESSAGE_ElectronicCertificateStatus;
ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_MESSAGE DROP COLUMN if exists ElectronicCertificateStatus_UQ;


ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_STATUS ADD "egissostatus" integer NULL;

ALTER TABLE RDS.T_ELECTRONIC_CERTIFICATE_STATUS ADD "egissoverificationdate" timestamp NULL;

ALTER TABLE RDS.T_CERTIFICATE_APPLICATION_EGISSO_STATUS ADD "egissostatus" integer NULL;

ALTER TABLE RDS.T_CERTIFICATE_APPLICATION_EGISSO_STATUS ADD "egissoverificationdate" timestamp NULL;