MDL-13789 Removing useless files. Merging from MOODLE_19_STABLE
[moodle.git] / mod / forum / db / upgrade.php
CommitLineData
b8a342d7 1<?php //$Id$
2
3// This file keeps track of upgrades to
4// the forum module
5//
6// Sometimes, changes between versions involve
7// alterations to database structures and other
8// major things that may break installations.
9//
10// The upgrade function in this file will attempt
11// to perform all the necessary actions to upgrade
12// your older installtion to the current version.
13//
14// If there's something it cannot do itself, it
15// will tell you what you need to do.
16//
17// The commands in here will all be database-neutral,
18// using the functions defined in lib/ddllib.php
19
20function xmldb_forum_upgrade($oldversion=0) {
21
22 global $CFG, $THEME, $db;
23
24 $result = true;
25
26/// And upgrade begins here. For each one, you'll need one
27/// block of code similar to the next one. Please, delete
28/// this comment lines once this file start handling proper
29/// upgrade code.
30
31/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
32/// $result = result of "/lib/ddllib.php" function calls
33/// }
34
42ff9ce6 35 if ($result && $oldversion < 2007072200) {
353228d8 36 require_once($CFG->dirroot.'/mod/forum/lib.php');
37 // too much debug output
38 $db->debug = false;
39 forum_update_grades();
40 $db->debug = true;
41 }
42
f3c3a4d3 43 if ($result && $oldversion < 2007101000) {
44
45 /// Define field timemodified to be added to forum_queue
46 $table = new XMLDBTable('forum_queue');
47 $field = new XMLDBField('timemodified');
48 $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'postid');
49
50 /// Launch add field timemodified
51 $result = $result && add_field($table, $field);
52 }
53
54
b8a342d7 55 return $result;
56}
57
58?>