Dynamic Fields/Columns
- by DanMark
What is the best way to allow for dynamic fields/database columns? For example, let's say we have a payroll system that allows a user to create unique salary structures for each employee. How could/should one handle this scenario? I thought of using a "salary" table that hold the salary component fields and joining these columns to a "salary_values" table that hold the actual values. Does this make sense?
Example Salary Structures:
Notice how the components of the salary can be shared or unique.
-- Jon's Salary --
Basic 100
Annual Bonus 25
Tel. Allowances 15
-- Jane's Salary --
Basic 100
Travel Allowances 10
Bi-annual Bonus 30