Migrate code to work with UUID instead of sequence ids