def _update_all_ids_to_uuids(t_images, t_image_members, t_image_properties):
 images = list(t_images.select().execute())
 for image in images:
  old_id = image['id']
  new_id = str(uuid.uuid4())
  t_images.update().where((t_images.c.id == old_id)).values(id=new_id).execute()
  t_image_members.update().where((t_image_members.c.image_id == old_id)).values(image_id=new_id).execute()
  t_image_properties.update().where((t_image_properties.c.image_id == old_id)).values(image_id=new_id).execute()
  t_image_properties.update().where(and_(or_((t_image_properties.c.name == 'kernel_id'), (t_image_properties.c.name == 'ramdisk_id')), (t_image_properties.c.value == old_id))).values(value=new_id).execute()

def _update_all_ids_to_uuids ( t_images , t_image_members , t_image_properties ) : images = list ( t_images . select ( ) . execute ( ) ) for image in images : old_id = image [ 'id' ] new_id = str ( uuid . uuid4 ( ) ) t_images . update ( ) . where ( ( t_images . c . id == old_id ) ) . values ( id = new_id ) . execute ( ) t_image_members . update ( ) . where ( ( t_image_members . c . image_id == old_id ) ) . values ( image_id = new_id ) . execute ( ) t_image_properties . update ( ) . where ( ( t_image_properties . c . image_id == old_id ) ) . values ( image_id = new_id ) . execute ( ) t_image_properties . update ( ) . where ( and_ ( or_ ( ( t_image_properties . c . name == 'kernel_id' ) , ( t_image_properties . c . name == 'ramdisk_id' ) ) , ( t_image_properties . c . value == old_id ) ) ) . values ( value = new_id ) . execute ( )
transition from integer id to varchar id .