Upgraded db to use moodle generated tables