Why the department field in users database table is only 30 chars whide?

Why the department field in users database table is only 30 chars whide?

by Vanyo Georgiev -
Number of replies: 3

It is too short for some names of departments in our university.

Is it safe to enlarge the width of this field?

What will happen during the upgrade to next Moodle version?

Does the width of 30 will be restored or the change to larger width will be an obstacle to the process of upgrading?

Average of ratings: -
In reply to Vanyo Georgiev

Re: Why the department field in users database table is only 30 chars whide?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Generally it is a bad idea to modify Moodle core tables. However, just changing that column from 30 chars to something larger should be safe.

Moodle will not alter the width of that column unless an upgrade step is actually coded to change the width of that column.

Average of ratings: Useful (2)
In reply to Vanyo Georgiev

Re: Why the department field in users database table is only 30 chars whide?

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Vanyo, I agree with what Tim said and also note that Moodle can change DB fields only in major releases, so your upgrades to weeklies and/or point releases will be definitely safe.

I would also recommend you to create an issue in https://tracker.moodle.org/ asking to increase the size of this field, this is a very reasonable request (I remember that departments in my university had extremely long names as well). We can still do it for 2.6