Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Postgres updates

  • Loading branch information...
commit 0257cc73e0f9f0b002b1844bb7e0d41273ef9c19 1 parent be784d1
authored September 20, 2004
5  mod/forum/db/postgres7.php
@@ -62,6 +62,11 @@ function forum_upgrade($oldversion) {
62 62
                            );");
63 63
   }
64 64
 
  65
+  if ($oldversion < 2004070700) {    // This may be redoing it from STABLE but that's OK
  66
+      table_column("forum_discussions", "groupid", "groupid", "integer", "10", "", "0", "");
  67
+  }
  68
+
  69
+
65 70
   return true;
66 71
 
67 72
 }
66  mod/workshop/db/postgres7.php
@@ -23,13 +23,75 @@ function workshop_upgrade($oldversion) {
23 23
         )
24 24
         ");
25 25
     }
26  
-    return true;
  26
+
  27
+    if ($oldversion < 2003051400) {
  28
+        table_column("workshop","","showleaguetable", "INTEGER", "4", "unsigned", "0", "not null", "gradingweight");
  29
+		execute_sql("
  30
+		CREATE TABLE {$CFG->prefix}workshop_rubrics (
  31
+		  id SERIAL8 PRIMARY KEY,
  32
+		  workshopid int8 NOT NULL default '0',
  33
+		  elementid int8 NOT NULL default '0',
  34
+		  rubricno int4  NOT NULL default '0',
  35
+		  description text NOT NULL,
  36
+		) 
  37
+        ");
  38
+	}
  39
+		
  40
+	if ($oldversion < 2003082200) {
  41
+        table_column("workshop_rubrics", "elementid", "elementno", "INTEGER", "10", "unsigned", "0", "not null", "id"); 	
  42
+	}
  43
+
  44
+	if ($oldversion < 2003092500) {
  45
+        table_column("workshop", "", "overallocation", "INTEGER", "4", "unsigned", "0", "not null", "nsassesments");
  46
+	}
  47
+
  48
+    if ($oldversion < 2003100200) {
  49
+	
  50
+        table_column("workshop_assesments", "", "resubmission", "INTEGER", "4", "unsigned", "0", "not null", "mailed");
  51
+	}
  52
+		
  53
+    if ($oldversion < 2003100800) {
  54
+        // tidy up log_display entries
  55
+        execute_sql("DELETE FROM {$CFG->prefix}log_display WHERE module = 'workshop'");
  56
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES('workshop', 'assessments', 'workshop', 'name')");
  57
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'close', 'workshop', 'name')");
  58
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'display', 'workshop', 'name')");
  59
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'resubmit', 'workshop', 'name')");
  60
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'set up', 'workshop', 'name')");
  61
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'submissions', 'workshop', 'name')");
  62
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'view', 'workshop', 'name')");
  63
+        execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'update', 'workshop', 'name')");
  64
+    }
  65
+    
  66
+    if ($oldversion < 2003113000) {
  67
+        table_column("workshop", "", "teacherloading", "INTEGER", "4", "unsigned", "5", "NOT NULL", "mailed");
  68
+        table_column("workshop", "", "assessmentstodrop", "INTEGER", "4", "unsigned", "0", "NOT NULL", "");
  69
+        table_column("workshop_assessments", "", "donotuse", "INTEGER", "4", "unsigned", "0", "NOT NULL", "resubmission");
  70
+        execute_sql("CREATE INDEX {$CFG->prefix}workshop_grades_assesmentid_idx (assessmentid)");
  71
+    }
27 72
 
28 73
     if ($oldversion < 2004052100) {
29 74
         include_once("$CFG->dirroot/mod/workshop/lib.php");
30 75
         workshop_refresh_events();
31 76
     }
32  
-}
  77
+
  78
+    if ($oldversion < 2004081100) {
  79
+		table_column("workshop", "", "gradinggrade", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "grade");
  80
+		table_column("workshop", "", "assessmentcomps", "INTEGER", "4", "UNSIGNED", "2", "NOT NULL", "ntassessments");
  81
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN gradingweight");
  82
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN mergegrades");
  83
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN peerweight");
  84
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN includeteachersgrade");
  85
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN biasweight");
  86
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN reliabilityweight");
  87
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN teacherloading");
  88
+        execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN assessmentstodrop");
  89
+    }
  90
+
  91
+    
  92
+    return true;
  93
+
  94
+}    
33 95
 
34 96
 
35 97
 ?>
41  mod/workshop/db/postgres7.sql
@@ -19,18 +19,14 @@ CREATE TABLE prefix_workshop (
19 19
   maxbytes INT8  NOT NULL default '100000',
20 20
   deadline INT8  NOT NULL default '0',
21 21
   grade INT8 NOT NULL default '0',
  22
+  gradinggrade INT4 NOT NULL default '0',
22 23
   ntassessments INT  NOT NULL default '0',
  24
+  assessmentcomps int4 NOT NULL default '2',
23 25
   nsassessments INT  NOT NULL default '0',
24 26
   overallocation INT  NOT NULL default '0',
25 27
   timemodified INT8  NOT NULL default '0',
26  
-  mergegrades INT  NOT NULL default '0',
27  
-  teacherweight INT  NOT NULL default '5',
28  
-  peerweight INT  NOT NULL default '5',
29  
-  includeteachersgrade INT  NOT NULL default '0',
30  
-  biasweight INT  NOT NULL default '5',
31  
-  reliabilityweight INT  NOT NULL default '5',
32  
-  gradingweight INT  NOT NULL default '5',
33  
-  timeagreed INT8 NOT NULL default '0'
  28
+  teacherweight INT  NOT NULL default '1',
  29
+  showleaguetable INT4 NOT NULL default '0',
34 30
 );
35 31
 # --------------------------------------------------------
36 32
 
@@ -66,10 +62,12 @@ CREATE TABLE prefix_workshop_assessments (
66 62
   userid INT8  NOT NULL default '0',
67 63
   timecreated INT8  NOT NULL default '0',
68 64
   timegraded INT8  NOT NULL default '0',
  65
+  timeagreed INT8  NOT NULL default '0',
69 66
   grade float NOT NULL default '0',
70 67
   gradinggrade INT NOT NULL default '0',
71 68
   mailed INT2  NOT NULL default '0',
72 69
   resubmission INT2  NOT NULL default '0',
  70
+  donotuse int4 NOT NULL default '0',
73 71
   generalcomment text NOT NULL default '',
74 72
   teachercomment text NOT NULL default ''
75 73
   );
@@ -88,7 +86,17 @@ CREATE TABLE prefix_workshop_elements (
88 86
   maxscore INT  NOT NULL default '1',
89 87
   weight float NOT NULL default '1.0'
90 88
 );
  89
+
91 90
 # --------------------------------------------------------
  91
+CREATE TABLE prefix_workshop_rubrics (
  92
+  id SERIAL PRIMARY KEY,
  93
+  workshopid int8 NOT NULL default '0',
  94
+  elementno int8  NOT NULL default '0',
  95
+  rubricno int4  NOT NULL default '0',
  96
+  description text NOT NULL
  97
+) ;
  98
+# --------------------------------------------------------
  99
+
92 100
 
93 101
 #
94 102
 # Table structure for table workshop_grades
@@ -113,14 +121,13 @@ CREATE TABLE prefix_workshop_comments (
113 121
   comments text NOT NULL default ''
114 122
 );
115 123
 
  124
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'assessments', 'workshop', 'name');
  125
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'close', 'workshop', 'name');
  126
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'display', 'workshop', 'name');
  127
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'resubmit', 'workshop', 'name');
  128
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'set up', 'workshop', 'name');
  129
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'submissions', 'workshop', 'name');
  130
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'view', 'workshop', 'name');
  131
+INSERT INTO `prefix_log_display` VALUES ('workshop', 'update', 'workshop', 'name');
116 132
 
117  
-INSERT INTO prefix_log_display VALUES ('workshop', 'assess', 'workshop', 'name');
118  
-INSERT INTO prefix_log_display VALUES ('workshop', 'close', 'workshop', 'name');
119  
-INSERT INTO prefix_log_display VALUES ('workshop', 'display grades', 'workshop', 'name');
120  
-INSERT INTO prefix_log_display VALUES ('workshop', 'grade', 'workshop', 'name');
121  
-INSERT INTO prefix_log_display VALUES ('workshop', 'hide grades', 'workshop', 'name');
122  
-INSERT INTO prefix_log_display VALUES ('workshop', 'open', 'workshop', 'name');
123  
-INSERT INTO prefix_log_display VALUES ('workshop', 'submit', 'workshop', 'name');
124  
-INSERT INTO prefix_log_display VALUES ('workshop', 'view', 'workshop', 'name');
125  
-INSERT INTO prefix_log_display VALUES ('workshop', 'update', 'workshop', 'name');
126 133
 COMMIT;

0 notes on commit 0257cc7

Please sign in to comment.
Something went wrong with that request. Please try again.