activity_comments.install in Activity 7
Same filename and directory in other branches
Install, update and uninstall functions for the activity_comments module.
File
activity_comments/activity_comments.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the activity_comments module.
*
*/
/**
* Implements hook_schema().
*/
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;
}
/**
* Implements hook_install().
*/
function activity_comments_install() {
// TODO The drupal_(un)install_schema functions are called automatically in D7.
// drupal_install_schema('activity_comments')
}
/**
* Implements hook_uninstall().
*/
function activity_comments_uninstall() {
// TODO The drupal_(un)install_schema functions are called automatically in D7.
// drupal_uninstall_schema('activity_comments')
}
Functions
Name | Description |
---|---|
activity_comments_install | Implements hook_install(). |
activity_comments_schema | Implements hook_schema(). |
activity_comments_uninstall | Implements hook_uninstall(). |