Either upon granting of custody of a child to the department and the provision of foster care or upon the department's making foster care maintenance payments on behalf of a child under provisions of Title IV-E of the Social Security Act, the department shall by operation of law be assigned the right to any support owed to or for such child. The assignment:
(1) shall be effective as to both current and accrued support obligations; and
(2) shall terminate when the department is no longer providing foster care, except with respect to the amount of any unpaid support obligation accrued under the assignment.