You are here

user_relationship_implications.install in User Relationships 5

File

plugins/user_relationship_implications/user_relationship_implications.install
View source
<?php

function user_relationship_implications_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("\n      CREATE TABLE {user_relationship_implications} (\n        riid int unsigned NOT NULL default 0,\n        rtid int unsigned NOT NULL default 0,\n        implies_rtid int unsigned NOT NULL default 0,\n        PRIMARY KEY (riid),\n        KEY rtid (rtid),\n        KEY implies_rtid (implies_rtid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8*/;\n    ");
      $success = TRUE;
      break;
    default:
      drupal_set_message(t('Unsupported database.'));
  }
  if ($success) {
    drupal_set_message(t('User Relationship Implications module installed successfully.'));
  }
  else {
    drupal_set_message(t('The installation of the User Relationship Implications module as unsuccessful.'), 'error');
  }
}
function user_relationship_implications_uninstall() {
  db_query("DROP TABLE {user_relationship_implications}");
}