Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.0
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Database:Any
-
Difficulty:Moderate
-
Affected Branches:MOODLE_20_STABLE
-
Fixed Branches:MOODLE_20_STABLE
Description
As explained in http://moodle.org/mod/forum/discuss.php?d=127196 current behaviour when trying to perform field ddl actions (drop field, rename, change some property...) is really not cross-db at all, with each DB following different approaches.
So, in order to get a consistent approach for any DB we are going to:
1) Create one new ddl_dependency_exception (extends ddl_change_structure_exception)
2) In dbmanager, perform the required dependency checks (mainly look for existing indexes for now) and throw that exception if dependency is found.
3) In XMLDB editor, when generating PHP code to be used in upgrade scripts, look for the XMLDB definition (not to DB!) and if there is any dependency, include php code to drop/create indexes.
Issue Links
| This issue will be resolved by: | ||||
| MDL-19701 | In PHP code generation, detect field dependencies (XMLDB-based) and provide needed code |
|
|
|
Sounds good to me.