You are here

function user_relationship_defaults_install in User Relationships 5

Same name and namespace in other branches
  1. 5.2 plugins/user_relationship_defaults/user_relationship_defaults.install \user_relationship_defaults_install()
  2. 6 user_relationship_defaults/user_relationship_defaults.install \user_relationship_defaults_install()

File

plugins/user_relationship_defaults/user_relationship_defaults.install, line 3

Code

function user_relationship_defaults_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("\n      CREATE TABLE {user_relationship_defaults} (\n        rdid int unsigned NOT NULL default 0,\n        uid int unsigned NOT NULL default 0,\n        rtid int unsigned NOT NULL default 0,\n        PRIMARY KEY (rdid),\n        KEY uid (uid),\n        KEY rtid (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 Relationships Defaults module installed successfully.'));
  }
  else {
    drupal_set_message(t('The installation of the User Relationships Defaults module as unsuccessful.'), 'error');
  }
}