Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9
-
Fix Version/s: 2.0.8
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_20_STABLE
Description
These features should be added to the XMLDB editor/XMLDB stuff.
1) For new tables, allow one new attribute (disable_char_notnull_default_clause = true) to decide if CHAR NOT NULL fields must have de horrible DEFAULT '' clause added or not. All new tables should have it enabled IMO!
2) Allow some sort of CFG->variable to have precedence over
var $unique_keys = false; // Does the generator build unique keys
var $foreign_keys = false; // Does the generator build foreign keys
in generators. This will allow the creation of new site (dev sites) with both UKs and FKs enabled and will allow developers to check code in order to fulfil consttraints.
3) Make some FK pre-checker. It would iterate over ALL the UK/FK in XMLDB definition, checking existing data fulfils the constraints. Could be used, in the future, to create all those relational stuff in existing sites.
For 1), presumably the editor can take care of the details.
For 2) It would be really nice to have a box on the first screen of install, like the 'unattended operation' one, where you could choose 'developer' or 'production'. That would set the two config options you mention, but would also turn on debug, perfdb, and a few other things.