make Repo model; add indexes