You are here

function user_relationships_install in User Relationships 5

Same name and namespace in other branches
  1. 5.2 user_relationships.install \user_relationships_install()

File

./user_relationships.install, line 35

Code

function user_relationships_install() {
  $queries = array(
    "CREATE TABLE {user_relationship_types} (\n      rtid int unsigned NOT NULL default 0,\n      name varchar(255) NOT NULL default '',\n      plural_name varchar(255) NOT NULL default '',\n      is_oneway tinyint(1) NOT NULL default 0,\n      requires_approval tinyint(1) NOT NULL default 0,\n      expires_val int unsigned NOT NULL default 0,\n      PRIMARY KEY (rtid),\n      UNIQUE KEY name (name)\n    ) /*!40100 DEFAULT CHARACTER SET utf8*/;",
    "CREATE TABLE {user_relationships} (\n      rid int unsigned NOT NULL default 0,\n      requester_id int NOT NULL default 0,\n      requestee_id int NOT NULL default 0,\n      rtid int NOT NULL default 0,\n      approved tinyint(1) NOT NULL default 0,\n      created_at datetime NOT NULL,\n      updated_at timestamp NOT NULL,\n      PRIMARY KEY (rid),\n      KEY requester_id (requester_id),\n      KEY requestee_id (requestee_id),\n      KEY rtid (rtid)\n    ) /*!40100 DEFAULT CHARACTER SET utf8*/;",
    "CREATE TABLE {cache_user_relationships} (\n      cid varchar(255) NOT NULL default '',\n      data longblob,\n      expire int(11) NOT NULL default 0,\n      created int(11) NOT NULL default 0,\n      headers text,\n      serialized int(1) NOT NULL default 0,\n      PRIMARY KEY (cid),\n      KEY expire (expire)\n    ) /*!40100 DEFAULT CHARACTER SET utf8*/;",
  );
  _user_relationships_installation_query($queries);
}