do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_DIAGNOSIS' and indexname ilike 'UQ_T_CDA_SECTION_DIAGNOSIS_CdaDocumentProtocolextractRev2')
THEN
drop index AKUZ.UQ_T_CDA_SECTION_DIAGNOSIS_CdaDocumentProtocolextractRev2;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_DIAGNOSIS DROP CONSTRAINT if exists UQ_T_CDA_SECTION_DIAGNOSIS_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_DIAGNOSIS DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_DIAGNOSIS ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX UQ_T_CDA_SECTION_DIAGNOSIS_CdaDocumentProtocolextractRev2 ON AKUZ.T_CDA_SECTION_DIAGNOSIS(CdaDocumentProtocolextractRev2);

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_DOCINFO_PROTOCOLV2' and indexname ilike 'uq_t_cda_section_docinfo_protocolv2_cdadocumentprotoco_ad975873')
THEN
drop index AKUZ.uq_t_cda_section_docinfo_protocolv2_cdadocumentprotoco_ad975873;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 DROP CONSTRAINT if exists UQ_T_CDA_SECTION_DOCINFO_PROTOCOLV2_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX uq_t_cda_section_docinfo_protocolv2_cdadocumentprotoco_ad975873 ON AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2(CdaDocumentProtocolextractRev2);

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_HIGHTECH_CARE' and indexname ilike 'UQ_T_CDA_SECTION_HIGHTECH_CARE_CdaDocumentProtocolextractRev2')
THEN
drop index AKUZ.UQ_T_CDA_SECTION_HIGHTECH_CARE_CdaDocumentProtocolextractRev2;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_HIGHTECH_CARE DROP CONSTRAINT if exists UQ_T_CDA_SECTION_HIGHTECH_CARE_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_HIGHTECH_CARE DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_HIGHTECH_CARE ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX UQ_T_CDA_SECTION_HIGHTECH_CARE_CdaDocumentProtocolextractRev2 ON AKUZ.T_CDA_SECTION_HIGHTECH_CARE(CdaDocumentProtocolextractRev2);

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_LINKED_DOCS' and indexname ilike 'UQ_T_CDA_SECTION_LINKED_DOCS_CdaDocumentProtocolextractRev2')
THEN
drop index AKUZ.UQ_T_CDA_SECTION_LINKED_DOCS_CdaDocumentProtocolextractRev2;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_LINKED_DOCS DROP CONSTRAINT if exists UQ_T_CDA_SECTION_LINKED_DOCS_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_LINKED_DOCS DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_LINKED_DOCS ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX UQ_T_CDA_SECTION_LINKED_DOCS_CdaDocumentProtocolextractRev2 ON AKUZ.T_CDA_SECTION_LINKED_DOCS(CdaDocumentProtocolextractRev2);

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_SERVICES_PROVIDED' and indexname ilike 'uq_t_cda_section_services_provided_cdadocumentprotocol_28a16c17')
THEN
drop index AKUZ.uq_t_cda_section_services_provided_cdadocumentprotocol_28a16c17;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_SERVICES_PROVIDED DROP CONSTRAINT if exists UQ_T_CDA_SECTION_SERVICES_PROVIDED_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_SERVICES_PROVIDED DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_SERVICES_PROVIDED ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX uq_t_cda_section_services_provided_cdadocumentprotocol_28a16c17 ON AKUZ.T_CDA_SECTION_SERVICES_PROVIDED(CdaDocumentProtocolextractRev2);

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SECTION_SPECIALIZED_CARE' and indexname ilike 'uq_t_cda_section_specialized_care_cdadocumentprotocole_bf85f487')
THEN
drop index AKUZ.uq_t_cda_section_specialized_care_cdadocumentprotocole_bf85f487;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SECTION_SPECIALIZED_CARE DROP CONSTRAINT if exists UQ_T_CDA_SECTION_SPECIALIZED_CARE_CdaDocumentProtocolextractRev2;
ALTER TABLE AKUZ.T_CDA_SECTION_SPECIALIZED_CARE DROP COLUMN if exists CdaDocumentProtocolextractRev2_UQ;
ALTER TABLE AKUZ.T_CDA_SECTION_SPECIALIZED_CARE ALTER COLUMN "cdadocumentprotocolextractrev2" DROP NOT NULL;
CREATE UNIQUE INDEX uq_t_cda_section_specialized_care_cdadocumentprotocole_bf85f487 ON AKUZ.T_CDA_SECTION_SPECIALIZED_CARE(CdaDocumentProtocolextractRev2);

