From 25322ba36fe17ed0d66c04fa132e99a7469044d7 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 26 Feb 2008 22:04:23 +0000 Subject: [PATCH] MDL-10990 4) added missing indexes into data module; merged from MOODLE_19_STABLE --- mod/data/db/install.xml | 12 +++++++++--- mod/data/db/upgrade.php | 22 ++++++++++++++++++++++ mod/data/version.php | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mod/data/db/install.xml b/mod/data/db/install.xml index f22b86b024..a059a2f886 100644 --- a/mod/data/db/install.xml +++ b/mod/data/db/install.xml @@ -1,5 +1,5 @@ - @@ -38,8 +38,11 @@ - + + + + @@ -63,6 +66,9 @@ + + +
@@ -138,4 +144,4 @@ - + \ No newline at end of file diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index a7b6a316cd..feea212596 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -74,6 +74,28 @@ function xmldb_data_upgrade($oldversion=0) { $result = $result && add_field($table, $field); } + if ($result && $oldversion < 2007081402) { + + /// Define index type-dataid (not unique) to be added to data_fields + $table = new XMLDBTable('data_fields'); + $index = new XMLDBIndex('type-dataid'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('type', 'dataid')); + + /// Launch add index type-dataid + if (!index_exists($table, $index)) { + $result = $result && add_index($table, $index); + } + + /// Define index course (not unique) to be added to data + $table = new XMLDBTable('data'); + $index = new XMLDBIndex('course'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('course')); + + /// Launch add index course + if (!index_exists($table, $index)) { + $result = $result && add_index($table, $index); + } + } return $result; } diff --git a/mod/data/version.php b/mod/data/version.php index dca635aad4..49d8c3dd57 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2007081400; +$module->version = 2007081402; $module->requires = 2007101000; // Requires this Moodle version $module->cron = 60; -- 2.39.5