     END$$
 DELIMITER ;
 
+# LoadBalancerListenerVO
+DROP TRIGGER IF EXISTS trigger_clean_AccountResourceRefVO_for_LoadBalancerListenerVO;
+DELIMITER $$
+CREATE TRIGGER trigger_clean_AccountResourceRefVO_for_LoadBalancerListenerVO AFTER DELETE ON `LoadBalancerListenerVO`
+FOR EACH ROW
+    BEGIN
+        DELETE FROM `AccountResourceRefVO` WHERE `resourceUuid` = OLD.`uuid` AND `resourceType` = 'LoadBalancerListenerVO';
+    END$$
+DELIMITER ;
+
+# LoadBalancerVO
+DROP TRIGGER IF EXISTS trigger_clean_AccountResourceRefVO_for_LoadBalancerVO;
+DELIMITER $$
+CREATE TRIGGER trigger_clean_AccountResourceRefVO_for_LoadBalancerVO AFTER DELETE ON `LoadBalancerVO`
+FOR EACH ROW
+    BEGIN
+        DELETE FROM `AccountResourceRefVO` WHERE `resourceUuid` = OLD.`uuid` AND `resourceType` = 'LoadBalancerVO';
+    END$$
+DELIMITER ;
+
 # PolicyVO
 DROP TRIGGER IF EXISTS trigger_clean_AccountResourceRefVO_for_PolicyVO;
 DELIMITER $$

    END$$
DELIMITER ;

# QuotaVO
DROP TRIGGER IF EXISTS trigger_clean_AccountResourceRefVO_for_QuotaVO;
DELIMITER $$

    END$$
DELIMITER ;


ALTER TABLE `zstack`.`SharedResourceVO` ADD UNIQUE INDEX(`ownerAccountUuid`,`receiverAccountUuid`,`resourceUuid`);
ALTER TABLE `zstack`.`ShareableVolumeVmInstanceRefVO` ADD UNIQUE INDEX(`volumeUuid`,`vmInstanceUuid`);
