[OPEN-ILS-DEV] Feature Proposal: Enhancements to Patron Statistical Categories

Scott Prater sprater at gmail.com
Tue Nov 8 18:14:46 EST 2011


Thomas (and anyone else),

Here's my proposal for changes to the actor database schema for the
patron statistical category enhancements:

1.  Mark a required category

table actor.stat_cat:
new column "required":  boolean -- NOT NULL, DEFAULT false

2.  Allow/disallow user-entered text for a category

table actor.stat_cat:
new_column "allow_freetext":  boolean -- NOT NULL, DEFAULT true

3. Set a default entry

new table "actor.stat_cat_entry_default"
Columns:
id : serial -- PRIMARY KEY,
stat_cat_entry : integer -- UNIQUE#1, NOT NULL, REFERENCES actor.stat_cat_entry
stat_cat : integer -- UNIQUE#1, NOT NULL, REFERENCES actor.stat_cat

By including both stat_cat_entry and stat_cat in this last table and
declaring each one as UNIQUE, we can ensure that for a given
statistical category only one entry is ever marked the default.

Would it make sense to create a stored procedure that returned either
-1 (no default entry) or the ID of the default entry for a given
stat_cat?

How does this sound?  Am I missing anything?  Do other schemas come into play?

thanks,

-- Scott


More information about the Open-ils-dev mailing list