Add sql functions for user/project interactions