Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

moodle16cleanup: mod/hotpot set the correct column datatype and default

value
  • Loading branch information...
commit 9a2eb087aa8f19169ab0b4f1bb9da437f7e614f2 1 parent 7a3a4cf
authored May 17, 2006
46  mod/hotpot/db/postgres7.php
@@ -41,6 +41,50 @@ function hotpot_upgrade($oldversion) {
41 41
 		require_once $update_to_v2;
42 42
 		$ok = $ok && hotpot_update_to_v2_1_18();
43 43
 	}
44  
-	return $ok;
  44
+
  45
+
  46
+        if ($oldversion < 2006050201) {
  47
+
  48
+            modify_database('', 'ALTER TABLE prefix_hotpot
  49
+                ALTER COLUMN studentfeedbackurl SET DEFAULT \'\',
  50
+                ALTER COLUMN studentfeedbackurl SET NOT NULL,
  51
+                ALTER COLUMN clickreporting SET DEFAULT 0,
  52
+                ALTER COLUMN studentfeedback SET DEFAULT 0');
  53
+
  54
+            modify_database('', 'ALTER TABLE prefix_hotpot_strings
  55
+                ALTER COLUMN string SET DEFAULT \'\'');
  56
+
  57
+            modify_database('', 'ALTER TABLE prefix_hotpot_responses
  58
+                ALTER COLUMN hints TYPE int2,
  59
+                ALTER COLUMN hints SET DEFAULT 0,
  60
+                ALTER COLUMN ignored SET DEFAULT \'\',
  61
+                ALTER COLUMN ignored SET NOT NULL,
  62
+                ALTER COLUMN score TYPE int2,
  63
+                ALTER COLUMN score SET DEFAULT 0,
  64
+                ALTER COLUMN correct SET DEFAULT \'\',
  65
+                ALTER COLUMN correct SET NOT NULL,
  66
+                ALTER COLUMN weighting TYPE int2,
  67
+                ALTER COLUMN weighting SET DEFAULT 0,
  68
+                ALTER COLUMN wrong SET DEFAULT \'\',
  69
+                ALTER COLUMN wrong SET NOT NULL,
  70
+                ALTER COLUMN checks TYPE int2,
  71
+                ALTER COLUMN checks SET DEFAULT 0,
  72
+                ALTER COLUMN clues TYPE int2,
  73
+                ALTER COLUMN clues SET DEFAULT 0');
  74
+
  75
+            modify_database('', 'ALTER TABLE prefix_hotpot_questions
  76
+                ALTER COLUMN "type" SET DEFAULT 0');
  77
+
  78
+            modify_database('', 'ALTER TABLE prefix_hotpot_attempts
  79
+                ALTER COLUMN penalties TYPE smallint,
  80
+                ALTER COLUMN penalties SET DEFAULT 0,
  81
+                ALTER COLUMN score TYPE smallint,
  82
+                ALTER COLUMN score SET DEFAULT 0,
  83
+                ALTER COLUMN status SET DEFAULT 1');
  84
+
  85
+        }
  86
+
  87
+
  88
+        return $ok;
45 89
 }
46 90
 ?>
2  mod/hotpot/version.php
@@ -3,7 +3,7 @@
3 3
 ///  Code fragment to define the version of hotpot
4 4
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
5 5
 /////////////////////////////////////////////////////////////////////////////////
6  
-$module->version  = 2006050200;  // release date of this version (see note below)
  6
+$module->version  = 2006050201;  // release date of this version (see note below)
7 7
 $module->release  = 'v2.1.19';    // human-friendly version name (used in mod/hotpot/lib.php)
8 8
 $module->cron     = 0;           // period for cron to check this module (secs)
9 9
 // interpretation of YYYYMMDDXY version numbers

0 notes on commit 9a2eb08

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