From bcb5433d92af2878c5a34a40e933a499e3466cb9 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 1 Jul 2004 09:17:37 +0000 Subject: [PATCH] upgrading database with new values for the new fields --- mod/choice/db/mysql.php | 4 ++++ mod/choice/db/postgres7.php | 4 ++++ mod/choice/version.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mod/choice/db/mysql.php b/mod/choice/db/mysql.php index 6dd3e21cf2..baa4aec1ee 100644 --- a/mod/choice/db/mysql.php +++ b/mod/choice/db/mysql.php @@ -37,6 +37,10 @@ function choice_upgrade($oldversion) { table_column("choice", "", "release", "integer", "2", "unsigned", "0", "", "publish"); table_column("choice", "", "allowupdate", "integer", "2", "unsigned", "0", "", "release"); } + if ($oldversion < 2004070102) { + modify_database("", "UPDATE prefix_choice SET release = '1' WHERE publish > 0;"); + modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;"); + } return true; diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php index d74a4a8c06..96a54c0316 100644 --- a/mod/choice/db/postgres7.php +++ b/mod/choice/db/postgres7.php @@ -23,6 +23,10 @@ function choice_upgrade($oldversion) { table_column("choice", "", "release", "integer", "2", "unsigned", "0", "", "publish"); table_column("choice", "", "allowupdate", "integer", "2", "unsigned", "0", "", "release"); } + if ($oldversion < 2004070102) { + modify_database("", "UPDATE prefix_choice SET release = '1' WHERE publish > 0;"); + modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;"); + } return true; } diff --git a/mod/choice/version.php b/mod/choice/version.php index 473bb17e32..f80f7b30cf 100644 --- a/mod/choice/version.php +++ b/mod/choice/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004070101; +$module->version = 2004070102; $module->requires = 2004052501; // Requires this Moodle version $module->cron = 0; -- 2.39.5