From 705789bda6568bc81b34df98db4179d80232533d Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 31 Jul 2007 07:34:03 +0000 Subject: [PATCH] Upgrades to tag tables --- lib/db/access.php | 22 ++++++++++++++++++++++ lib/db/install.xml | 9 +++++---- lib/db/upgrade.php | 13 +++++++++++++ version.php | 2 +- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/lib/db/access.php b/lib/db/access.php index 6f58270c87..84ef021aa5 100644 --- a/lib/db/access.php +++ b/lib/db/access.php @@ -1050,6 +1050,28 @@ $moodle_capabilities = array( 'editingteacher' => CAP_ALLOW, 'admin' => CAP_ALLOW ) + ), + + 'moodle/tag:create' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'legacy' => array( + 'student' => CAP_ALLOW, + 'teacher' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'admin' => CAP_ALLOW + ) + ), + + 'moodle/tag:edit' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'legacy' => array( + 'student' => CAP_ALLOW, + 'teacher' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'admin' => CAP_ALLOW + ) ) ); diff --git a/lib/db/install.xml b/lib/db/install.xml index 927b5f8e33..8e877dbac6 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1595,12 +1595,13 @@ - +
- - + + + @@ -1669,4 +1670,4 @@ - \ No newline at end of file + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 5b73af570d..57cacfc7a5 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1520,6 +1520,19 @@ function xmldb_main_upgrade($oldversion=0) { } + if ($result && $oldversion < 2007073103) { + + /// Define field rawname to be added to tag + $table = new XMLDBTable('tag'); + $field = new XMLDBField('rawname'); + $field->setAttributes(XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null, 'name'); + + /// Launch add field rawname + $result = $result && add_field($table, $field); + } + + + /* /// drop old gradebook tables if ($result && $oldversion < 2007072209) { diff --git a/version.php b/version.php index b3b5d141ce..33936ce87f 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 = 2007073101; // YYYYMMDD = date + $version = 2007073103; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name -- 2.39.5