DECLARE
  v_cnt NUMBER;
BEGIN
  SELECT COUNT(1)
  INTO v_cnt
  FROM user_indexes
  WHERE index_name = 'XPK_DBM_MODULES_TABLES' ;
  IF v_cnt         =1 THEN
    EXECUTE immediate 'ALTER TABLE DBM_MODULE_TABLES DROP CONSTRAINT XPK_DBM_MODULES_TABLES';
    EXECUTE immediate 'ALTER TABLE DBM_MODULE_TABLES ADD CONSTRAINT XPK_DBM_MODULE_TABLES PRIMARY KEY ("MODULE_ID", "SEQUENCE_ID")';
  END IF;
END;