[Koha-devel] Koha db schema pecularities

Jared Camins-Esakov jcamins at cpbibliography.com
Tue Sep 6 19:23:12 CEST 2011


Hello.

I was looking at the schema that Koha uses for its database, and noticed a
few peculiarities that I wonder if anyone could shed some light on:

The serial table uses VARCHAR(100) for serial.biblionumber and
serial.subscriptionid. Is there any context in which those are not numeric
identifiers? Presumably as a result of that, there are no foreign key
constraints on the serial table. I think there probably should be.

There's a similar situation with the subscription table:
subscription.biblionumber doesn't have a foreign key relation with
biblio.biblionumber, nor, indeed, any index at all. Foreign keys are also
lacking for subscription.aqbooksellerid and subscription.aqbudgetid.

On the subject of foreign keys, should items.itype have a foreign key
linking it to itemtypes?

My understanding of foreign key relationships is that they're a Good Thing
because they provide a means to ensure referential integrity. Am I missing
something in these particular cases (and there are probably others, these
are just the ones I happened to notice), or would people say this was
probably just an oversight?

Regards,
Jared Camins-Esakov

-- 
Jared Camins-Esakov
Bibliographer, C & P Bibliography Services, LLC
(phone) +1 (917) 727-3445
(e-mail) jcamins at cpbibliography.com
(web) http://www.cpbibliography.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20110906/2f995541/attachment.htm>


More information about the Koha-devel mailing list