Koha ILS

Naming Conventions in Koha

Occasionally, when administering your library or libraries in Koha you will find you have a situations where you need to enter a new CODE or two. Perhaps you are adding a new library to your library system or consortium. Or your acquisitions department has started purchasing Playaway devices that have a unique circulation policy and need their own ItemType in Koha. Or maybe you have just acquired a new collection of items from a benefactor that needs to be attributed to that benefactor through a Koha Collection Code. Is your library adding a new wing? Then you may need a new Location code! Other areas in Koha where you add codes are Patron Category and Patron Attributes.

I have developed this strategy (or set of best practices) for creating CODES in Koha based on my experience in database design and maintenance. This blog post covers those recommendations. You may have created Koha CODES in the past that don’t follow these rules and that’s ok. Not following these rules may never cause any trouble for your system. However, I have seen enough quirks and errors in search retrievals and reporting where following these rules would have prevented much anguish and confusion.

Start your naming process by asking three questions:

  1. Is the CODE clear to you?
    When you are creating the CODE value Koha, think about the data you are entering and make the CODE match the data it is referencing. If you come back to make changes in 6 months or 1 year, you will save yourself some time if the CODE makes sense to you and it’s usage is clear. Utilize the description fields in many of the areas noted above to give a full length description as well.
  2. Will the CODE be clear to others?
    If you have more than one administrator in your system, creating and using clear CODES helps others do their jobs well without having to request clarification of a CODE or inadvertantly deleting unclear CODES or utilizing the wrong CODE in reports or assigning Patrons or Items to it.
  3. Is it consistent with other CODES in Koha?
    Maintaining consistency among your CODE names in each area is regarded as a best practice. Keep it simple and easy to use. If it is too complex it will prove difficult to understand and manage in the long run.

If you can answer those question in the affirmative it’s time to move on to the following checklist to fine tune the naming:

  • No spaces
  • No dashes
  • No ‘special characters’
  • All UPPERCASE letters!
  • No reserved words – (Note: This rule applies in the actual construction of the tables and field names but is good practice when adding codes to a database field when that field is acting as a primary index for that table. Think of this rule as ‘better safe then sorry’. MySQL reserved words)

If you’ve followed the rules above, CONGRATULATIONS! You now have a good, strong, and safe naming convention for your new CODES in Koha. If you have further questions about how to create CODE names in Koha please let us know.

Read more by Joy Nelson