Skip to end of metadata
Go to start of metadata

The goal of this project is to take another look and minimize the number of places we use entity_table / entity_id. Using this does have the advantage of the same code for multiple objects. However it is probably a bit inefficient and more importantly we cannot use th FK constraint checks of the database. I was pleasantly surprised and quite pleased that we were not using it a lot. The changes from this are expected to be quite minimal, IMO.

I've split this group up into three categories: Keep as is, Convert to, Handled by another Data Model Change, i.e. Activity, Location or Custom. Here are my recommendations:

Retain as is

Except for civicrm_note and civicrm_log, the others are fairly small table where this generalization is quite good. Note is used in quite a few places (contact, contribiution, event etc), that having the flexibility is good. Note can potentially be involved in search and export. Log is used for quite a few objects and is probably not searched a lot either.

  • civicrm_dupe_match
  • civicrm_price_set_entity
  • civicrm_acl
  • civicrm_acl_entity_role
  • civicrm_mailing_group
  • civicrm_log
  • civicrm_note
  • civicrm_uf_join
  • civicrm_premiums
  • civicrm_membership_block
  • civicrm_entity_file - Need to understand a bit more
  • civicrm_line_item - Need to understand a bit more

Change

Table

New Foreign Key

civicrm_financial_trxn

contribution_id

civicrm_participant_payment

contribution_id

civicrm_membership_payment

contribution_id

civicrm_entity_tag

contact_id

Handled by another Data Model Change

Activity

  • civicrm_project
  • civicrm_task
  • civicrm_task_status
  • civicrm_activity
  • civicrm_meeting
  • civicrm_activity_assignment
  • civicrm_case_activity
  • civicrm_phonecall
  • civicrm_activity_history

Location

  • civicrm_location

Custom Group / Field

  • civicrm_custom_option
  • civicrm_custom_value
Labels:
  1. Jul 24, 2007

    A few thoughts on some Change items:

    • civicrm_premiums - We've already had requests to allow premiums to be offered during Event Registration. This "could" be covered by Price Sets - but they're not quite the same functionality.
    • civicrm_membership_block - It may make sense at some point to allow membership blocks to be included in an Event Registration page. Might want to leave this unchanged to allow for that (as I don't think we're taking a big hit on this one).
    • civicrm_entity_tag - What about tagging Groups, Events, etc. at some point?
  2. Jul 25, 2007

    premiums and membership_block are used only in a few places, so i'd agree with you and keep is as is

    tags have been there since 1.0. It is part of search at times, we have not put it in groups or events as yet (which i suspect means we wont do so anytime soon), and hence i think the redirection is just not worth it. hence i'd vote to change it


Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.