You are here

function og_field_schema in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og.install \og_field_schema()

Implements hook_field_schema().

File

./og.install, line 625
Install, update, and uninstall functions for the Organic groups module.

Code

function og_field_schema($field) {
  $columns = array(
    'gid' => array(
      'description' => 'The group unique ID.',
      'type' => 'float',
      'unsigned' => TRUE,
      'not null' => FALSE,
    ),
    // This columns should be deprecated and removed, as the group membership
    // entity takes care of it. However, there is currently no way to remove
    // them.
    'state' => array(
      'description' => 'The state of the group content.',
      'type' => 'varchar',
      'length' => 255,
      'not null' => FALSE,
      'default' => '',
    ),
    'created' => array(
      'description' => 'The Unix timestamp when the group content was created.',
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => array(
      'gid' => array(
        'gid',
      ),
    ),
    'foreign keys' => array(
      'og' => array(
        'table' => 'og',
        'columns' => array(
          'gid' => 'gid',
        ),
      ),
    ),
  );
}