delete from widgets where
 tabela_specyficzna1_id is null and
 tabela_specyficzna2_id is null and
    ....
 tabela_specyficznan_id is null;
