[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Database NOT NULLS - ex Diverging applications

On 9/12/06, David Tangye <..hidden..> wrote:
On Tue, 2006-09-12 at 22:49 -0700, Chris Travers wrote:

This is a classic data-integrity bug, and should be fixed with highest
priority. Generally the correct fix is to NOT NULL the relevant column.
That's what NOT NULL is for.
Of course it gets back to what I have said before, sorry if its getting
repetitive: its really a question of requirements and modelling.
Specifically 'what is the data in that column meant to represent, in
terms of a relationship or attribute in the logical model?' My guess is
that whatever the answer the column implements a mandatory relationship
or attribute, so must be NOT NULL.

I won't rehash old email conversations with DS here except to say that this is what I have been doing for a number of my customers and was fixed in LedgerSMB 1.0.0

I am fairly sure that there are other places in the current physical
schema that have this same bug. They just haven't led to broken
databases... yet.

There are real shortcomings to the db schema in part because the queries do a bogus insert first with nearly all nulls and then update in most cases (thank goodness the acc_trans is not handled this way).  So fixing the db schema means rewriting a lot of code.

Best Wishes,
Chris Travers