You are here

function ggroup_schema_alter in Group 7

Implements hook_schema_alter().

Informs Drupal of the changes we made to {group_membership}.

File

modules/ggroup/ggroup.module, line 27
Contains Subgroup functionality for the Group module.

Code

function ggroup_schema_alter(&$schema) {

  // Include the install file for its helper functions.
  module_load_install('ggroup');

  // Add the parent_mid field.
  $schema['group_membership']['fields']['parent_mid'] = _ggroup_parent_mid();

  // Add the heritage field.
  $schema['group_membership']['fields']['heritage'] = _ggroup_heritage();

  // Add the parent_mid foreign key.
  $schema['group_membership']['foreign keys']['parent_mid'] = array(
    'table' => 'group_membership',
    'columns' => array(
      'parent_mid' => 'mid',
    ),
  );
}