do $$ begin
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_CONSULTATION_KAS_AKENEO' and column_name='objectively')
		then
			ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "objectively" TYPE text;
			ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "objectively" DROP NOT NULL;
		END IF;	
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_CONSULTATION_KAS_AKENEO' and column_name='recommendations')
		then
			ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "recommendations" TYPE text;
			ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "recommendations" DROP NOT NULL;
		END IF;
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_CONSULTATION_KAS_AKENEO' and column_name='conclusion')
		then
		ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "conclusion" TYPE text;
		UPDATE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
		ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;
		END IF;
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO' and column_name='protocol')
		then
			ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "protocol" TYPE text;
			ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "protocol" DROP NOT NULL;
		END IF;
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO' and column_name='conclusion')
		then
		ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "conclusion" TYPE text;
		UPDATE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
		ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;
		END IF;
end; $$;