[migration] more rename_entity_type fix
* ensure repository caches and system tables are properly cleanup
* delete relations from/to entities deleted through sql
So we don't ends up with a corrupted db...
# sync and restart to make sure cwuri does not appear in formssync_schema_props_perms()