WeBWorK Main Forum

Primary keys

Re: Primary keys

by Michael Gage -
Number of replies: 0
Can you explain the failure when you move a course from the production server -- why/how does it fail? Does adding a designation of PRIMARY cause a problem?
The archive/unarchive process uses mysqldump so that could be a source of the modification. I don't see anywhere else the term PRIMARY could be added outside of the OPL tables.

The OPL software uses PRIMARY key. As far as I can tell none of the current table creation software uses PRIMARY anywhere. There are legacy codes, e.g. in DBupgrade that use PRIMARY key. I don't know why the current versions for building course tables do not use a PRIMARY key.

The way PRIMARY key is used in the OPL software is not the way I would prefer in the sense that it designates a column with unique but meaningful entries (e.g. an author's email or the path to the problem) where as I would like in addition a primary field containing only a number that just indicates the row (an auto-inc type row).