have repo OrderBy definitions defined in one place and use a single type for OrderBy database options (cherry picked from commit bb04311b0b5b7a28f94c4bc409db1c4a04bcef17)