WeBWorK Main Forum

"Database tables need updating."?

"Database tables need updating."?

by Bill Corcoran -
Number of replies: 6
I have a largely empty, preproduction WeBWorK 2.4.7 site just installed earlier this week. After logging in to the "admin" course, I see that one of our test courses has "Database tables need updating." displayed after the course name. This message is not meaningful to me, as a manual inspection of the database reveals nothing out of sorts, and CourseAdmin.pm is a lot to digest at the moment.

Could anyone help me find out why this message is displayed, and what I need to do to fix it?

Much thanks!
In reply to Bill Corcoran

Re: "Database tables need updating."?

by Arnold Pizer -
Hi Bill,

I'm not sure what OS you are using, but independent of this the instructions in http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Ubuntu_9.04 are very explicit about installing WeBWorK.

My first question is whether you installed rel-2-4-7 or rel-2-4-patches.

The in the above manual look at the information on the command
/opt/webwork/webwork2/bin/wwdb_upgrade -v

and run it.

Hope this helps,


In reply to Arnold Pizer

Re: "Database tables need updating."?

by Bill Corcoran -
To be specific, I installed rel-2-4-patches from CVS per the instructions at:

The resulting README lists:
Version 2.4.7
Branch: rel-2-4-patches

Anyway, the instructions included running wwdb_upgrade. When I try to re-run it, it says that it is not necessary, and then actually suggests changes that would revert the database.

We chose Ubuntu 8.04 because it is the long term support release, and there were issues with RHEL 5 that made Ubuntu seem a better choice for WeBWorK.

It appears as if the message is also only for one course, not the entire database, since our other test course says: "Database tables ok" next to it. Maybe I missed something, but I'm still stumped...
In reply to Bill Corcoran

Re: "Database tables need updating."?

by Michael Gage -
This section from the release notes might also be helpful:


Changes in administration operations

The archive and unarchiving process has been made more robust. The integrity of the database structure is checked before archiving and when unarchiving a course. This makes it possible to unarchive courses that were archived using previous versions of WeBWorK. If a new field has been added to the schema for a course table the field is automatically added with blank data as the course is unarchived.

One visible aspect of this change is that the CourseAdministration page checks course integrity and prints out information on the correctness of the database and directory structure. Some missing temporary (tmp) directories are automatically created during this check to prevent spurious error messages. Archiving a course with minor integrity problems will allow the administrator to update the courses so that they are compatible with the latest version of WeBWorK. Major integrity problems will need to be fixed from the unix command line.

There are some annoyances in the current implementation. The integrity checks slow down the loading of the CourseAdministration page if there are many courses on the server, particularly if the courses are old and fail the integrity check. The user interface for this will be worked on for future releases. Meantime update those old courses. :-)

In reply to Michael Gage

Re: "Database tables need updating."?

by Bill Corcoran -
Bingo! ...and this must be either a known issue or a bug.

We have a course called "testCourse" and a course called "testCourse_2". After archiving "testCourse", I've discovered that WeBWorK thinks that the "testCourse_2" tables belong to "testCourse" but are missing from the schema.

Should I take this as a suggestion not to use underscores in the naming of courses? Perhaps webwork should reject course names with underscores?

Thanks so much!
In reply to Bill Corcoran

Re: "Database tables need updating."?

by Xiong Chiamiov -
Well, that certainly does make sense. Webwork uses multiple tables for each course, so to keep them organized (and separate from each other!) the course name is used as a prefix. So, for instance, for a course "Beginning", I have the following tables:
| Beginning_key                     | 
| Beginning_password                | 
| Beginning_permission              | 
| Beginning_problem                 | 
| Beginning_problem_user            | 
| Beginning_set                     | 
| Beginning_set_locations           | 
| Beginning_set_locations_user      | 
| Beginning_set_user                | 
| Beginning_setting                 | 
| Beginning_user                    |

Underscores work just fine (I have a course that uses them), but not when the part before the first underscore is another course.

I'm not familiar with the codebase, but a check for this type of thing on course creation would be good. It'd have to check both possibilities: creating "foo" when "foo_bar" exists, and vice versa.

I added brief notes to the Course Administration page on the wiki; if you have any suggestions about where else this information would be useful, let me know.

In reply to Xiong Chiamiov

Re: "Database tables need updating."?

by Arnold Pizer -

This bug (which gives false warning messages) has been fixed. The bug occurred when two courses such as "foo" and "foo_bar" existed and the tables for the "foo" course were checked by a routine in CourseIntegrityCheck.pm. The routine thought tables for the "foo_bar" course belonged to the "foo" course and this resulted in the warning messages.

To fix this bug (which is annoying but doesn't cause problems) you can download the rel-2-4-patches version of CourseIntegrityCheck.pm which resides in the /opt//webwork/webwork2/lib/WeBWorK/Utils directory.

I removed the brief notes Xiong added to the Course Administration page on the wiki. Thanks Xiong for added those but they are no longer needed (at least if people have a current version of WeBWorK).