Hi,
Thanks to those who gave feedback. It looks like that it will be best left
to business rules. In the event that enrolmentItems are attached to leaver
enrolments (due to a coding error), they will be ignored.
Thanks.
___
sqlite-users mailing list
s
On Fri, 1 Aug 2014 09:26:14 +1200
Richard Warburton wrote:
> Hi,
>
> Consider:
>
> CREATE TABLE enrolment (
> id INTEGER PRIMARY KEY,
> child INT NOT NULL REFERENCES child (id),
> start INT NOT NULL,
> leaver INT NOT NULL DEFAULT 0 CHECK (leaver BETWEEN 0 AND 1), -- BOOL
> );
>
> CR
On Fri, 1 Aug 2014 09:26:14 +1200
Richard Warburton wrote:
> This way, you can't change the leaver field if enrolmentItems are
> attached, and you can't add an enrolmentItem if leaver is set to 1.
IIUC, you have tables A and B, and the rules are
you can add/delete rows in B while A.bo
On 31 Jul 2014, at 10:26pm, Richard Warburton
wrote:
> I'm looking for an elegant way to prevent enrolments having enrolmentItems
> if leaver is set to 1.
> [...]
> Ideally, I'd like a check in enrolmentItem that can examine a different
> field in the referenced enrolment record.
TRIGGERs are
Hi,
Consider:
CREATE TABLE enrolment (
id INTEGER PRIMARY KEY,
child INT NOT NULL REFERENCES child (id),
start INT NOT NULL,
leaver INT NOT NULL DEFAULT 0 CHECK (leaver BETWEEN 0 AND 1), -- BOOL
);
CREATE TABLE enrolmentItem (
id INTEGER PRIMARY KEY,
enrolment INT NOT NULL
5 matches
Mail list logo