moodle/version.php
martin b4d7002e66 Changes to allow much better control over what "teachers" are called
in a course.  Firstly, the course settings page now allows the teachers
to specify the word they want to use in place of "teachers" and "students"
as well as "teacher" and "student".  Secondly, a new teacher admin tool
allows any teacher to modify the order and displayed role of teachers
in that course.  This affects the display on the course listings, the
participants page and so on.
2002-09-08 03:24:38 +00:00

79 lines
2.9 KiB
PHP

<?PHP //$Id$
// This file keeps track of upgrades to Moodle.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// This file specifies the current version of
// Moodle installed, which can be compared against
// a previous version (see the "config" table).
//
// To do this, visit the "admin" page or the site
// home page while logged in as an admin.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older databases to the current version.
// If there's something it cannot do itself, it
// will tell you what you need to do.
$version = 2002090800; // The current version is a date (YYYYMMDDXX) where
// XX is a number that increments during the day
$release = "1.0.4 beta"; // For humans only, not used for the upgrade process
function upgrade_moodle($oldversion=0) {
if ($oldversion == 0) {
execute_sql("
CREATE TABLE `config` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`value` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) COMMENT='Moodle configuration variables';");
notify("Created a new table 'config' to hold configuration data");
}
if ($oldversion < 2002073100) {
execute_sql(" DELETE FROM `modules` WHERE `name` = 'chat' ");
}
if ($oldversion < 2002080200) {
execute_sql(" ALTER TABLE `modules` DROP `fullname` ");
execute_sql(" ALTER TABLE `modules` DROP `search` ");
}
if ($oldversion < 2002080300) {
execute_sql(" ALTER TABLE `log_display` CHANGE `table` `mtable` VARCHAR( 20 ) NOT NULL ");
execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 3 ) DEFAULT '3' NOT NULL ");
}
if ($oldversion < 2002082100) {
execute_sql(" ALTER TABLE `course` CHANGE `guest` `guest` TINYINT(2) UNSIGNED DEFAULT '0' NOT NULL ");
}
if ($oldversion < 2002082101) {
execute_sql(" ALTER TABLE `user` ADD `maildisplay` TINYINT(2) UNSIGNED DEFAULT '2' NOT NULL AFTER `mailformat` ");
}
if ($oldversion < 2002090100) {
execute_sql(" ALTER TABLE `course_sections` CHANGE `summary` `summary` TEXT NOT NULL ");
}
if ($oldversion < 2002090701) {
execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 10 ) DEFAULT '3' NOT NULL ");
execute_sql(" ALTER TABLE `user_teachers` ADD `role` VARCHAR(40) NOT NULL AFTER `authority` ");
}
if ($oldversion < 2002090800) {
execute_sql(" ALTER TABLE `course` ADD `teachers` VARCHAR( 100 ) DEFAULT 'Teachers' NOT NULL AFTER `teacher` ");
execute_sql(" ALTER TABLE `course` ADD `students` VARCHAR( 100 ) DEFAULT 'Students' NOT NULL AFTER `student` ");
}
return true;
}
?>