From e99c48d85685624e59b7bc19ea8b93baa0338b5b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 25 Jul 2007 03:14:17 +0000 Subject: [PATCH] adding a new key --- lib/db/install.xml | 5 +++-- lib/db/upgrade.php | 9 +++++++++ version.php | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 3994ef6c78..666996414c 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -1301,7 +1301,8 @@ - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index a8cb91eac9..3498ba3c3d 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1451,7 +1451,16 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && change_field_default($table, $field); } + if ($result && $oldversion < 2007072500) { + /// Define key courseid-outcomeid (unique) to be added to grade_outcomes_courses + $table = new XMLDBTable('grade_outcomes_courses'); + $key = new XMLDBKey('courseid-outcomeid'); + $key->setAttributes(XMLDB_KEY_UNIQUE, array('courseid', 'outcomeid')); + + /// Launch add key courseid-outcomeid + $result = $result && add_key($table, $key); + } /* /// drop old gradebook tables if ($result && $oldversion < 2007072209) { diff --git a/version.php b/version.php index 9ae7854dd7..9eeb55d033 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007072402; // YYYYMMDD = date + $version = 2007072500; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name -- 2.39.5