This covers most (all?) the gaps in data retrieval except get_recordset_sql().
To tackle get_recordset_sql, where the actual data retrieval is done within
AdoDB, we would have to to wrap around AdoDB with a subclass, but that would
be dirty, dirty, dirtier.
sql_concat() is just a passthrough to $db->Concat() -- it doesn't
add any value, and I think the dispatching is somewhat expensive.
Just using $db->Concat() should be good enough, were it not for
consistency in our DM API.
Credit: Alastair Pharo <alastair@catalyst.net.nz>
1) Some config settings have changed (ones that related specifically to
teachers and students). There is a check in place however to migrate
old configurations to new ones.
2) Perviously two syncs happened - one for students, one for teachers.
Now sync gets called the same number of times as there are roles.
Those roles that have config settings associated with them then run
through all the records. This means syncing takes longer the more
roles you configure (which is expected anyway I suppose).
Credit: Alastair Pharo <alastair@catalyst.net.nz>
Database
--------
1) This plugin previously only worked for students. I have made it so
that you can _optionally_ specify a third column in your external
database that contains some kind of role information (similar to the
other two fields, you can choose any column in the mdl_role table
to map to). If you do this, then the code loops over for each different
kind of role and queries the external database.
2) There is a *slight* problem to be aware of, if a moodle
configuration was upgraded to use the new role columns, then downgraded
again, some roles might get left behind in the database when the
large-scale sync thing goes through (that is, record pruning doesn't
scale back quite properly). These would be cleaned away by
setup_enrolments at login time, however, and the scenario was unlikely
enough for me to decide to leave it for now.
3) If you don't have role columns there is a 'default role' setting
that you can set (made by Martin D). This will only be obeyed when no
role columns are specified. If this is set to 'default', then the
course default role is used, on a per-course basis (which usually
means student apparently).
4) From (3), my understanding is that if no config settings are
changed, and the default role for all upgraded courses is student, that
a smooth upgrade to 1.7 will occur for users of the database enrolment
plugin.
- Foreign keys are really cool (at the XMLDB Editor). Define them as necessary
as they allow as one "formal" structure of the DB. They won't cause problems
on generation, mainly because only the underlying index will be created.
- Please, put comments inside each table/field/key/index field, mainly because
XML comments will be deleted if the file is edited by
- The XMLDB Editor. Please use it ;-)
- Also, one unique index was wrong in the XML file, fixed now.