![]() |
DBForge Updating ENUM Values/Constraints - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DBForge Updating ENUM Values/Constraints (/showthread.php?tid=59200) |
DBForge Updating ENUM Values/Constraints - El Forum - 09-04-2013 [eluser]Unknown[/eluser] Hey guys, I'm using CodeIgniter's migrations functionality on an app I'm building, and I've ran into a very frustrating issue with trying to update enum fields values. According to what I've read, creating an ENUM field requires setting the constraint in an array like below: Code: $field['enum_field'] = array( However if you try to modify the ENUM column constraint using an array like that, it will throw a php error about an array to string conversion. So an FYI to anyone, if you are trying to update the constraint value for an ENUM field in CodeIgniter's DBForge, it has to be a string as per below. Code: # Change the ENUM contstraint for EmployeeRole to include a contractor role Hopefully this saves someone a little banging their head on the desk time. |