[Nottingham] SQLite and 'locking'
Martin Garton
martin at stupids.org
Tue Feb 27 12:11:07 GMT 2007
On Tue, 2007-02-27 at 11:59 +0000, Martin wrote:
> Martin Garton wrote:
> > On Tue, 2007-02-27 at 11:21 +0000, Duncan John Fyfe wrote:
> >
> >> If you use NULL to flag 'available' how do you record a seat as
> >> 'unavailable and not booked' (eg. seat 10 has been broken) ?
> >> Here is a new perfectly reasonable 'not booked' state.
> >
> > Fair point. For this simple example I was assuming the only reason a
> > seat would not be available was because it was booked. How would you
> > handle this case? With an additional "broken seats" table?
>
> Is this not all cleared up by using an enumerated status column?
>
> Then it's a simple case (later) to add new status options for additional
> states such as seat broken, seat too dirty, baby seat, oversized seat,
> ... all without breaking too much of the existing code.
How do you indicate a dirty baby seat?
In general i strongly dislike "status" fields and prefer separating
things into different fields in all but the most trivial of cases.
--
Martin.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/nottingham/attachments/20070227/7bac0fdc/attachment-0001.bin
More information about the Nottingham
mailing list