From 3ec7dc57045fc16cad64a7fab6dbac9b7de35966 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 20 Aug 2003 13:06:11 +0000 Subject: [PATCH] Fixed a typo in the MySQL database definition that only shows up when adding resources to courses with IDs higher than 255 --- mod/resource/db/mysql.php | 6 ++++++ mod/resource/db/mysql.sql | 2 +- mod/resource/version.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) 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; ?> -- 2.39.5