You are here

comment_og.install in Comment OG 6

Same filename and directory in other branches
  1. 5 comment_og.install

Installation hooks for comment_og.

File

comment_og.install
View source
<?php

/**
 * @file
 *   Installation hooks for comment_og.
 */

/**
 * Implementation of hook_schema().
 */
function comment_og_schema() {
  $schema = array();
  $schema['comment_og_node'] = array(
    'description' => 'Stores comment permission settings for each group.',
    'fields' => array(
      'nid' => array(
        'description' => 'The group\'s {og}.nid',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'grant_nonmember_access' => array(
        'description' => 'Allow non-members to post comments to this particular group',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => (int) FALSE,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
    'foreign keys' => array(
      'nid' => array(
        'table' => 'node',
        'columns' => array(
          'nid' => 'nid',
        ),
      ),
    ),
  );
  return $schema;
}

/**
 * Implement hook_install().
 */
function comment_og_install() {
  drupal_install_schema('comment_og');
}

/**
 * Implement hook_update_N().
 */
function comment_og_update_6100(&$sandbox) {
  $ret = array();
  $ret = array_merge($ret, drupal_install_schema('comment_og'));
  return $ret;
}

Functions

Namesort descending Description
comment_og_install Implement hook_install().
comment_og_schema Implementation of hook_schema().
comment_og_update_6100 Implement hook_update_N().