Re: Difficulty enforcing a table invariant

2021-08-12 Thread Mark Raynsford
On 2021-08-12T07:58:57 + Mark Raynsford wrote: > > Each row of items table describes a class of item, and indicates how > many of that class of item we have. Same goes for the item_locations > table; each row of the table indicates how many of each class of item > are in each storage

Re: Difficulty enforcing a table invariant

2021-08-12 Thread Mark Raynsford
On 2021-08-11T13:35:31 -0700 Rick Hillegas wrote: > Triggers sound like the right tool for the job. I can't offer any more > specific advice. I don't understand why item_count and > item_location_count are hard-coded into the tables rather than being > constructed on the fly by queries.

Re: Difficulty enforcing a table invariant

2021-08-11 Thread Rick Hillegas
Triggers sound like the right tool for the job. I can't offer any more specific advice. I don't understand why item_count and item_location_count are hard-coded into the tables rather than being constructed on the fly by queries. On 8/11/21 7:31 AM, Mark Raynsford wrote: Hello. I have the