You are here

function activity_comments_schema in Activity 7

Same name and namespace in other branches
  1. 6.2 activity_comments/activity_comments.install \activity_comments_schema()

Implements hook_schema().

File

activity_comments/activity_comments.install, line 11
Install, update and uninstall functions for the activity_comments module.

Code

function activity_comments_schema() {
  $schema['activity_comments'] = array(
    'description' => 'The base table for activity comments.',
    'fields' => array(
      'cid' => array(
        'description' => 'The primary identifier for a activity comment.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'aid' => array(
        'description' => 'The current activity identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The authors identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'comment' => array(
        'description' => 'The comment message',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time that the comment was created as a Unix timestamp.',
      ),
    ),
    'indexes' => array(
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  $schema['activity_comments_stats'] = array(
    'description' => 'Stats about the activities for activity comments',
    'fields' => array(
      'aid' => array(
        'description' => 'The current activity identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time that the comment was created as a Unix timestamp.',
      ),
      'comment_count' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time that the comment was created as a Unix timestamp.',
      ),
    ),
    'indexes' => array(
      'changed' => array(
        'changed',
      ),
    ),
    'primary key' => array(
      'aid',
    ),
  );
  return $schema;
}