Installation

Missing tables from new installation?

Missing tables from new installation?

by Björn Bergstrand -
Number of replies: 8
I've been installing Webwork on Ubuntu server 10.04.2 with the webwork2-rel-2-4-9.tar.gz tarball.
I ran into a problem when trying to edit the problem sets within a homework set - and the problem as it turned out was that these tables were missing from the database:
locations
location_addresses

I had to manually create these tables in the database, and then it worked fine.

Has anyone else encountered this problem?
I'm not sure if i've just missed some installation step, however i cannot seem to find any comment on this in the installation instructions.
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Jason Aubrey -
Hi Björn,

Interesting - were you upgrading from an older version or doing a new install?

Those tables are defined in database.conf, and should be created automatically from their definition in that file, which is why there is no comment about them in the installation instructions.

As I understand it, the installation instructions just have you create the database and the database user with appropriate permissions, put the relevant information in your global.conf and then relies on your database.conf to properly create the tables.

Jason
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Michael Gage -
If you are working with the svn version of 2.4.9  this location_addresses table should be automatically created when you log in to the admin "course".

You can upgrade the tables for individual courses by choosing the "upgrade courses" tab in the admin "course".

I'm using the admin course for upgrades so that we are not checking database consistency EVERY time we start up webwork, but we do check it whenever we 
enter the admin course to do administrative work.  

It's possible that the tarball version of 2.4.9 didn't include the updates to the tables which are not associated with any single course.

Let me know if the automatic upgrade to tables is not happening in the admin course.

-- Mike


In reply to Michael Gage

Re: Missing tables from new installation?

by Björn Bergstrand -
Hello,
Yes it's a new installation using the tarball, not svn.
If I'm understanding you correctly, simply logging in to the "admin" course should be enough to create locations and location_addresses. This is not happening.
Running updates on other courses does not create them either. The admin course is not shown in the list of courses under "Upgrade", but i'm guessing that's how it's supposed to be.
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Jason Aubrey -
It looks like this is the problem. Here is a diff between database.conf from the 2.4.9 tarball and the current head version:

http://webwork.maa.org/viewvc/system/trunk/webwork2/conf/database.conf.dist?r1=HEAD&r2=6642

It looks like the tarball on sourceforge needs to be replaced by the 2.4.9.1 tarball which doesn't have this problem:

http://webwork.maa.org/viewvc/system/trunk/webwork2/conf/database.conf.dist?r1=HEAD&r2=6684

Jason
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Michael Gage -
Hi Bjorn,

In your case if you do     

svn update 

in the webwork2  directory and also in the pg   directory you will automatically get all of the bug fixes we've added to the 2.4.9 version (in fact this is essentially to 2.5.0 which I should release soon.)  No need to get a new tarball.

You might have to compare global.conf and global.conf.dist to make sure that we haven't added any new configuration items.  I think we adjusted the 
colors indicating correct and incorrect answers but not much else.

-- Mike


In reply to Michael Gage

Re: Missing tables from new installation?

by Björn Bergstrand -
I was unable to verify Jasons theory - just changing the database.conf (and checking out depths.pm) did not make the admin course create the tables.
A full svn update did fix it though.
Thank you guys!
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Jason Aubrey -
Great - glad you fixed it. FWIW, I uploaded new tarballs last night for rel-2-4-9-1.

Jason
In reply to Björn Bergstrand

Re: Missing tables from new installation?

by Michael Gage -
Glad it worked.  You experienced about what I expected since the code for initializing the tables is in the CourseAdmin and Utils/CourseManagement modules. (Only the directions for the schema are in the new database.conf.dist).  

This aspect of the update should be smoother now for new installations.

-- Mike