'Change volume types to UUID'

def _pre_upgrade_004(self, engine):

    data = {'volumes': [{'id': str(uuid.uuid4()), 'host': 'test1', 'volume_type_id': 1}, {'id': str(uuid.uuid4()), 'host': 'test2', 'volume_type_id': 1}, {'id': str(uuid.uuid4()), 'host': 'test3', 'volume_type_id': 3}], 'volume_types': [{'name': 'vtype1'}, {'name': 'vtype2'}, {'name': 'vtype3'}], 'volume_type_extra_specs': [{'volume_type_id': 1, 'key': 'v1', 'value': 'hotep'}, {'volume_type_id': 1, 'key': 'v2', 'value': 'bending    rodrigez'}, {'volume_type_id': 2, 'key': 'v3', 'value': 'bending    rodrigez'}]}
    volume_types = db_utils.get_table(engine, 'volume_types')
    for vtype in data['volume_types']:
        r = volume_types.insert().values(vtype).execute()
        vtype['id'] = r.inserted_primary_key[0]
    volume_type_es = db_utils.get_table(engine, 'volume_type_extra_specs')
    for vtes in data['volume_type_extra_specs']:
        r = volume_type_es.insert().values(vtes).execute()
        vtes['id'] = r.inserted_primary_key[0]
    volumes = db_utils.get_table(engine, 'volumes')
    for vol in data['volumes']:
        r = volumes.insert().values(vol).execute()
        vol['id'] = r.inserted_primary_key[0]
    return data
