You are here

activityhistory.install in Activity 5.4

File

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

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;
  }
}
function activityhistory_uninstall() {
  if (db_table_exists('activity_history')) {
    db_query("DROP TABLE {activity_history}");
  }
}