[Catalyst] post-deployment custom fields in application

bill hauck wbhauck at yahoo.com
Thu Dec 22 19:01:03 GMT 2011


Hi.

I'm building an application--project management system--that I'd like to have the application administrators to be able to create custom fields for various tables after deployment.

For instance, instead of including a hard-coded field for every possible IM or chat system out there, I'd like the admins to be able to decide they only care about AIM and Skype, so they'd add "aim_name" and "skype_name" fields.  Other installations and admins might decide they only care about gtalk and facebook so they'd add those fields.

The other issue is that I don't want to simply add 10 extra fields and give the admins control of the display name.  I'd like to essentially have a secondary table that holds the custom fields for that table's primary table. So ...

The person table has a person_custom table to hold the custom fields and data.
The project table has a project_custom table to hold the custom fields and data.
Etc.

So my question really is what's the best approach?  A secondary table for every table I want custom fields for?  Or a set of static tables where the first holds the field information and the second holds the data related to those fields?  or is there a completely different way I'm not thinking of?

For the first way, custom table per table, how do I make DBIx::Class work with that?  I don't want to have to run the model creation script after adding or modifying a custom field; I'd like to have the field available on the fly.  Do I have to give up DBIC for the custom tables?

Any info is greatly appreciated.

Thanks,

bill




More information about the Catalyst mailing list