Commit 28df762b authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1810427: constraint drop fails in MySQL in unit testing"

parents 6d655fd3 dae3023d
......@@ -702,12 +702,22 @@ abstract class TestingUtil {
if (is_readable($location . DIRECTORY_SEPARATOR . 'install.xml')) {
if ($plugintype == 'auth' && $pluginname == 'webservice') {
// This module has LTI module lti_assessment.oauthserver as a foreign key
execute_sql('ALTER TABLE {lti_assessment} DROP CONSTRAINT {ltiasse_oau_fk}');
if (is_mysql()) {
execute_sql('ALTER TABLE {lti_assessment} DROP FOREIGN KEY {ltiasse_oau_fk}');
}
else {
execute_sql('ALTER TABLE {lti_assessment} DROP CONSTRAINT {ltiasse_oau_fk}');
}
}
if ($plugintype == 'module' && $pluginname == 'framework') {
// This module has a core collection.framework as a foreign key
execute_sql('UPDATE {collection} SET framework = null');
execute_sql('ALTER TABLE {collection} DROP CONSTRAINT {coll_fra_fk}');
if (is_mysql()) {
execute_sql('ALTER TABLE {collection} DROP FOREIGN KEY {coll_fra_fk}');
}
else {
execute_sql('ALTER TABLE {collection} DROP CONSTRAINT {coll_fra_fk}');
}
}
uninstall_from_xmldb_file($location . DIRECTORY_SEPARATOR . 'install.xml');
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment