From: Sam H. v. a. <we...@ma...> - 2005-12-16 23:06:08
|
Log Message: ----------- disable gdbm and sql database layouts, remove unneeded config options. this is the first step in removing support for these deprecated database layouts. Modified Files: -------------- webwork2/conf: database.conf.dist global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.155 retrieving revision 1.156 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.155 -r1.156 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -236,12 +236,6 @@ # available in $courseName.) $courseDirs{root} = "$webworkDirs{courses}/$courseName"; -# Location of course-specific data files, such as WW1 (GDBM) database files. -$courseDirs{DATA} = "$courseDirs{root}/DATA"; - -# Location of authentication data files when using a WW1 (GDBM) database. -$courseDirs{auth_DATA} = "$courseDirs{DATA}/.auth"; - # Location of course HTML files, passed to PG. $courseDirs{html} = "$courseDirs{root}/html"; $courseURLs{html} = "$webwork_courses_url/$courseName"; @@ -372,11 +366,9 @@ include "conf/database.conf"; # Select the default database layout. This can be overridden in the course.conf -# file of a particular course. If you choose "gdbm", WeBWorK will be able to -# use courses from WeBWorK 1 without first adding course.conf files to them. -# However, the recommended database layout for new courses is "sql_single". This -# can be set when creating a course. -$dbLayoutName = "sql_single"; # or "gdbm" or "sql" +# file of a particular course. The only database layout supported in WW 2.1.4 +# and up is "sql_single". +$dbLayoutName = "sql_single"; # This sets the symbol "dbLayout" as an alias for the selected database layout. *dbLayout = $dbLayouts{$dbLayoutName}; @@ -701,8 +693,8 @@ # FIXME: this database can become a table in the 'webwork' database dvipng_depth_db => { dbsource => 'dbi:mysql:DvipngDepths', - user => $dbLayouts{sql}->{password}->{params}->{usernameRW}, - passwd => $dbLayouts{sql}->{password}->{params}->{passwordRW}, + user => $dbLayouts{sql_single}->{password}->{params}->{usernameRW}, + passwd => $dbLayouts{sql_single}->{password}->{params}->{passwordRW}, }, }; Index: database.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/database.conf.dist,v retrieving revision 1.14 retrieving revision 1.15 diff -Lconf/database.conf.dist -Lconf/database.conf.dist -u -r1.14 -r1.15 --- conf/database.conf.dist +++ conf/database.conf.dist @@ -43,96 +43,12 @@ %dbLayouts = (); # layouts are added to this hash below -=head1 THE GDBM DATABASE LAYOUT ($dbLayouts{gdbm}) - -This layout uses the traditional WeBWorK 1.x database format, using the GDBM -file format. Use this layout if you wish to share courses between WeBWorK 1.x -and WeBWorK 2. - -The C<globalUserID> parameter given for the C<set> and C<problem> tables denotes -the ID of the user that the GlobalTableEmulator will use to store data for the -C<set> and C<problem> tables. This is set to "global_user" by default, but can -be overridden on a course-by-course basis to the ID of the professor who is most -likely to be involved in creating new problem sets. Sets which have not been -assigned will only be visible to this user when logging into WeBWorK 1.x. - -Use the following code to override these values in a course's F<course.conf> -file: - - $dbLayout{set}->{params}->{globalUserID} = "some_user"; - $dbLayout{problem}->{params}->{globalUserID} = "some_user"; - -=cut - -my %gdbmGlobalTableParams = ( - globalUserID => "global_user", -); - -my %gdbmUserSpecificTableParams = ( - psvnLength => 5, -); - -$dbLayouts{gdbm} = { - password => { - record => "WeBWorK::DB::Record::Password", - schema => "WeBWorK::DB::Schema::Auth1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{auth_DATA}/$courseName\_password_DB", - }, - permission => { - record => "WeBWorK::DB::Record::PermissionLevel", - schema => "WeBWorK::DB::Schema::Auth1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{auth_DATA}/$courseName\_permissions_DB", - }, - key => { - record => "WeBWorK::DB::Record::Key", - schema => "WeBWorK::DB::Schema::Auth1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{auth_DATA}/keys", - }, - user => { - record => "WeBWorK::DB::Record::User", - schema => "WeBWorK::DB::Schema::Classlist1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{DATA}/$courseName\_classlist_DB", - }, - set => { - record => "WeBWorK::DB::Record::Set", - schema => "WeBWorK::DB::Schema::GlobalTableEmulator", - driver => "WeBWorK::DB::Driver::Null", - params => { %gdbmGlobalTableParams }, - }, - set_user => { - record => "WeBWorK::DB::Record::UserSet", - schema => "WeBWorK::DB::Schema::WW1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{DATA}/$courseName\_webwork_DB", - params => { %gdbmUserSpecificTableParams }, - }, - problem => { - record => "WeBWorK::DB::Record::Problem", - schema => "WeBWorK::DB::Schema::GlobalTableEmulator", - driver => "WeBWorK::DB::Driver::Null", - params => { %gdbmGlobalTableParams }, - }, - problem_user => { - record => "WeBWorK::DB::Record::UserProblem", - schema => "WeBWorK::DB::Schema::WW1Hash", - driver => "WeBWorK::DB::Driver::GDBM", - source => "$courseDirs{DATA}/$courseName\_webwork_DB", - params => { %gdbmUserSpecificTableParams }, - }, -}; - -=head1 THE SQL DATABASE LAYOUT ($dbLayouts{sql}) +=head1 THE SQL_SINGLE DATABASE LAYOUT -The SQL database layout uses an SQL database server to store the tables of the -WeBWorK database. The SQL driver uses two SQL accounts, a read only and a -read-write account. The read-only account must have C<SELECT> access, and the -read-write account needs C<SELECT>, C<INSERT>, C<UPDATE>, and C<DELETE> access. -The names and passwords of these accounts are given as parameters to each table -in the layout. +The C<sql_single> layout is similar to the C<sql> layout, excpet that it uses a +single database for all courses. This is accomplised by prefixing each table +name with the name of the course. The names and passwords of these accounts are +given as parameters to each table in the layout. usernameRO the name of the read-only account usernameRW the name of the read-write account @@ -160,6 +76,7 @@ =cut +# params common to all tables (also used by "sql" layout) my %sqlParams = ( usernameRO => "webworkRead", passwordRO => "", @@ -168,82 +85,6 @@ debug => 0, ); -my $sqlDBISourcePrefix = "dbi:mysql:webwork_"; - -$dbLayouts{sql} = { - password => { - record => "WeBWorK::DB::Record::Password", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, - permission => { - record => "WeBWorK::DB::Record::PermissionLevel", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, - key => { - record => "WeBWorK::DB::Record::Key", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { - %sqlParams, - tableOverride => "key_not_a_keyword", - fieldOverride => { key => "key_not_a_keyword" }, - }, - }, - user => { - record => "WeBWorK::DB::Record::User", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, - set => { - record => "WeBWorK::DB::Record::Set", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { - %sqlParams, - tableOverride => "set_not_a_keyword" - }, - }, - set_user => { - record => "WeBWorK::DB::Record::UserSet", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, - problem => { - record => "WeBWorK::DB::Record::Problem", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, - problem_user => { - record => "WeBWorK::DB::Record::UserProblem", - schema => "WeBWorK::DB::Schema::SQL", - driver => "WeBWorK::DB::Driver::SQL", - source => "$sqlDBISourcePrefix$courseName", - params => { %sqlParams }, - }, -}; - -=head1 THE SQL_SINGLE DATABASE LAYOUT - -The C<sql_single> layout is similar to the C<sql> layout, excpet that it uses a -single database for all courses. This is accomplised by prefixing each table -name with the name of the course. - -=cut - my $sqlSingleDBISource = "dbi:mysql:webwork"; $dbLayouts{sql_single} = { @@ -322,3 +163,14 @@ }, }; +=head1 THE SQL DATABASE LAYOUT ($dbLayouts{sql}) + +This layout is not supported as of WeBWorK 2.1.4. + +=cut + +=head1 THE GDBM DATABASE LAYOUT ($dbLayouts{gdbm}) + +This layout is not supported as of WeBWorK 2.1.4. + +=cut |