Open robmaceachern opened 12 years ago
@rc9 and @rkw10 for comment
i suppose it would be good to have, though I can't think of a SQL way to handle it...it's mostly up to implementation to ensure that only when a copy is borrowed it gets set to 'out' and 'in' when returned.
I was wondering if assertions might be applicable here:
http://www.ugrad.cs.ubc.ca/~cs304/2011W1/notes/Unit06-SQL-2up.pdf slide 54
I think we should add some kind of constraint between borrowing.inDate and bookCopy.status.
It seems odd that you could have a bookCopy marked as out without any corresponding borrowing...
or have a bookCopy with status 'in' and associated with an active borrowing.