Issue Details (XML | Word | Printable)

Key: MDL-19701
Type: Sub-task Sub-task
Status: Open Open
Priority: Minor Minor
Assignee: Eloy Lafuente (stronk7)
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-19303

In PHP code generation, detect field dependencies (XMLDB-based) and provide needed code

Created: 03/Jul/09 12:34 AM   Updated: 03/Jul/09 12:34 AM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

Issue Links:
Dependency
 

URL: http://moodle.org/mod/forum/discuss.php?d=127196
Participants: Eloy Lafuente (stronk7)
Security Level: None
Difficulty: Moderate
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
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 and MDL-19695

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.