Updated repo SQL, created viewrepo model