You are here

function og_schema_7200_info in Organic groups 7.2

Return the schema for upgrade 7200.

Currently we hold only the {og_users_role} table.

1 call to og_schema_7200_info()
og_update_7200 in ./og.install
Deprecate OG group entity, and add per-bundle roles.

File

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

Code

function og_schema_7200_info() {
  $schema['og_users_roles'] = array(
    'description' => 'Maps users to roles.',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Primary Key: {users}.uid for user.',
      ),
      'rid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Primary Key: {og_role}.rid for role.',
      ),
      'gid' => array(
        'description' => "The group's unique ID.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'group_type' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The group's entity type.",
      ),
    ),
    'primary key' => array(
      'uid',
      'rid',
      'gid',
    ),
    'indexes' => array(
      'rid' => array(
        'rid',
      ),
    ),
    'foreign keys' => array(
      'user' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
      'og_role' => array(
        'table' => 'og_role',
        'columns' => array(
          'rid' => 'rid',
        ),
      ),
    ),
  );
  return $schema;
}