-
Sub-task
-
Resolution: Won't Do
-
Minor
-
None
-
2.0
-
None
-
MOODLE_20_STABLE
-
Moderate
In Moodle 2.0 we have introduced field dependencies checking, so some actions, like dropping a field, now detect if there are some dependency (index using that field) and throws an exception if necessary.
Make the XMLDB PHP generator able to find such dependencies (in the xmldb model, not in real db) and provide with the needed PHP code needed to avoid that exception, normally:
- dropping the index/es before dropping the field for non unique indexes/keys
- re-adding the index - with the dropped field out for non unique indexes/keys
- BIG WARN if the dependent indexes/keys are defined as UNIQUE. Only drop is safe for 1-column indexes. Everything else, isn't because can lead to errors.
References: http://moodle.org/mod/forum/discuss.php?d=127196, MDL-19695 and MDL-63020
- has been marked as being related by
-
MDL-74143 Error during upgrade 3.9 to 4.0 on Oracle
- Closed
-
MDL-63020 Work-around MS SQL and Oracle incorrect handling of unique indexes on nullable columns
- Closed
- will help resolve
-
MDL-19695 Any field operation (drop, rename, change_xxx) must look for field dependencies (indexes, keys...)
- Closed