Hi, I've found at least one Koha database that has multiple issues rows for the same item but different patrons. This doesn't map well to the reality of loaning physical items, unless somebody's slipped in a Star Trek-style replicator feature, so I propose the following changes to constraints on the issues table: 1. Make itemnumber the primary key (and not null) - an item can be issued only once at any given time. 2. Make borrowernumber not null - a loan must be to a specific patron, and if the item is detached from the patron, there's no longer a loan. 3. Make renewals not null with a default value of 0. 4. Make issuedate not null - a loan must have started at a specific time; during a migration, if the issue date is not known, a made-up date can be supplied. Comments? Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
All sound good to me. On Wed, Oct 15, 2008 at 6:37 PM, Galen Charlton <galen.charlton@liblime.com>wrote:
Hi,
I've found at least one Koha database that has multiple issues rows for the same item but different patrons. This doesn't map well to the reality of loaning physical items, unless somebody's slipped in a Star Trek-style replicator feature, so I propose the following changes to constraints on the issues table:
1. Make itemnumber the primary key (and not null) - an item can be issued only once at any given time. 2. Make borrowernumber not null - a loan must be to a specific patron, and if the item is detached from the patron, there's no longer a loan. 3. Make renewals not null with a default value of 0. 4. Make issuedate not null - a loan must have started at a specific time; during a migration, if the issue date is not known, a made-up date can be supplied.
Comments?
Regards,
Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
Hi Galen Does the issues table now only contain current issues? Ie no history of past issues How do we find out a borrowers reading history then? (People in NZ like this feature a lot, especially places like retirement homes so the library doesnt send them the same books all the time) Im hoping this is just being stored somewhere else now? (Thats the historical reason for multiple rows for the same itemnumber .. there should only ever be 1 with the returndate that is not null tho, IE only one that hasnt been returned) Chris On Thu, Oct 16, 2008 at 11:37 AM, Galen Charlton <galen.charlton@liblime.com> wrote:
Hi,
I've found at least one Koha database that has multiple issues rows for the same item but different patrons. This doesn't map well to the reality of loaning physical items, unless somebody's slipped in a Star Trek-style replicator feature, so I propose the following changes to constraints on the issues table:
1. Make itemnumber the primary key (and not null) - an item can be issued only once at any given time. 2. Make borrowernumber not null - a loan must be to a specific patron, and if the item is detached from the patron, there's no longer a loan. 3. Make renewals not null with a default value of 0. 4. Make issuedate not null - a loan must have started at a specific time; during a migration, if the issue date is not known, a made-up date can be supplied.
Comments?
Regards,
Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
Hi, On Wed, Oct 15, 2008 at 7:12 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
Does the issues table now only contain current issues? Ie no history of past issues
Past issues were moved to old_issues a while back, so the reading history is still retained until purged or anonymized. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
++ here. I would suggest going just a bit further: let's fix the other columns in the table while we're there. * what is the difference between branchcode and issuingbranch ? A transaction can only happen at one location, so that should be NOT NULL and the other should be removed. issues.return and returndate should be removed. We've seen a couple of reports of these phantom loans, which would be made impossible by db constraints. So far, evidence points to setting the item to LOST (chargelostitem), but the jury's still out. regardless of the cause of this particular bug, I think we should take advantage of the database's integrity features here: ++galen. Ryan On Wed, Oct 15, 2008 at 7:24 PM, Galen Charlton <galen.charlton@liblime.com>wrote:
Hi,
On Wed, Oct 15, 2008 at 7:12 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
Does the issues table now only contain current issues? Ie no history of past issues
Past issues were moved to old_issues a while back, so the reading history is still retained until purged or anonymized.
Regards,
Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Ryan Higgins LibLime * Open-Source Solutions for Libraries Featuring KohaZOOM ILS 888-564-2457 x704
On Wed, Oct 15, 2008 at 6:37 PM, Galen Charlton <galen.charlton@liblime.com> wrote:
Hi,
I've found at least one Koha database that has multiple issues rows for the same item but different patrons. This doesn't map well to the reality of loaning physical items, unless somebody's slipped in a Star Trek-style replicator feature, so I propose the following changes to constraints on the issues table:
1. Make itemnumber the primary key (and not null) - an item can be issued only once at any given time. 2. Make borrowernumber not null - a loan must be to a specific patron, and if the item is detached from the patron, there's no longer a loan. 3. Make renewals not null with a default value of 0. 4. Make issuedate not null - a loan must have started at a specific time; during a migration, if the issue date is not known, a made-up date can be supplied.
Comments?
+1 here as well. I think relationships should be enforced in the db as much as possible. Regards, Chris
Galen Charlton a écrit :
Hi,
I've found at least one Koha database that has multiple issues rows for the same item but different patrons. This doesn't map well to the reality of loaning physical items, unless somebody's slipped in a Star Trek-style replicator feature, so I propose the following changes to constraints on the issues table:
1. Make itemnumber the primary key (and not null) - an item can be issued only once at any given time. 2. Make borrowernumber not null - a loan must be to a specific patron, and if the item is detached from the patron, there's no longer a loan. I plan to say "no" here, but thinking of it, you're right... in many countries, the law requires that we anonymize the issues. So we set borrowernumber=0, but keep track of the fact that we issue item N to someone. So in old_issues, this constraint can't be set. in issues, it can, as we won't anonimyze an issue that is not returned.
3. Make renewals not null with a default value of 0. 4. Make issuedate not null - a loan must have started at a specific time; during a migration, if the issue date is not known, a made-up date can be supplied.
so, it's OK for me. -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
participants (6)
-
Chris Cormack -
Chris Nighswonger -
Galen Charlton -
Joe Atzberger -
Paul POULAIN -
Ryan Higgins