In each civil action, judgment must be rendered in favor of each person having a lien for the amount due to him or her, and the court or judge thereof shall order any property subject to the lien herein provided for to be sold by the sheriff of the proper county in the same manner that personal property is sold on execution, and the court or judge shall apportion the proceeds of such sale to the payment of each judgment, according to the priorities established in this chapter pro rata in its class according to the amount of such judgment.