diff --git a/mod/data/db/install.xml b/mod/data/db/install.xml index f22b86b0249..a059a2f886a 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 a7b6a316cde..feea212596a 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 dca635aad4f..49d8c3dd579 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;