I'm building a CMS (yes, yes, I know, but I enjoy it, ok? :-)) that has 'entries'. These entries have a fixed number of standard fields that can be captured in a db - id, title, date created etc. All standard stuff.
However, I also want the entries to have X amount of 'custom fields' associated with them. These custom fields would be user-defined, and may have titles, descriptions, formatting, max-length and other attributes defined. Now obviously I can store the definitions of these fields in a db table easily enough, but what is the best way to store and match up the data for each entry that corresponds to these custom fields?
ExpressionEngine does basically this same thing, and uses an entries table that has columns dynamically added to it for each custom field. But I can't believe that this is the best way to solve this problem.
Are there any better ways to structure a relational db to deal with this sort of flexible data model?