added type to relations and to sql table