From: moodler <moodler>
Date: Wed, 20 Aug 2003 13:06:11 +0000 (+0000)
Subject: Fixed a typo in the MySQL database definition that only shows
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3ec7dc57045fc16cad64a7fab6dbac9b7de35966;p=moodle.git

Fixed a typo in the MySQL database definition that only shows
up when adding resources to courses with IDs higher than 255
---

diff --git a/mod/resource/db/mysql.php b/mod/resource/db/mysql.php
index 0183dddee0..7e2a9642ca 100644
--- a/mod/resource/db/mysql.php
+++ b/mod/resource/db/mysql.php
@@ -4,6 +4,12 @@ function resource_upgrade($oldversion) {
 // This function does anything necessary to upgrade
 // older versions to match current functionality
 
+    global $CFG;
+
+    if ($oldversion < 2003082000) {
+        table_column("resource", "course", "course", "integer", "10", "unsigned", "0");
+    }
+
     return true;
 }
 
diff --git a/mod/resource/db/mysql.sql b/mod/resource/db/mysql.sql
index ac50cfcabf..9c308eed45 100755
--- a/mod/resource/db/mysql.sql
+++ b/mod/resource/db/mysql.sql
@@ -16,7 +16,7 @@
 
 CREATE TABLE prefix_resource (
   id int(10) unsigned NOT NULL auto_increment,
-  course tinyint(10) unsigned NOT NULL default '0',
+  course int(10) unsigned NOT NULL default '0',
   name varchar(255) NOT NULL default '',
   type tinyint(4) NOT NULL default '0',
   reference varchar(255) default NULL,
diff --git a/mod/resource/version.php b/mod/resource/version.php
index a3b4241f86..5c8804fa12 100644
--- a/mod/resource/version.php
+++ b/mod/resource/version.php
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2003072000;
+$module->version  = 2003082000;
 $module->cron     = 0;
 
 ?>