ALTER TABLE WMSA_prod.EC_DOMAIN_LINK
MODIFY COLUMN ID BIGINT NOT NULL AUTO_INCREMENT;

DELIMITER $$
CREATE OR REPLACE PROCEDURE PURGE_LINKS_TABLE (IN nodeId INT)
BEGIN
    DELETE EC_DOMAIN_LINK FROM EC_DOMAIN_LINK INNER JOIN WMSA_prod.EC_DOMAIN ON EC_DOMAIN_LINK.SOURCE_DOMAIN_ID = EC_DOMAIN.ID WHERE NODE_AFFINITY = nodeId;
END$$
DELIMITER ;