Aller directement à la fin des métadonnées
Aller au début des métadonnées

This page is an introduction to CiviCRM's data architecture.

This should be useful for users and implementors that want to better understand the different CivICRM objects and tables and how they are related, and how they are stored in the database.

Most of the common objects in CivICRM (like contacts, activities, memberships, relationships, groups), are stored in the database as one or more tables.  Most of the tables that represent common CRM objects (like contacts, activities, relationships), etc. can be segmented into different types.  Most objects can be extended by adding custom data.

Interacting directly with the database is highly discouraged.  You are very likely to corrupt your database if you are not aware of all the foreign key contrstraints etc.  CiviCRM provides a number of other ways to interact with the data, including import screens, the API , and of course the user interface (UI).  You should use these methods which should be used instead of directly manipulating the database.

The diagrams below are simplifcations of the data structure.  Fields in the diagrams below are likely to change between versions.  Consult your version's database schema for an up to date list of fields.

Entire DB Schema

Taken from CiviCRM 3.14

Please click the thumbnail to view the diagram

To download the entire diagram, click here

Contacts and relationships

Individuals, organisations and households are stored in a single table civicrm_contact.

Contact details for each contact are stored in seperate tables.

Contacts can be related to each other by applying relationships.

Activities

Activities are recorded in civicrm_activity and linked to civicrm_contact in three main ways

  • the person (or persons) that was/were the target of the activity
  • the person that recorded the activity (source_contact_id)
  • any people that the activity was assigned to to carry out.

 

Membership

Memberships are record in the table civicrm_membership.  Associated contributions (if there are any) are stored in civicrm_contribution and associated with the membership.

Contributions

Contributions are stored in civicrm_contribution

Groups and tags

Groups and tags look similar in CiviCRM's database.

Custom data

A list of objects that can be extended with custom data can be found at: http://d45.demo.civicrm.org/civicrm/admin/custom/group?action=add&reset=1 [log in with ID demo, password demo] then click on the 'Used for' drop down to see the full list.

Custom data can be applied to either all objects, e.g. all events, or restricted to objects of a certain type, e.g. only training events.  When you add custom data to a CiviCRM object, you first create a custom data group and then add custom data fields. At the database layer, what you are doing is creating a new table for the custom data group and adding columns for the fields.

The diagrams on this page were created using MySQL Workbench.

Étiquette
  • Aucun