I was looking at the new "Additional attributes and identifiers" feature and have some questions about the table structure. I was curious why "Patron attribute type code" is not editable. I see that in the borrower_attribute_types table there is no unique numeric id, just the "code": borrower_attribute_types +--------+--------------------------------------------+ | code | description | +--------+--------------------------------------------+ | pet | The patron's pets | | school | A student patron's educational institution | +--------+--------------------------------------------+ And in the borrower_attributes table, each line for that particular code has to repeat the value of "code:" borrower_attributes +----------------+--------+-----------------+----------+ | borrowernumber | code | attribute | password | +----------------+--------+-----------------+----------+ | 51 | school | Ohio University | NULL | | 52 | pet | Chappie | NULL | | 52 | pet | Ivy | NULL | | 52 | pet | Rascal | NULL | +----------------+--------+-----------------+----------+ I would think there should be an auto-incrementing numeric id in the borrower_attribute_types table for each code which would get entered into the borrower_attributes table. Then you could freely edit "code"'s value without having to worry about updating every line in borrower_attributes. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Hi, On Tue, Oct 21, 2008 at 9:19 AM, Owen Leonard <oleonard@myacpl.org> wrote:
I would think there should be an auto-incrementing numeric id in the borrower_attribute_types table for each code which would get entered into the borrower_attributes table. Then you could freely edit "code"'s value without having to worry about updating every line in borrower_attributes.
code is the primary key of borrower_attribute_types, and there is a foreign key relationship between borrower_attributes.code and borrower_attribute_types.code set up to cascade updates. This means that if you change a code value in borrower_attribute_types, the change will automatically propagate to affected borrower_attributes rows. I believe the user interface currently prevents one from changing the code, but I did that mostly to avoid having to handle several error reporting scenarios. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
I believe the user interface currently prevents one from changing the code, but I did that mostly to avoid having to handle several error reporting scenarios.
Thanks for the explanation Galen. I wish the code could be edited, because it's acting as a label for data output on the patron detail page. It'd be nice to be able to change that label if the definition needed to be tweaked. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Hi, On Tue, Oct 21, 2008 at 2:19 PM, Owen Leonard <oleonard@myacpl.org> wrote:
Thanks for the explanation Galen. I wish the code could be edited, because it's acting as a label for data output on the patron detail page. It'd be nice to be able to change that label if the definition needed to be tweaked.
Silly question: would it be OK if the code were not displayed on the patron detail page, just the description? Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
Silly question: would it be OK if the code were not displayed on the patron detail page, just the description?
The trouble with that, from my point of view, is that "description" sounds like it should be explanatory rather than a short label. I'd prefer leaving things as they are (with non-editable labels), than trying to use description that way. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
participants (2)
-
Galen Charlton -
Owen Leonard