-- Clean dependencies in cadastro_fot first to avoid FK violations
DELETE FROM cadastro_fot 
WHERE ano_formatura_id IN (
    SELECT id FROM anos_formaturas WHERE ano_semestre !~ '^\d{4}\.[1-2]$'
);

-- Delete the garbage years (e.g. 2025.3, 2021.0, etc)
DELETE FROM anos_formaturas 
WHERE ano_semestre !~ '^\d{4}\.[1-2]$';
