Moodle

M2: Modify XMLDB Editor to suggest creation conditional code

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

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).

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

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

Show
Eloy Lafuente (stronk7) added a comment - 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
Hide
Eloy Lafuente (stronk7) added a comment -

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

Show
Eloy Lafuente (stronk7) added a comment - 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

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: