We are generating our entity classes from the database. By doing so, we get a nicely separated set of base record classes and derived record classes where we can implement our logic. The case is, that we want to add validators to about every field there is. The only way that we can do that right now, is by overriding the setUp() method, calling parent::setUp() and providing new column definitions using addColumn(). By doing so, we do have to include the options that were so nicely automatically determined from the database. If we now update our schema in the db and regenerate the base record classes, we might have to manually update addColumn() calls in derived records.
To make it possible to fully separate the automatic and manual code, we were looking for a method to tweak an already existing table, but we couldn't find such method. Therefore, we implemented one ourselves.
A practial usage example. This is what we had to write in the derived class (not a validator example, but the idea is the same of course: tweak or add a column option):
This is what we write now:
Please, consider adding the proposed change from the attached diff file. Of course, also let me know if there is a better way to handle this.