Currently you can selectively apply custom data fields to participant (event registration) forms based on Participant Role. However, it would be useful to specify the fields based on the either the type of event and / or the specific event (e.g. by event name).
1. Add an option group "custom_data_type", and add option values for "Participant Role" and "Participant Event" custom data.
2. Make schema changes:
Change civicrm_custom_group.entity_column_name to civicrm_custom_group.entity_column_id
3. This functionality will require us to implement use of civicrm_custom_group.entity_column_id property to store the option value associated with entity_column_value. Currently, those column names are hard-coded by object.
Example: For Participant Role
extends = Participant
entity_column_value = 2
entity_column_id = 1
So here entity_column_id will be role_id or event_id.
4. Handle schema changes in upgrade process.
NOTE: If we want to support > 1 dimension for linking an object class to custom field group, then we may need to modify the schema. An example use case would be... Custom fields used for Participants who are Volunteers at the Fall Fundraiser Dinner. (role_id and event_id)