fix: Rename column to selectedcolumn in DB#90
Conversation
`column` seems to be a reserved keyword in postgresql. really cool that moodle never warned me of this.
|
will the db migration work on prod without bricking everything? (not the kanban data, as there is none but recreating the table) |
I'm literally working off an example moodle provides for that so I better hope this works. It worked on the testserver, anyway. I will say, the upgrade steps might fail on postgres. If that's the case, the upgrade will just not get applied. I fear that in that scenario we'll have to come up with steps to manually edit the database… |
|
TL;DR: should work™ but even if not, worst case they'll just not be able to upgrade and we'll have to edit the DB manually |
|
You could have used quotation around your column names. This ist exactly what "" is for in SQL (remember, its not for String limitation ;-) ). |
|
I will note that the moodle-internal function ( Renaming the column was in my opinion the correct approach, since it will avoid future bugs (since none of the moodle-internal functions seem to quote column names). The original workaround stemmed from laziness and shouldn't have been committed in the first place. |
columnseems to be a reserved keyword in postgresql. really cool that moodle never warned me of this.anyway, this should fix EDUPL-19 if I'm correct.
this PR also:
do note that inside the code, the field in the *model* is still called "column" - this is on one hand for brevity, and on the other so I don't have to refactor as much.