-- Migration: Track servers by (name, url) - same name + same url = don't add; different = add
-- Unique key includes embed so duplicate (episode_id, type, server_name, embed) is skipped

-- Normalize NULL embed to '' so unique key deduplicates correctly
UPDATE servers SET embed = '' WHERE embed IS NULL;

ALTER TABLE servers DROP INDEX unique_servers_entry;
ALTER TABLE servers ADD UNIQUE KEY unique_servers_entry (episode_id, type, server_name, embed);
