I successfully resolved the issue with existing constraints and indexes! I now have a complete script that works across all tables and projects. It took me two full days to write, incorporating 40 functions, 1 procedure, and around 10 queries.
If anyone needs this script, feel free to reach out to me.
PS: @andatki I’d love to see it included in the book, as this was a missing piece that could benefit many readers.
Best regards,
Viktor