MDL-22366 upgrade - always drop DB objects conditionally

This commit is contained in:
Eloy Lafuente 2010-05-06 16:03:02 +00:00
parent 3799dcb927
commit 5cada36315
2 changed files with 4 additions and 2 deletions

View File

@ -101,7 +101,9 @@ function xmldb_main_upgrade($oldversion) {
$index = new xmldb_index('contextid-lowerboundary', XMLDB_INDEX_NOTUNIQUE, array('contextid', 'lowerboundary'));
/// Launch drop index contextid-lowerboundary
$dbman->drop_index($table, $index);
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
/// Define index contextid-lowerboundary-letter (unique) to be added to grade_letters
$table = new xmldb_table('grade_letters');

View File

@ -907,7 +907,7 @@ class database_manager {
if (!$this->index_exists($xmldb_table, $xmldb_intex)) {
throw new ddl_exception('ddlunknownerror', null,
'Index ' . $xmldb_table->getName() . '->' . $xmldb_intex->getName() .
' does not exist. Delete skipped');
' does not exist. Drop skipped');
}
if (!$sqlarr = $this->generator->getDropIndexSQL($xmldb_table, $xmldb_intex)) {