Upgrading database schema using upgrade.php

If you need to upgrade your database schema for a custom plugin, e.g. adding a new table or changing the properties of an existing table, you should do it through db/upgrade.php per the suggestions in the MoodleDocs UpgradeAPI. This isn’t a bad idea to do even when iterating through development as it isn’t a lot…

Moodle and Timezones

Moodle timezone information in the first instance is loaded from: http://download.moodle.org/timezone/ This returns a text file which is stored in the lib directory as timezone.txt The data is stored in the table mdl_timezone (adjust to suit your db prefix).

Assign site admins through the database

The following steps can be used to add your user as a siteadmin in the database if required. Step 1: Find your moodle user ID select id from mdl_user where username = ‘{username}’; Step 2: Get the list of current siteadmin IDs select value from mdl_config where name = ‘siteadmins’; This gives you a list…