I'm upgrading our Moodle site to 3.6.1 and thought this would be a good time to get the latest version of the Attendance plugin (3.6.3 at the time of this post). However, all my upgrade attempts are stopped with the following error:
Default exception handler: Error writing to database Debug: SQLState: 42000<br>
Error Code: 159<br>
Message: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Must specify the table name and index name for the DROP INDEX statement.<br>
DROP INDEX mdl_attewarn_idnwarwar_uix
[array (
)]
Error code: dmlwriteexception
* line 489 of \lib\dml\moodle_database.php: dml_write_exception thrown
* line 324 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
* line 431 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
* line 840 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
* line 401 of \mod\attendance\db\upgrade.php: call to sqlsrv_native_moodle_database->execute()
* line 807 of \lib\upgradelib.php: call to xmldb_attendance_upgrade()
* line 518 of \lib\upgradelib.php: call to upgrade_plugins_modules()
* line 1852 of \lib\upgradelib.php: call to upgrade_plugins()
* line 694 of \admin\index.php: call to upgrade_noncore()
if ($DB->get_dbfamily() === 'mysql') {
$DB->execute("ALTER TABLE {attendance_warning} DROP INDEX ". $name);
} else {
$DB->execute("DROP INDEX ". $name);
}