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

Re: API Suggestion was: Re: Unique constraint on part numbers



On Sun, Jun 15, 2008 at 10:36 PM, Luke <..hidden..> wrote:
> Further:
>
> This is a case where either program or API logic (preferably the latter)
> should prevent creation of a new item with the same partnumber, if another
> with that partnumber exists, and is listed as active.
> Chris???

I think when we get to redesigning parts, we may look at this.

However there are a lot of cases where the application currently does
less than optimal things relating to the database.  For example,
invoices are created by inserting date/time/process id into the
invoice number field then updating the record later in the
transaction.  Same with customers, vendors, etc. in 1.2.  For this
reason data integrity issues beyond those relating specifically to
join issues (primary/foreign key constraints, and a few not null
constraints) really need to wait until we are redoing this part of the
application.

My suspicion is that the conditional unique index I mentioned before
ought to work.  However, it should be seen as experimental until a few
people are using it successfully in production.

In 1.3, we add meaningful constraints to customers/vendors.  In 1.4, I
would expect that such constraints would be extended to all financial
aspects of the software.  Maybe we will get to parts or not but I am
not going to promise anything in that area yet.

Hope this helps
Chris Travers
>
> Problem: obsolete partnumber has a new version created which is not
> obsolete.  Someone attempts to unobsolete the original item.  Conflict
> happens.  Badness ensues.
> Solution: the same programming constraint logic which prevents creation of
> a duplicate active partnumber, would prevent unobsoletion of a duplicate
> active partnumber.
>
> Luke
>
>  On Sun, 15 Jun 2008,
> woodvorg wrote:
>
>>
>> Why is there no unique constraint on the partnumber field of parts? To me it
>> doesn't seem right; a part number should be a unique identifier for each
>> part.
>>
>> Easy fix, I just altered the parts table with a unique constraint, but this
>> produces nasty looking errors if you try to create a duplicate part.
>>
>
> --
> "Fiat money and sustainable society are not compatible." - Peter Cajander
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Ledger-smb-users mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
>