Migrating embedded topics from topicId to automatic topic creation

I added a simple if switch to my website that uses a stored topicId if available and the page’s discourseEmbedUrl otherwise.

Sadly I had a bad URL for some pages and now I have bad thread references between the pages and the threads. I found the table topic_embeds, that seems to be it. Can I safely delete from that table and re-visit the pages to regenerate threads? Or do I need to clean up some related rows elsewhere?