General developer forum

Renaming a database field that has become a reserved word

 
Picture of Matteo Scaramuccia
Re: Renaming a database field that has become a reserved word
Core developersParticularly helpful MoodlersPlugin developers

Hi MIke,
AFAIK no, unfortunately for you.

I'd code an hacky upgrade path in your plug-in that it will test if it runs on MySQL and under a Moodle version w/o MDL-63319 being landed, and only under that context I'd wrap the rank field name with the required backtick.
Other IMHO valid option: you should add a Wiki entry for this known issue and ask the user to manually add backticks if she/he is running a Moodle version affected by MDL-63319.

The same issue happens in core for MDL-60793, as described in https://moodle.org/mod/forum/discuss.php?d=373009: I put it in the my backlog and when I saw that it affected more than one scenario I started fixing the unbalanced mysql_sql_generator::getRenameFieldSQL().

HTH,
Matteo

 
Average of ratings: -