public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: JORGE MALDONADO <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: One parent record with 3 possible child records
Date: Wed, 1 May 2024 16:24:15 -0700
Message-ID: <CAKFQuwYPeiXTT0GTrN3o7Ja7P9G9Z-LerHsdbzCDqe=SRhffyg@mail.gmail.com> (raw)
In-Reply-To: <CAAY=A79usb2Lbr9nUyzxyRNWLQNc-w3oTBbtUGyC2a4E-qaX3A@mail.gmail.com>
References: <CAAY=A79usb2Lbr9nUyzxyRNWLQNc-w3oTBbtUGyC2a4E-qaX3A@mail.gmail.com>
On Wednesday, May 1, 2024, JORGE MALDONADO <[email protected]> wrote:
>
> Let's say that tableMain has a string field called "type" with the
> following possible values: "residential", "industrial" and "energy".
>
This, and have the same column in the other tables, but add a check
constraint ensuring only the correct enum value can be specified. Then
your foreign key from the child tables to main is both the ID and the type
field.
David J.
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: One parent record with 3 possible child records
In-Reply-To: <CAKFQuwYPeiXTT0GTrN3o7Ja7P9G9Z-LerHsdbzCDqe=SRhffyg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox