You are here

function og_schema in Organic groups 6.2

Same name and namespace in other branches
  1. 6 og.install \og_schema()
  2. 7.2 og.install \og_schema()
  3. 7 og.install \og_schema()

Definition of hook_schema();

File

./og.install, line 11

Code

function og_schema() {
  $schema = array();
  $schema['og'] = array(
    'description' => 'Stores information about each group.',
    'fields' => array(
      'nid' => array(
        'description' => "The group's {node}.nid.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'og_selective' => array(
        'description' => 'Determines how subscription requests are handled (open, moderated, invite only, closed).',
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
        'default' => 0,
      ),
      'og_description' => array(
        'description' => 'Group description. Shows up by default on group directory.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'og_theme' => array(
        'description' => 'The group specific theme (if any). See {system}.name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'og_register' => array(
        'description' => 'Should users be able to join this group from registration form.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'og_directory' => array(
        'description' => 'Should this group appear in the groups directory.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'og_language' => array(
        'description' => 'Group specific language. See {languages}.language.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'og_private' => array(
        'description' => 'Is group home page private or public.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['og_uid'] = array(
    'description' => 'Group memberships',
    'fields' => array(
      'nid' => array(
        'description' => "Group's {node}.nid.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'og_role' => array(
        'description' => 'Not currently used.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'is_active' => array(
        'description' => 'Is this membership active or pending?',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'is_admin' => array(
        'description' => 'Is this user a group administrator?',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The user for this membership. See {users}.uid.',
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'created' => array(
        'description' => 'Time when this membership was created.',
        'type' => 'int',
        'size' => 'normal',
        'not null' => FALSE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'Time when this membership was last changed.',
        'type' => 'int',
        'size' => 'normal',
        'not null' => FALSE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'uid',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
  $schema['og_ancestry'] = array(
    'description' => 'Stores associations between nodes and groups.',
    'fields' => array(
      'nid' => array(
        'description' => "The post's {node}.nid.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'group_nid' => array(
        'description' => "The group's {node}.nid.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'nid',
      'group_nid',
    ),
    'indexes' => array(
      'group_nid' => array(
        'group_nid',
      ),
    ),
  );
  return $schema;
}