Hide/show individual activities in any section
[moodle.git] / lib / db / postgres7.php
CommitLineData
31f0900c 1<?PHP //$Id$
2//
3// This file keeps track of upgrades to Moodle.
4//
5// Sometimes, changes between versions involve
6// alterations to database structures and other
7// major things that may break installations.
8//
9// The upgrade function in this file will attempt
10// to perform all the necessary actions to upgrade
11// your older installtion to the current version.
12//
13// If there's something it cannot do itself, it
14// will tell you what you need to do.
15//
16// Versions are defined by /version.php
17//
18// This file is tailored to PostgreSQL 7
19
e7311a0a 20function main_upgrade($oldversion=0) {
31f0900c 21
db70b54b 22 if ($oldversion < 2003010101) {
23 delete_records("log_display", "module", "user");
24 $new->module = "user";
25 $new->action = "view";
26 $new->mtable = "user";
27 $new->field = "CONCAT(firstname,\" \",lastname)";
28 insert_record("log_display", $new);
29
30 delete_records("log_display", "module", "course");
31 $new->module = "course";
32 $new->action = "view";
33 $new->mtable = "course";
34 $new->field = "fullname";
35 insert_record("log_display", $new);
36 $new->action = "update";
37 insert_record("log_display", $new);
38 $new->action = "enrol";
39 insert_record("log_display", $new);
40 }
1924074c 41
42 //support user based course creating
43 if ($oldversion < 2003032400) {
44 execute_sql("CREATE TABLE $CFG->prefix_user_coursecreators (
45 id int8 SERIAL PRIMARY KEY,
46 userid int8 NOT NULL default '0'
47 )");
48 }
1acfbce5 49
50 if ($oldversion < 2003041400) {
51 table_column("course_modules", "", "visible", "integer", "1", "unsigned", "1", "not null", "score");
52 }
1924074c 53
31f0900c 54 return true;
55}
56
57?>