Migrate ids integer to uuid
Replace find_by_identifier and find_by_subdomain

This is necessary in order to be able to find by uuids. These functions
were a little bit hacky