I'll help where I can here.
First some history. The database infrastructure has not been overhauled in some time. It was created largely by Sam Hathaway, an undergraduate and later an alumnus of University of Rochester, working "under my direction" which means I have a vague idea of what he was doing and what he did-- but essentially all of the database design (and redesign) is his. At the time we were supporting at least two database systems GDBM, which we used until mysql was invented, and after that mysql. There remains more than a little legacy code which is no longer needed, to support GDBM for example, but being aware of the history helps explain some of the weirdest idiosyncrasies. I know that at one point Sam decided that he had over abstracted the design and the code was refactored to run more quickly -- that also means that some of the code .pm modules may not be used but were kept around in case they or the ideas in them were needed someday. (This was also before git -- so we didn't have easy access to old versions of the code.)
Two more places of interest: There is some documentation of the construction of the SQL code base in https://github.com/openwebwork/webwork2/tree/master/doc/devel (Sam kept good notes) -- but it should be taken with a grain of salt since there may have been subsequent changes by others that were not so well documented.
Secondly the schema is defined in webwork2/conf/database.conf.dist .
(You can create a database.conf in which case that will be read instead of database.conf.dist but so few people made local modifications that database.conf.dist is read automatically if there is no local database.conf file.)
You have probably figured all of this out already. I'm glad you are working on this project. Overhauling the SQL code has long been on the backburner -- both to clean out the cruft that is no longer used and to make it possible to use postgresql as a database -- another goal that got stalled. I hope that while you are working on your project you can keep your eyes open for ideas that would allow us to make it easier for the next person to make upgrades to the database code.
Now to your current question. Danny Glin and Gavin LaRose did more recent work (2007) on adding the location table and the proctor capability to WeBWorK. The code for running it is
in ContentGenerator/CourseAdmin.pm around line 2548. This handles the front end. WeBWorK/Utils/CourseManagement.pm contains the operational code.
I believe the location tables are created by the function initNonNativeTables in CourseManagement.pm You are not creating new tables so I don't think you need to adjust database.conf.dist. This function is called at line 71 of CourseAdmin. Your new fields should be added around line 1120 of CourseManagement. I think they are added the first time you run the admin page after a change in the schema.
Hope this helps. Good luck and respond back with results or if you have more questions.
--------------
Having dumped all of this information on you and rereading it -- it seems to me that perhaps the problem is the SQL entry. (Check the sql error logs -- I suspect that WW fails silently on this kind of thing -- another bug.)
For example I see "unique key" in examples creating databases but I don't
see "unique" by itself. Try taking out "unique" and see if the tables are built.
You will need to remove the field from the table manually or WW will not try to add the field.
Further information -- the phrase "unique key..." is added for other tables by code in DB/Schema/NewSQL/Std.pm The key fields to use are determined by a method in DB/Records.pm and triggered by the item key=>1 in the record specification.
So
uniq_id => { type=>INT NOT NULL AUTO_INCREMENT",key=>1}
might do exactly what you want.
-- Mike