You are here

activityhistory.install in Activity 5.3

File

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

/**
 * Implementation of hook_install().
 */
function activityhistory_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {activity_history} (\n        uid int NOT NULL default '0',\n        aid int NOT NULL default '0',\n        timestamp int NOT NULL default '0',\n        PRIMARY KEY (uid,aid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {activity_history} (\n        uid int NOT NULL default '0',\n        aid int NOT NULL default '0',\n        timestamp int NOT NULL default '0',\n        PRIMARY KEY (uid,aid)\n      )");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function activityhistory_uninstall() {
  if (db_table_exists('activity_history')) {
    db_query("DROP TABLE {activity_history}");
  }
}

Functions

Namesort descending Description
activityhistory_install Implementation of hook_install().
activityhistory_uninstall Implementation of hook_uninstall().