Issue Details (XML | Word | Printable)

Key: MDL-14955
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Eloy Lafuente (stronk7)
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 2
Operations

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

M2: Modify XMLDB Editor to suggest creation conditional code

Created: 22/May/08 11:44 PM   Updated: 26/May/08 08:49 AM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Eloy Lafuente (stronk7)
Security Level: None
Resolved date: 26/May/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Modify the suggested code by XMLDB editor to make all the creation functions (create_table, create_index...) to be executed within one:

if (!table_exists...)

block.

Right now, create_table() itself checks this, returning true and we are going to change this to return false. So conditions will be necessary (or exception handling).

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) made changes - 24/May/08 06:02 AM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 24/May/08 06:24 AM
Conditionally execute create/drop table dbmanager functions. MDL-14955
MODIFY admin/xmldb/actions/view_structure_php/view_structure_php.class.php   Rev. 1.15    (+9 -5 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 24/May/08 06:26 AM
And also conditionally create/drop indexes and fields. MDL-14955
MODIFY admin/xmldb/actions/view_table_php/view_table_php.class.php   Rev. 1.20    (+17 -9 lines)
Eloy Lafuente (stronk7) added a comment - 24/May/08 06:28 AM
Hi,

I've added conditions to create/drop table/field/index in the PHP generated by the Editor.

Uhm... I'm not 100% sure this is the best behaviour... should all the rest of manager functions be executed within those conditions too? Makes things ugly...

Anyway, plz, take a look to current code, and feel free to comment... ciao


Eloy Lafuente (stronk7) added a comment - 26/May/08 08:49 AM
I'm closing this as resolved, as commented. All create and drop operations are "protected" with exists check in PHP suggested code.

Feel free to reopen if necessary.

Ciao


Eloy Lafuente (stronk7) made changes - 26/May/08 08:49 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]