mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Recreate index as unique
This commit is contained in:
parent
26d8649f99
commit
32ef914951
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="lib/db" VERSION="20070801" COMMENT="XMLDB file for core Moodle tables"
|
||||
<XMLDB PATH="lib/db" VERSION="20070802" COMMENT="XMLDB file for core Moodle tables"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -1641,7 +1641,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for tag_instance"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="tagiditem" UNIQUE="false" FIELDS="tagid, itemtype, itemid"/>
|
||||
<INDEX NAME="tagiditem" UNIQUE="true" FIELDS="tagid, itemtype, itemid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
|
@ -1578,6 +1578,24 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
build_context_rel();
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2007080201) {
|
||||
|
||||
/// Define index tagiditem (not unique) to be dropped form tag_instance
|
||||
$table = new XMLDBTable('tag_instance');
|
||||
$index = new XMLDBIndex('tagiditem');
|
||||
|
||||
/// Launch drop index tagiditem
|
||||
drop_index($table, $index);
|
||||
|
||||
/// Define index tagiditem (unique) to be added to tag_instance
|
||||
$index->setAttributes(XMLDB_INDEX_UNIQUE, array('tagid', 'itemtype', 'itemid'));
|
||||
|
||||
/// Launch add index tagiditem
|
||||
$result = $result && add_index($table, $index);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/// drop old gradebook tables
|
||||
if ($result && $oldversion < 2007072209) {
|
||||
|
@ -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 = 2007080200; // YYYYMMDD = date
|
||||
$version = 2007080201; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.9 dev'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user