You are here

activityhistory.install in Activity 6

File

contrib/activityhistory/activityhistory.install
View source
<?php

/**
 * Implementation of hook_schema().
 */
function activityhistory_schema() {
  $schema['activity_history'] = array(
    'description' => 'The {activity_history} table stores activity history data',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'aid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
      'aid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function activityhistory_install() {
  drupal_install_schema('activityhistory');
}

/**
 * Implementation of hook_uninstall().
 */
function activityhistory_uninstall() {
  drupal_uninstall_schema('activityhistory');
}

/**
 * The primary key defined in the schema was defined incorrectly.
 * This update resets the PRIMARY KEY to the correct value.
 */
function activityhistory_update_6101() {
  $ret = array();
  db_drop_primary_key($ret, 'activity_history');
  db_add_primary_key($ret, 'activity_history', array(
    'uid',
    'aid',
  ));
  return $ret;
}

Functions

Namesort descending Description
activityhistory_install Implementation of hook_install().
activityhistory_schema Implementation of hook_schema().
activityhistory_uninstall Implementation of hook_uninstall().
activityhistory_update_6101 The primary key defined in the schema was defined incorrectly. This update resets the PRIMARY KEY to the correct value.