-- Tables

-- Alters

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

CREATE UNIQUE INDEX UQ_T_MOVEMENT_RESULT_LEK_PREP_LINK_OutcomeOfInspection ON AKUZ.T_MOVEMENT_RESULT_LEK_PREP_LINK(OutcomeOfInspection);

