The table ``theme_ir_ui_view`` only exists when the ``theme`` (website) module was installed in the source database. If it was never installed, the cleanup block crashes with "relation does not exist". Add a ``to_regclass`` guard to skip silently instead.