Browse Source

Fix #358 check index exists before dropping.

MOODLE_32_STABLE
Dan Marsden 6 years ago
parent
commit
67a4d16038
  1. 2
      db/upgrade.php

2
db/upgrade.php

@ -413,7 +413,9 @@ function xmldb_attendance_upgrade($oldversion=0) {
$table = new xmldb_table('attendance_warning_done'); $table = new xmldb_table('attendance_warning_done');
$index = new xmldb_index('notifyid_userid', XMLDB_INDEX_UNIQUE, array('notifyid', 'userid')); $index = new xmldb_index('notifyid_userid', XMLDB_INDEX_UNIQUE, array('notifyid', 'userid'));
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index); $dbman->drop_index($table, $index);
}
$index = new xmldb_index('notifyid', XMLDB_INDEX_NOTUNIQUE, array('notifyid', 'userid')); $index = new xmldb_index('notifyid', XMLDB_INDEX_NOTUNIQUE, array('notifyid', 'userid'));
$dbman->add_index($table, $index); $dbman->add_index($table, $index);

Loading…
Cancel
Save