Fix upgrade to work with Postgresql, too

This lets the upgrade work on Postgresql, too.  Error without this fix was:
```
** [---] Default exception handler: Error writing to database Debug: ERROR:  column "scheduler" does not exist
** [---] LINE 1: UPDATE mdl_event SET modulename = "scheduler" WHERE eventtyp...
```