I agree affiliation.name would be better to use programatically. We will have
to document somewhere that the name "Global" should never be altered because the
word will need to be hard-coded.
I'm also having second thoughts about using an id of 0 for anything. I think it
will cause bugs because it evaluates to false. I propose adding id=2,
name=Global to vcl.sql. The Local affiliation is already using id=1.
For upgrading to the next release, we will need to remember to have a database
upgrade script which adds the Global affiliation to the database.
Aaron Peeler wrote:
Sounds good. This is a good approach to allow for unique settings per
If there are and queries using the affiliation ID, it should probably be
changed to use the name. That way the id is just a database id and the
affiliation attributes are queried by the name not the id - but I'm not
sure if we are using the id anywhere.
--On January 7, 2010 1:34:20 PM -0500 Andy Kurth <andy_ku...@ncsu.edu>
I propose adding an additional schema entry to the affiliation table:
The "0" index in the affiliation table would remain fixed to represent
global or system-wide.
This will be particularly useful as more and more configuration
parameters are stored in the database. The need to distinguish
parameters for a specific affiliation versus system-wide parameters has
grown as VCL implementations expand to support several institutions.
Configuration tables would reference the affiliation table, allowing
system-wide and affiliation-specific settings to be treated identically
from a programming standpoint.
Queries could be written to attempt to retrieve a configuration value for
a particular non-zero affiliation ID and default to the global value if
it's not set for the affiliation.
One thing to be careful of if implemented... any code using/checking the
affiliation ID value must not use a true/false evaluation to determine if
it's valid because 0 will be a valid index but evaluate as false.
OIT Advanced Computing
College of Engineering-NCSU
Virtual Computing Lab
Office of Information Technology
North Carolina State University