fixing ordering of views in db