
446 N.W.2d 28 (1989)
Loree Lynn SCHAFF, formerly Loree Mathern, Plaintiff and Appellant, and
Amber Mathern, Plaintiff,
v.
James Martin SCHAFF, Defendant and Appellee, and
Kenneth Gerhardt, Director of Morton County Social Services and Tammie Anderson, former Guardian Ad Litem for Amber Mathern, Defendants.
Civ. No. 890016.
Supreme Court of North Dakota.
September 26, 1989.
*29 David Alan Dick (argued), Wolf Point, Mont., for plaintiff and appellant.
Kelsch, Kelsch, Ruff & Austin, Mandan, for defendant and appellee; argued by Thomas D. Kelsch.
LEVINE, Justice.
Loree Schaff appeals from a district court judgment dismissing her declaratory judgment action against James Schaff. We reverse and remand for entry of judgment consistent with this opinion.
On September 20, 1984, Loree gave birth to a daughter out-of-wedlock. Pursuant to a stipulation in a paternity action, James admitted paternity of the child and agreed to pay as child support a lump-sum payment consisting of an annuity which provided $105 per month until the child's eighteenth birthday and treasury bonds with a future value of $20,000 as of February 2002. Under the stipulation, the child was entitled to $10,000 of the treasury bonds in February 2002 and the balance on her 22nd birthday. A paternity judgment was entered in December 1984 which specified that the lump-sum payment for child support could not be modified or revoked under Section 14-17-17(2), N.D.C.C.[1]
James and Loree were married in December 1985. During the marriage, Loree continued to receive the $105 monthly annuity payments and endorsed the checks over to James for payment of family expenses. In July 1987, Loree commenced a divorce action against James and sought additional child support for the child over and above the amount ordered in the paternity decree. The divorce court refused to award additional *30 child support, concluding that it did not have jurisdiction to set aside the non-modifiable child support awarded in the paternity judgment.
Loree then commenced this declaratory judgment action,[2] alleging that the non-modifiable support provisions of the paternity judgment were nullified by operation of law because of the parties' subsequent marriage and that the child support award was therefore modifiable. She also asserted that non-modifiable child support for a non-marital child was a violation of equal protection. The court determined that, under the facts of the case, the paternity decree had not been modified, revoked or nullified by operation of law. However, the court stated that, based upon the equities arising out of the marriage, Loree could request the divorce court to award additional child support. Loree then requested the divorce court to reconsider its prior decision. The divorce court denied Loree's request, concluding that the paternity judgment provided for child support and a separate cause of action for support did not exist in the divorce action. Loree appeals from the judgment entered in the declaratory judgment action.
James initially contends that this declaratory judgment action is an impermissible collateral attack on the paternity judgment.
In Hamilton v. Hamilton, 410 N.W.2d 508, 520 (N.D.1987), we distinguished a "collateral attack" from a "direct attack":
"Any attempt to avoid, defeat or evade a judgment, or to deny its force and effect, in some incidental proceeding not provided for by law, with the express purpose of obtaining relief from that judgment is a collateral attack. 49 C.J.S. Judgments § 408(b) (1947 & Supp.1986). Any attempt to impeach a judgment by matters dehors the record in an action or proceeding with an independent purpose that contemplates some other relief or result is a collateral attack on the judgment. Olson v. Donnelly, 70 N.D. 370, 378, 294 N.W. 666, 669 (1940).
"`A direct attack on a judgment is an attempt to avoid or correct it in some manner provided by law, in a proceeding instituted for that very purpose, in the same action and in the same court; ...' 49 C.J.S. Judgments § 408(a) (1947 & Supp.1986), quoted in Olson v. Donnelly, 294 N.W. at 669." [Emphasis in original].
In Hamilton v. Hamilton, supra, we held that because an independent action in equity to obtain relief from a divorce judgment[3] was permissible under Rule 60(b), N.D.R.Civ.P., as a legitimate means of providing a party relief from a judgment and was recognized as a permissible claim at law, that action was a direct attack on the divorce judgment and was not precluded as a matter of law.
Section 32-23-01, N.D.C.C., authorizes a court to declare the "rights, status, and other legal relations" of the parties in a declaratory judgment action. Loree sought to nullify the child support provisions of the paternity judgment based upon her marriage to James which occurred after that judgment was entered. Rather than relitigating the paternity action, she seeks a determination of her "rights, status, and other legal relations" as well as those of James, under the paternity judgment in a manner provided for by law. Loree's declaratory judgment action is therefore a permissible direct attack on that judgment.
Loree argues that her marriage to James nullified the custody and support provisions of the prior paternity decree. She relies upon decisions involving a divorced couple *31 who remarry each other and subsequently seek a divorce.[4]
We agree that the instant factual situation is analogous to the case of divorced parents who remarry each other. Generally, when divorced persons remarry each other, their remarriage nullifies the divorce court's order for child custody [Byzewski v. Byzewski, 429 N.W.2d 394 (N.D.1988)], and future installments of child support.[5]Root v. Root, 774 S.W.2d 521 (Mo.Ct.App. 1989); Davis v. Davis, 66 Cal.Rptr. 14, 437 P.2d 502 (1968); Greene v. Iowa Dist. Ct. for Polk County, 312 N.W.2d 915 (Ia.1981); Scheibel v. Scheibel, 204 Neb. 653, 284 N.W.2d 572 (1979). See Annot., Effect of remarriage of spouses to each other on child custody and support provisions of prior decree, 26 A.L.R.4th 325 (1983).
The rationale for the rule is that if the parties to a divorce decree remarry each other, they no longer have separate rights of custody and separate obligations for future support; rather, the same joint rights to custody and joint obligations for future support which antedated the divorce are resumed. Root v. Root, supra; Annot., supra, 26 A.L.R.4th at 327. In Root v. Root, supra, 774 S.W.2d at 523, the Missouri Court of Appeals aptly explained:
"It would be absurd to hold that once parents remarry each other and the family is again intact and residing in the same household, the former noncustodial parent must pay future installments of child support to the other parent per the past divorce decree. That is to say, the remarriage should terminate the former noncustodial parent's duty to pay any child support that would have become due after the remarriage."
Pursuant to our law, married parents and parents of children born out-of-wedlock have an equal right to custody and a mutual duty of support of their children. Sections 14-17-02, 14-09-04, 14-09-05, 14-09-06, and 14-09-08, N.D.C.C. The rights and liabilities of married parents are governed by Sections 14-09-04, 14-09-06, and 14-09-08, N.D.C.C., which provide for joint rights and liabilities for custody and support of children.
The Uniform Parentage Act, Ch. 14-17, N.D.C.C., was intended to establish the rights and liabilities of parents of children *32 born out-of-wedlock. 9B Uniform Laws Annotated, Prefatory Note, Uniform Parentage Act, p. 287; Section 14-07-01, N.D. C.C. In a paternity action, the court may enter a judgment or order determining each parent's separate rights and liabilities for custody and support. Section 14-17-14(3), N.D.C.C. Similarly, a divorce action involves the determination of the parents' separate rights and liabilities for the custody and support of their children. Sections 14-05-22 and 14-05-24, N.D.C.C.
We are not persuaded that there is a reasonable distinction to be drawn between the effect on a paternity judgment of the child's parents' subsequent marriage to each other and the effect on a divorce decree of the divorced parents' subsequent remarriage to each other. The paternity action, as well as the divorce action, each involves a determination of the separate rights and liabilities of parents for their children. While a paternity action and a divorce action establish the separate rights and liabilities of parents, those parents' subsequent marriage or remarriage establishes anew the parents' joint rights and liabilities for custody and support of their children replacing their former separate rights and liabilities. We believe that the rationale of the divorce cases regarding the resumption of joint rights to custody and joint obligations for future support upon remarriage should govern this case. Accordingly, we hold that when parents of a child born out-of-wedlock marry each other, the child custody and future support provisions[6] of the paternity judgment are nullified and replaced by the law governing the rights and obligations of married parents to their children. If those parents subsequently seek a divorce, the divorce laws are then applicable to the determination of child custody and support.
The declaratory judgment is reversed and the case is remanded for entry of judgment consistent with this opinion.
ERICKSTAD, C.J., and LEVINE, MESCHKE, GIERKE and VANDE WALLE, JJ., concur.
NOTES
[1]  Section 14-17-17, N.D.C.C., provides:

"14-17-17. Modification of judgment or order. The court has continuing jurisdiction to modify or revoke a judgment or order:
"1. For future education and support; and
"2. With respect to matters listed in subsections 3 and 4 of section 14-17-14 and subsection 2 of section 14-17-16, except that a court entering a judgment or order for the payment of a lump sum or the purchase of an annuity under subsection 4 of section 14-17-14 may specify that the judgment or order may not be modified or revoked."
[2]  Loree initially commenced this declaratory judgment action against the Director of Morton County Social Services, Kenneth Gerhardt, and Amber's guardian ad litem, Tammie Anderson. Pursuant to a stipulation by the parties, Gerhardt and Anderson were dismissed from the action, and they are not parties to this appeal.
[3]  We defined an independent action in equity to obtain relief from a judgment as "a general recognition of the equitable powers of a court to entertain an independent action to enjoin the enforcement of, or otherwise procure relief from, a judgment on whatever basis chancery would afford relief." Hamilton, supra, 410 N.W.2d at 513, fn. 4.
[4]  Loree also argues that if the paternity decree is not nullified by her subsequent marriage to James, Section 14-17-17(2), N.D.C.C., unconstitutionally discriminates against children born out-of-wedlock. Relying on Gerhardt v. Estate of Moore, ___ U.S. ___, 108 S.Ct. 2814, 100 L.Ed.2d 915 (1988) vacating 139 Wis.2d 833, 407 N.W.2d 895 (1987) and remanding for further consideration; Clark v. Jeter, 486 U.S. 456, 108 S.Ct. 1910, 100 L.Ed.2d 465 (1988); Pickett v. Brown, 462 U.S. 1, 103 S.Ct. 2199, 76 L.Ed.2d 372 (1983); Mills v. Habluetzel, 456 U.S. 91, 102 S.Ct. 1549, 71 L.Ed.2d 770 (1982); and Gomez v. Perez, 409 U.S. 535, 93 S.Ct. 872, 35 L.Ed.2d 56 (1973), she argues that a non-modifiable lump-sum payment for child support for children born out-of-wedlock violates equal protection because child support for a legitimate child whose parents are divorced may be modified when circumstances substantially change [Section 14-05-24, N.D.C.C.], but a lump-sum payment for child support for a child born out-of-wedlock may not be modified under similarly changed circumstances.

Because of our resolution of this case, we do not address that constitutional issue. Minot Daily News v. Holum, 380 N.W.2d 347 (N.D. 1986) [we refrain from deciding constitutional issues where appropriate alternative grounds to resolve the issue exist]. However, we observe that in Gerhardt v. Estate of Moore, 150 Wis.2d 563, 441 N.W.2d 734 (1989), the Wisconsin Supreme Court considered the United States Supreme Court's remand for reconsideration of Gerhardt v. Estate of Moore, 139 Wis.2d 833, 407 N.W.2d 895 (1987), and held that a non-modifiable lump-sum payment of child support for certain non-marital children violated equal protection because the classification failed to bear a substantial relationship to its asserted state interest of finality and encouraging settlements.
[5]  We note that in Ringstrom v. Ringstrom, 101 Ill.App.3d 677, 57 Ill.Dec. 193, 428 N.E.2d 743 (1981), the court held that the parties' remarriage to each other nullified even past-due and unpaid arrearages for child support from the time between entry of the divorce decree and remarriage. In Root v. Root, 774 S.W.2d 521 (Mo.Ct.App.1989), the Missouri Court of Appeals refused to follow Ringstrom, supra, reasoning that the mother was a judgment creditor of the father for the accrued and past-due child support and that that judgment was not extinguished by the parties' remarriage. See Kinsella v. Kinsella, 181 N.W.2d 764 (N.D.1970) [accrued but unpaid child support cannot be modified]. Because this case does not involve accrued but unpaid child support, we need not decide the effect of the marriage upon accrued child support owing at the time of the marriage.
[6]  James raises no issue in his appellate brief about the effect of the marriage on his prior admission of paternity in the paternity action. During oral argument, counsel for James stated that James admitted paternity in exchange for acceptance of his payment of a non-modifiable lump sum for child support and that if the marriage nullified the custody and future support provisions of the paternity judgment, his admission of paternity should also be nullified. That issue has not been briefed or otherwise argued and we express no opinion on it.
