Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1491 lines
73 KiB

  1. <?php
  2. require_once("boot.php");
  3. require_once("include/text.php");
  4. define('NEW_UPDATE_ROUTINE_VERSION', 1170);
  5. /*
  6. * send the email and do what is needed to do on update fails
  7. *
  8. * @param update_id (int) number of failed update
  9. * @param error_message (str) error message
  10. */
  11. function update_fail($update_id, $error_message){
  12. //send the administrators an e-mail
  13. $admin_mail_list = "'".implode("','", array_map(dbesc, explode(",", str_replace(" ", "", $a->config['admin_email']))))."'";
  14. $adminlist = q("SELECT uid, language, email FROM user WHERE email IN (%s)",
  15. $admin_mail_list
  16. );
  17. // every admin could had different language
  18. foreach ($adminlist as $admin) {
  19. $lang = (($admin['language'])?$admin['language']:'en');
  20. push_lang($lang);
  21. $preamble = deindent(t("
  22. The friendica developers released update %s recently,
  23. but when I tried to install it, something went terribly wrong.
  24. This needs to be fixed soon and I can't do it alone. Please contact a
  25. friendica developer if you can not help me on your own. My database might be invalid."));
  26. $body = t("The error message is\n[pre]%s[/pre]");
  27. $preamble = sprintf($preamble, $update_id);
  28. $body = sprintf($body, $error_message);
  29. notification(array(
  30. 'type' => "SYSTEM_EMAIL",
  31. 'to_email' => $admin['email'],
  32. 'preamble' => $preamble,
  33. 'body' => $body,
  34. 'language' => $lang,
  35. ));
  36. }
  37. /*
  38. $email_tpl = get_intltext_template("update_fail_eml.tpl");
  39. $email_msg = replace_macros($email_tpl, array(
  40. '$sitename' => $a->config['sitename'],
  41. '$siteurl' => $a->get_baseurl(),
  42. '$update' => DB_UPDATE_VERSION,
  43. '$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
  44. ));
  45. $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
  46. require_once('include/email.php');
  47. $subject = email_header_encode($subject,'UTF-8');
  48. mail($a->config['admin_email'], $subject, $email_msg,
  49. 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME']."\n"
  50. .'Content-type: text/plain; charset=UTF-8'."\n"
  51. .'Content-transfer-encoding: 8bit');
  52. */
  53. //try the logger
  54. logger("CRITICAL: Database structure update failed: ".$retval);
  55. }
  56. function table_structure($table) {
  57. $structures = q("DESCRIBE `%s`", $table);
  58. $indexes = q("SHOW INDEX FROM `%s`", $table);
  59. $fielddata = array();
  60. $indexdata = array();
  61. if (is_array($indexes))
  62. foreach ($indexes AS $index) {
  63. if ($index["Index_type"] == "FULLTEXT")
  64. continue;
  65. $column = $index["Column_name"];
  66. if ($index["Sub_part"] != "")
  67. $column .= "(".$index["Sub_part"].")";
  68. $indexdata[$index["Key_name"]][] = $column;
  69. }
  70. if (is_array($structures)) {
  71. foreach($structures AS $field) {
  72. $fielddata[$field["Field"]]["type"] = $field["Type"];
  73. if ($field["Null"] == "NO")
  74. $fielddata[$field["Field"]]["not null"] = true;
  75. if (isset($field["Default"]))
  76. $fielddata[$field["Field"]]["default"] = $field["Default"];
  77. if ($field["Extra"] != "")
  78. $fielddata[$field["Field"]]["extra"] = $field["Extra"];
  79. if ($field["Key"] == "PRI")
  80. $fielddata[$field["Field"]]["primary"] = true;
  81. }
  82. }
  83. return(array("fields"=>$fielddata, "indexes"=>$indexdata));
  84. }
  85. function print_structure($database) {
  86. echo "-- ------------------------------------------\n";
  87. echo "-- ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION." (".FRIENDICA_CODENAME,")\n";
  88. echo "-- DB_UPDATE_VERSION ".DB_UPDATE_VERSION."\n";
  89. echo "-- ------------------------------------------\n\n\n";
  90. foreach ($database AS $name => $structure) {
  91. echo "--\n";
  92. echo "-- TABLE $name\n";
  93. echo "--\n";
  94. db_create_table($name, $structure['fields'], true, false, $structure["indexes"]);
  95. echo "\n";
  96. }
  97. }
  98. function update_structure($verbose, $action, $tables=null, $definition=null) {
  99. global $a, $db;
  100. $errors = false;
  101. logger('updating structure', LOGGER_DEBUG);
  102. // Get the current structure
  103. $database = array();
  104. if (is_null($tables))
  105. $tables = q("show tables");
  106. foreach ($tables AS $table) {
  107. $table = current($table);
  108. $database[$table] = table_structure($table);
  109. }
  110. // Get the definition
  111. if (is_null($definition))
  112. $definition = db_definition();
  113. // Compare it
  114. foreach ($definition AS $name => $structure) {
  115. $is_new_table = False;
  116. $sql3="";
  117. if (!isset($database[$name])) {
  118. $r = db_create_table($name, $structure["fields"], $verbose, $action, $structure['indexes']);
  119. if(false === $r) {
  120. $errors .= t('Errors encountered creating database tables.').$name.EOL;
  121. }
  122. $is_new_table = True;
  123. } else {
  124. // Drop the index if it isn't present in the definition
  125. // or the definition differ from current status
  126. // and index name doesn't start with "local_"
  127. foreach ($database[$name]["indexes"] AS $indexname => $fieldnames) {
  128. $current_index_definition = implode(",",$fieldnames);
  129. if (isset($structure["indexes"][$indexname])) {
  130. $new_index_definition = implode(",",$structure["indexes"][$indexname]);
  131. } else {
  132. $new_index_definition = "__NOT_SET__";
  133. }
  134. if ($current_index_definition != $new_index_definition && substr($indexname, 0, 6) != 'local_') {
  135. $sql2=db_drop_index($indexname);
  136. if ($sql3 == "")
  137. $sql3 = "ALTER TABLE `".$name."` ".$sql2;
  138. else
  139. $sql3 .= ", ".$sql2;
  140. }
  141. }
  142. // Compare the field structure field by field
  143. foreach ($structure["fields"] AS $fieldname => $parameters) {
  144. if (!isset($database[$name]["fields"][$fieldname])) {
  145. $sql2=db_add_table_field($fieldname, $parameters);
  146. if ($sql3 == "")
  147. $sql3 = "ALTER TABLE `".$name."` ".$sql2;
  148. else
  149. $sql3 .= ", ".$sql2;
  150. } else {
  151. // Compare the field definition
  152. $current_field_definition = implode(",",$database[$name]["fields"][$fieldname]);
  153. $new_field_definition = implode(",",$parameters);
  154. if ($current_field_definition != $new_field_definition) {
  155. $sql2=db_modify_table_field($fieldname, $parameters);
  156. if ($sql3 == "")
  157. $sql3 = "ALTER TABLE `".$name."` ".$sql2;
  158. else
  159. $sql3 .= ", ".$sql2;
  160. }
  161. }
  162. }
  163. }
  164. // Create the index if the index don't exists in database
  165. // or the definition differ from the current status.
  166. // Don't create keys if table is new
  167. if (!$is_new_table) {
  168. foreach ($structure["indexes"] AS $indexname => $fieldnames) {
  169. if (isset($database[$name]["indexes"][$indexname])) {
  170. $current_index_definition = implode(",",$database[$name]["indexes"][$indexname]);
  171. } else {
  172. $current_index_definition = "__NOT_SET__";
  173. }
  174. $new_index_definition = implode(",",$fieldnames);
  175. if ($current_index_definition != $new_index_definition) {
  176. $sql2=db_create_index($indexname, $fieldnames);
  177. if ($sql2 != "") {
  178. if ($sql3 == "")
  179. $sql3 = "ALTER TABLE `".$name."` ".$sql2;
  180. else
  181. $sql3 .= ", ".$sql2;
  182. }
  183. }
  184. }
  185. }
  186. if ($sql3 != "") {
  187. $sql3 .= ";";
  188. if ($verbose)
  189. echo $sql3."\n";
  190. if ($action) {
  191. $r = @$db->q($sql3);
  192. if(false === $r)
  193. $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
  194. }
  195. }
  196. }
  197. return $errors;
  198. }
  199. function db_field_command($parameters, $create = true) {
  200. $fieldstruct = $parameters["type"];
  201. if ($parameters["not null"])
  202. $fieldstruct .= " NOT NULL";
  203. if (isset($parameters["default"])){
  204. if (strpos(strtolower($parameters["type"]),"int")!==false) {
  205. $fieldstruct .= " DEFAULT ".$parameters["default"];
  206. } else {
  207. $fieldstruct .= " DEFAULT '".$parameters["default"]."'";
  208. }
  209. }
  210. if ($parameters["extra"] != "")
  211. $fieldstruct .= " ".$parameters["extra"];
  212. /*if (($parameters["primary"] != "") AND $create)
  213. $fieldstruct .= " PRIMARY KEY";*/
  214. return($fieldstruct);
  215. }
  216. function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
  217. global $a, $db;
  218. $r = true;
  219. $sql = "";
  220. $sql_rows = array();
  221. $primary_keys = array();
  222. foreach($fields AS $fieldname => $field) {
  223. $sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field);
  224. if (x($field,'primary') and $field['primary']!=''){
  225. $primary_keys[] = $fieldname;
  226. }
  227. }
  228. if (!is_null($indexes)) {
  229. foreach ($indexes AS $indexname => $fieldnames) {
  230. $sql_index = db_create_index($indexname, $fieldnames, "");
  231. if (!is_null($sql_index)) $sql_rows[] = $sql_index;
  232. }
  233. }
  234. $sql = implode(",\n\t", $sql_rows);
  235. $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT CHARSET=utf8";
  236. if ($verbose)
  237. echo $sql.";\n";
  238. if ($action)
  239. $r = @$db->q($sql);
  240. return $r;
  241. }
  242. function db_add_table_field($fieldname, $parameters) {
  243. $sql = sprintf("ADD `%s` %s", dbesc($fieldname), db_field_command($parameters));
  244. return($sql);
  245. }
  246. function db_modify_table_field($fieldname, $parameters) {
  247. $sql = sprintf("MODIFY `%s` %s", dbesc($fieldname), db_field_command($parameters, false));
  248. return($sql);
  249. }
  250. function db_drop_index($indexname) {
  251. $sql = sprintf("DROP INDEX `%s`", dbesc($indexname));
  252. return($sql);
  253. }
  254. function db_create_index($indexname, $fieldnames, $method="ADD") {
  255. $method = strtoupper(trim($method));
  256. if ($method!="" && $method!="ADD") {
  257. throw new Exception("Invalid parameter 'method' in db_create_index(): '$method'");
  258. killme();
  259. }
  260. if ($indexname == "PRIMARY") {
  261. return sprintf("%s PRIMARY KEY(`%s`)", $method, implode("`,`", $fieldnames));
  262. }
  263. $names = "";
  264. foreach ($fieldnames AS $fieldname) {
  265. if ($names != "")
  266. $names .= ",";
  267. if (preg_match('|(.+)\((\d+)\)|', $fieldname, $matches))
  268. $names .= "`".dbesc($matches[1])."`(".intval($matches[2]).")";
  269. else
  270. $names .= "`".dbesc($fieldname)."`";
  271. }
  272. $sql = sprintf("%s INDEX `%s` (%s)", $method, dbesc($indexname), $names);
  273. return($sql);
  274. }
  275. function db_definition() {
  276. $database = array();
  277. $database["addon"] = array(
  278. "fields" => array(
  279. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  280. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  281. "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  282. "installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  283. "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  284. "timestamp" => array("type" => "bigint(20)", "not null" => "1", "default" => "0"),
  285. "plugin_admin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  286. ),
  287. "indexes" => array(
  288. "PRIMARY" => array("id"),
  289. )
  290. );
  291. $database["attach"] = array(
  292. "fields" => array(
  293. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  294. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  295. "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  296. "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  297. "filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  298. "filesize" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  299. "data" => array("type" => "longblob", "not null" => "1"),
  300. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  301. "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  302. "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
  303. "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
  304. "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
  305. "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
  306. ),
  307. "indexes" => array(
  308. "PRIMARY" => array("id"),
  309. )
  310. );
  311. $database["auth_codes"] = array(
  312. "fields" => array(
  313. "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
  314. "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
  315. "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
  316. "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  317. "scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""),
  318. ),
  319. "indexes" => array(
  320. "PRIMARY" => array("id"),
  321. )
  322. );
  323. $database["cache"] = array(
  324. "fields" => array(
  325. "k" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
  326. "v" => array("type" => "text", "not null" => "1"),
  327. "expire_mode" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  328. "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  329. ),
  330. "indexes" => array(
  331. "PRIMARY" => array("k"),
  332. "updated" => array("updated"),
  333. )
  334. );
  335. $database["challenge"] = array(
  336. "fields" => array(
  337. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  338. "challenge" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  339. "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  340. "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  341. "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  342. "last_update" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  343. ),
  344. "indexes" => array(
  345. "PRIMARY" => array("id"),
  346. )
  347. );
  348. $database["clients"] = array(
  349. "fields" => array(
  350. "client_id" => array("type" => "varchar(20)", "not null" => "1", "primary" => "1"),
  351. "pw" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
  352. "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
  353. "name" => array("type" => "text"),
  354. "icon" => array("type" => "text"),
  355. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  356. ),
  357. "indexes" => array(
  358. "PRIMARY" => array("client_id"),
  359. )
  360. );
  361. $database["config"] = array(
  362. "fields" => array(
  363. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  364. "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  365. "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  366. "v" => array("type" => "text", "not null" => "1"),
  367. ),
  368. "indexes" => array(
  369. "PRIMARY" => array("id"),
  370. "cat_k" => array("cat(30)","k(30)"),
  371. )
  372. );
  373. $database["contact"] = array(
  374. "fields" => array(
  375. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  376. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  377. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  378. "self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  379. "remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  380. "rel" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  381. "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  382. "network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  383. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  384. "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  385. "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  386. "about" => array("type" => "text", "not null" => "1"),
  387. "keywords" => array("type" => "text", "not null" => "1"),
  388. "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  389. "attag" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  390. "photo" => array("type" => "text", "not null" => "1"),
  391. "thumb" => array("type" => "text", "not null" => "1"),
  392. "micro" => array("type" => "text", "not null" => "1"),
  393. "site-pubkey" => array("type" => "text", "not null" => "1"),
  394. "issued-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  395. "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  396. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  397. "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  398. "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  399. "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  400. "pubkey" => array("type" => "text", "not null" => "1"),
  401. "prvkey" => array("type" => "text", "not null" => "1"),
  402. "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  403. "request" => array("type" => "text", "not null" => "1"),
  404. "notify" => array("type" => "text", "not null" => "1"),
  405. "poll" => array("type" => "text", "not null" => "1"),
  406. "confirm" => array("type" => "text", "not null" => "1"),
  407. "poco" => array("type" => "text", "not null" => "1"),
  408. "aes_allow" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  409. "ret-aes" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  410. "usehub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  411. "subhub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  412. "hub-verify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  413. "last-update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  414. "success_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  415. "failure_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  416. "name-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  417. "uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  418. "avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  419. "term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  420. "last-item" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  421. "priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
  422. "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
  423. "readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  424. "writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  425. "forum" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  426. "prv" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  427. "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  428. "archive" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  429. "pending" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
  430. "rating" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  431. "reason" => array("type" => "text", "not null" => "1"),
  432. "closeness" => array("type" => "tinyint(2)", "not null" => "1", "default" => "99"),
  433. "info" => array("type" => "mediumtext", "not null" => "1"),
  434. "profile-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  435. "bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => ""),
  436. "bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"),
  437. "notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  438. "fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  439. "ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"),
  440. ),
  441. "indexes" => array(
  442. "PRIMARY" => array("id"),
  443. "uid" => array("uid"),
  444. )
  445. );
  446. $database["conv"] = array(
  447. "fields" => array(
  448. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  449. "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  450. "recips" => array("type" => "mediumtext", "not null" => "1"),
  451. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  452. "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  453. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  454. "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  455. "subject" => array("type" => "mediumtext", "not null" => "1"),
  456. ),
  457. "indexes" => array(
  458. "PRIMARY" => array("id"),
  459. "uid" => array("uid"),
  460. )
  461. );
  462. $database["deliverq"] = array(
  463. "fields" => array(
  464. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  465. "cmd" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  466. "item" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  467. "contact" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  468. ),
  469. "indexes" => array(
  470. "PRIMARY" => array("id"),
  471. )
  472. );
  473. $database["dsprphotoq"] = array(
  474. "fields" => array(
  475. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  476. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  477. "msg" => array("type" => "mediumtext", "not null" => "1"),
  478. "attempt" => array("type" => "tinyint(4)", "not null" => "1", "default" => "0"),
  479. ),
  480. "indexes" => array(
  481. "PRIMARY" => array("id"),
  482. )
  483. );
  484. $database["event"] = array(
  485. "fields" => array(
  486. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  487. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  488. "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  489. "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  490. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  491. "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  492. "start" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  493. "finish" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  494. "summary" => array("type" => "text", "not null" => "1"),
  495. "desc" => array("type" => "text", "not null" => "1"),
  496. "location" => array("type" => "text", "not null" => "1"),
  497. "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  498. "nofinish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  499. "adjust" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
  500. "ignore" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
  501. "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
  502. "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
  503. "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
  504. "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
  505. ),
  506. "indexes" => array(
  507. "PRIMARY" => array("id"),
  508. "uid" => array("uid"),
  509. )
  510. );
  511. $database["fcontact"] = array(
  512. "fields" => array(
  513. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  514. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  515. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  516. "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  517. "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  518. "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  519. "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  520. "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  521. "notify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  522. "poll" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  523. "confirm" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  524. "priority" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  525. "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  526. "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  527. "pubkey" => array("type" => "text", "not null" => "1"),
  528. "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  529. ),
  530. "indexes" => array(
  531. "PRIMARY" => array("id"),
  532. "addr" => array("addr"),
  533. )
  534. );
  535. $database["ffinder"] = array(
  536. "fields" => array(
  537. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  538. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  539. "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  540. "fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  541. ),
  542. "indexes" => array(
  543. "PRIMARY" => array("id"),
  544. )
  545. );
  546. $database["fserver"] = array(
  547. "fields" => array(
  548. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  549. "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  550. "posturl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  551. "key" => array("type" => "text", "not null" => "1"),
  552. ),
  553. "indexes" => array(
  554. "PRIMARY" => array("id"),
  555. "server" => array("server"),
  556. )
  557. );
  558. $database["fsuggest"] = array(
  559. "fields" => array(
  560. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  561. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  562. "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  563. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  564. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  565. "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  566. "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  567. "note" => array("type" => "text", "not null" => "1"),
  568. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  569. ),
  570. "indexes" => array(
  571. "PRIMARY" => array("id"),
  572. )
  573. );
  574. $database["gcign"] = array(
  575. "fields" => array(
  576. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  577. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  578. "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  579. ),
  580. "indexes" => array(
  581. "PRIMARY" => array("id"),
  582. "uid" => array("uid"),
  583. "gcid" => array("gcid"),
  584. )
  585. );
  586. $database["gcontact"] = array(
  587. "fields" => array(
  588. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  589. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  590. "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  591. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  592. "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  593. "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  594. "connect" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  595. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  596. "updated" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  597. "last_contact" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  598. "last_failure" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  599. "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  600. "about" => array("type" => "text", "not null" => "1"),
  601. "keywords" => array("type" => "text", "not null" => "1"),
  602. "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  603. "birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
  604. "community" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  605. "hide" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  606. "nsfw" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  607. "network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  608. "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  609. "notify" => array("type" => "text", "not null" => "1"),
  610. "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  611. "generation" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
  612. "server_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  613. ),
  614. "indexes" => array(
  615. "PRIMARY" => array("id"),
  616. "nurl" => array("nurl"),
  617. "updated" => array("updated"),
  618. )
  619. );
  620. $database["glink"] = array(
  621. "fields" => array(
  622. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  623. "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  624. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  625. "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  626. "zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  627. "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  628. ),
  629. "indexes" => array(
  630. "PRIMARY" => array("id"),
  631. "cid_uid_gcid_zcid" => array("cid","uid","gcid","zcid"),
  632. "gcid" => array("gcid"),
  633. "zcid" => array("zcid"),
  634. )
  635. );
  636. $database["group"] = array(
  637. "fields" => array(
  638. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  639. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  640. "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  641. "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  642. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  643. ),
  644. "indexes" => array(
  645. "PRIMARY" => array("id"),
  646. "uid" => array("uid"),
  647. )
  648. );
  649. $database["group_member"] = array(
  650. "fields" => array(
  651. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  652. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  653. "gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  654. "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  655. ),
  656. "indexes" => array(
  657. "PRIMARY" => array("id"),
  658. "uid_gid_contactid" => array("uid","gid","contact-id"),
  659. )
  660. );
  661. $database["gserver"] = array(
  662. "fields" => array(
  663. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  664. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  665. "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  666. "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  667. "site_name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  668. "info" => array("type" => "text", "not null" => "1"),
  669. "register_policy" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  670. "poco" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  671. "noscrape" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  672. "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  673. "platform" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  674. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  675. "last_poco_query" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  676. "last_contact" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  677. "last_failure" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  678. ),
  679. "indexes" => array(
  680. "PRIMARY" => array("id"),
  681. "nurl" => array("nurl"),
  682. )
  683. );
  684. $database["guid"] = array(
  685. "fields" => array(
  686. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  687. "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  688. "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  689. "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  690. "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  691. ),
  692. "indexes" => array(
  693. "PRIMARY" => array("id"),
  694. "guid" => array("guid"),
  695. "plink" => array("plink"),
  696. "uri" => array("uri"),
  697. )
  698. );
  699. $database["hook"] = array(
  700. "fields" => array(
  701. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  702. "hook" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  703. "file" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  704. "function" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  705. "priority" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
  706. ),
  707. "indexes" => array(
  708. "PRIMARY" => array("id"),
  709. "hook_file_function" => array("hook(30)","file(60)","function(30)"),
  710. )
  711. );
  712. $database["intro"] = array(
  713. "fields" => array(
  714. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  715. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  716. "fid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  717. "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  718. "knowyou" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  719. "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  720. "note" => array("type" => "text", "not null" => "1"),
  721. "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  722. "datetime" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  723. "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
  724. "ignore" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  725. ),
  726. "indexes" => array(
  727. "PRIMARY" => array("id"),
  728. )
  729. );
  730. $database["item"] = array(
  731. "fields" => array(
  732. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  733. "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  734. "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  735. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  736. "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  737. "gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
  738. "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  739. "wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  740. "gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  741. "parent" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  742. "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  743. "extid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  744. "thr-parent" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  745. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  746. "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  747. "commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  748. "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  749. "changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  750. "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  751. "owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  752. "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  753. "author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  754. "author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  755. "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  756. "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  757. "body" => array("type" => "mediumtext", "not null" => "1"),
  758. "app" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  759. "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  760. "object-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  761. "object" => array("type" => "text", "not null" => "1"),
  762. "target-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  763. "target" => array("type" => "text", "not null" => "1"),
  764. "postopts" => array("type" => "text", "not null" => "1"),
  765. "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  766. "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  767. "event-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  768. "tag" => array("type" => "mediumtext", "not null" => "1"),
  769. "attach" => array("type" => "mediumtext", "not null" => "1"),
  770. "inform" => array("type" => "mediumtext", "not null" => "1"),
  771. "file" => array("type" => "mediumtext", "not null" => "1"),
  772. "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  773. "coord" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  774. "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
  775. "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
  776. "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
  777. "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
  778. "private" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  779. "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  780. "moderated" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  781. "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  782. "spam" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  783. "starred" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  784. "bookmark" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  785. "unseen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
  786. "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  787. "origin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  788. "forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  789. "last-child" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "1"),
  790. "mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  791. "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  792. "rendered-hash" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  793. "rendered-html" => array("type" => "mediumtext", "not null" => "1"),
  794. "global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  795. ),
  796. "indexes" => array(
  797. "PRIMARY" => array("id"),
  798. "guid" => array("guid"),
  799. "uri" => array("uri"),
  800. "parent" => array("parent"),
  801. "parent-uri" => array("parent-uri"),
  802. "extid" => array("extid"),
  803. "uid_id" => array("uid","id"),
  804. "uid_created" => array("uid","created"),
  805. "uid_unseen" => array("uid","unseen"),
  806. "uid_network_received" => array("uid","network","received"),
  807. "uid_received" => array("uid","received"),
  808. "uid_network_commented" => array("uid","network","commented"),
  809. "uid_commented" => array("uid","commented"),
  810. "uid_title" => array("uid","title"),
  811. "uid_thrparent" => array("uid","thr-parent"),
  812. "uid_parenturi" => array("uid","parent-uri"),
  813. "uid_contactid_created" => array("uid","contact-id","created"),
  814. "gcontactid_uid_created" => array("gcontact-id","uid","created"),
  815. "wall_body" => array("wall","body(6)"),
  816. "uid_visible_moderated_created" => array("uid","visible","moderated","created"),
  817. "uid_uri" => array("uid","uri"),
  818. "uid_wall_created" => array("uid","wall","created"),
  819. "resource-id" => array("resource-id"),
  820. "uid_type" => array("uid","type"),
  821. "uid_starred" => array("uid","starred"),
  822. "contactid_allowcid_allowpid_denycid_denygid" => array("contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"),
  823. "uid_wall_parent_created" => array("uid","wall","parent","created"),
  824. "uid_type_changed" => array("uid","type","changed"),
  825. "contactid_verb" => array("contact-id","verb"),
  826. "deleted_changed" => array("deleted","changed"),
  827. "uid_wall_changed" => array("uid","wall","changed"),
  828. "uid_eventid" => array("uid","event-id"),
  829. "uid_authorlink" => array("uid","author-link"),
  830. "uid_ownerlink" => array("uid","owner-link"),
  831. )
  832. );
  833. $database["item_id"] = array(
  834. "fields" => array(
  835. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  836. "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  837. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  838. "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  839. "service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  840. ),
  841. "indexes" => array(
  842. "PRIMARY" => array("id"),
  843. "uid" => array("uid"),
  844. "sid" => array("sid"),
  845. "service" => array("service"),
  846. "iid" => array("iid"),
  847. )
  848. );
  849. $database["locks"] = array(
  850. "fields" => array(
  851. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  852. "name" => array("type" => "varchar(128)", "not null" => "1", "default" => ""),
  853. "locked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  854. "created" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
  855. ),
  856. "indexes" => array(
  857. "PRIMARY" => array("id"),
  858. )
  859. );
  860. $database["mail"] = array(
  861. "fields" => array(
  862. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  863. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  864. "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  865. "from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  866. "from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  867. "from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  868. "contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  869. "convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
  870. "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  871. "body" => array("type" => "mediumtext", "not null" => "1"),
  872. "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  873. "reply" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  874. "replied" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  875. "unknown" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  876. "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  877. "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  878. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  879. ),
  880. "indexes" => array(
  881. "PRIMARY" => array("id"),
  882. "uid" => array("uid"),
  883. "guid" => array("guid"),
  884. "convid" => array("convid"),
  885. "reply" => array("reply"),
  886. "uri" => array("uri"),
  887. "parent-uri" => array("parent-uri"),
  888. )
  889. );
  890. $database["mailacct"] = array(
  891. "fields" => array(
  892. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  893. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  894. "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  895. "port" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  896. "ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
  897. "mailbox" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  898. "user" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  899. "pass" => array("type" => "text", "not null" => "1"),
  900. "reply_to" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  901. "action" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  902. "movetofolder" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  903. "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  904. "last_check" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  905. ),
  906. "indexes" => array(
  907. "PRIMARY" => array("id"),
  908. )
  909. );
  910. $database["manage"] = array(
  911. "fields" => array(
  912. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  913. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  914. "mid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  915. ),
  916. "indexes" => array(
  917. "PRIMARY" => array("id"),
  918. "uid_mid" => array("uid","mid"),
  919. )
  920. );
  921. $database["notify"] = array(
  922. "fields" => array(
  923. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  924. "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  925. "type" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  926. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  927. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  928. "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  929. "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  930. "msg" => array("type" => "mediumtext", "not null" => "1"),
  931. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  932. "link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  933. "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  934. "parent" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  935. "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  936. "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  937. "otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
  938. ),
  939. "indexes" => array(
  940. "PRIMARY" => array("id"),
  941. "uid" => array("uid"),
  942. )
  943. );
  944. $database["notify-threads"] = array(
  945. "fields" => array(
  946. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  947. "notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  948. "master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  949. "parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  950. "receiver-uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  951. ),
  952. "indexes" => array(
  953. "PRIMARY" => array("id"),
  954. "master-parent-item" => array("master-parent-item"),
  955. "receiver-uid" => array("receiver-uid"),
  956. )
  957. );
  958. $database["oembed"] = array(
  959. "fields" => array(
  960. "url" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
  961. "content" => array("type" => "text", "not null" => "1"),
  962. ),
  963. "indexes" => array(
  964. "PRIMARY" => array("url"),
  965. )
  966. );
  967. $database["parsed_url"] = array(
  968. "fields" => array(
  969. "url" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
  970. "guessing" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
  971. "oembed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
  972. "content" => array("type" => "text", "not null" => "1"),
  973. ),
  974. "indexes" => array(
  975. "PRIMARY" => array("url", "guessing", "oembed"),
  976. )
  977. );
  978. $database["pconfig"] = array(
  979. "fields" => array(
  980. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  981. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  982. "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  983. "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  984. "v" => array("type" => "mediumtext", "not null" => "1"),
  985. ),
  986. "indexes" => array(
  987. "PRIMARY" => array("id"),
  988. "uid_cat_k" => array("uid","cat(30)","k(30)"),
  989. )
  990. );
  991. $database["photo"] = array(
  992. "fields" => array(
  993. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  994. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  995. "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  996. "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
  997. "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  998. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  999. "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1000. "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1001. "desc" => array("type" => "text", "not null" => "1"),
  1002. "album" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1003. "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1004. "type" => array("type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"),
  1005. "height" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
  1006. "width" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
  1007. "datasize" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1008. "data" => array("type" => "mediumblob", "not null" => "1"),
  1009. "scale" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
  1010. "profile" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1011. "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
  1012. "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
  1013. "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
  1014. "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
  1015. ),
  1016. "indexes" => array(
  1017. "PRIMARY" => array("id"),
  1018. "uid" => array("uid"),
  1019. "resource-id" => array("resource-id"),
  1020. "guid" => array("guid"),
  1021. )
  1022. );
  1023. $database["poll"] = array(
  1024. "fields" => array(
  1025. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1026. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1027. "q0" => array("type" => "mediumtext", "not null" => "1"),
  1028. "q1" => array("type" => "mediumtext", "not null" => "1"),
  1029. "q2" => array("type" => "mediumtext", "not null" => "1"),
  1030. "q3" => array("type" => "mediumtext", "not null" => "1"),
  1031. "q4" => array("type" => "mediumtext", "not null" => "1"),
  1032. "q5" => array("type" => "mediumtext", "not null" => "1"),
  1033. "q6" => array("type" => "mediumtext", "not null" => "1"),
  1034. "q7" => array("type" => "mediumtext", "not null" => "1"),
  1035. "q8" => array("type" => "mediumtext", "not null" => "1"),
  1036. "q9" => array("type" => "mediumtext", "not null" => "1"),
  1037. ),
  1038. "indexes" => array(
  1039. "PRIMARY" => array("id"),
  1040. "uid" => array("uid"),
  1041. )
  1042. );
  1043. $database["poll_result"] = array(
  1044. "fields" => array(
  1045. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1046. "poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1047. "choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1048. ),
  1049. "indexes" => array(
  1050. "PRIMARY" => array("id"),
  1051. "poll_id" => array("poll_id"),
  1052. "choice" => array("choice"),
  1053. )
  1054. );
  1055. $database["profile"] = array(
  1056. "fields" => array(
  1057. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1058. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1059. "profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1060. "is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1061. "hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1062. "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1063. "pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1064. "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
  1065. "address" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1066. "locality" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1067. "region" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1068. "postal-code" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  1069. "country-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1070. "hometown" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1071. "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  1072. "marital" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1073. "with" => array("type" => "text", "not null" => "1"),
  1074. "howlong" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1075. "sexual" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1076. "politic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1077. "religion" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1078. "pub_keywords" => array("type" => "text", "not null" => "1"),
  1079. "prv_keywords" => array("type" => "text", "not null" => "1"),
  1080. "likes" => array("type" => "text", "not null" => "1"),
  1081. "dislikes" => array("type" => "text", "not null" => "1"),
  1082. "about" => array("type" => "text", "not null" => "1"),
  1083. "summary" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1084. "music" => array("type" => "text", "not null" => "1"),
  1085. "book" => array("type" => "text", "not null" => "1"),
  1086. "tv" => array("type" => "text", "not null" => "1"),
  1087. "film" => array("type" => "text", "not null" => "1"),
  1088. "interest" => array("type" => "text", "not null" => "1"),
  1089. "romance" => array("type" => "text", "not null" => "1"),
  1090. "work" => array("type" => "text", "not null" => "1"),
  1091. "education" => array("type" => "text", "not null" => "1"),
  1092. "contact" => array("type" => "text", "not null" => "1"),
  1093. "homepage" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1094. "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1095. "thumb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1096. "publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1097. "net-publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1098. ),
  1099. "indexes" => array(
  1100. "PRIMARY" => array("id"),
  1101. "hometown" => array("hometown"),
  1102. )
  1103. );
  1104. $database["profile_check"] = array(
  1105. "fields" => array(
  1106. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1107. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1108. "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1109. "dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1110. "sec" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1111. "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1112. ),
  1113. "indexes" => array(
  1114. "PRIMARY" => array("id"),
  1115. )
  1116. );
  1117. $database["push_subscriber"] = array(
  1118. "fields" => array(
  1119. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1120. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1121. "callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1122. "topic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1123. "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1124. "push" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1125. "last_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1126. "secret" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1127. ),
  1128. "indexes" => array(
  1129. "PRIMARY" => array("id"),
  1130. )
  1131. );
  1132. $database["queue"] = array(
  1133. "fields" => array(
  1134. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1135. "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1136. "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
  1137. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1138. "last" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1139. "content" => array("type" => "mediumtext", "not null" => "1"),
  1140. "batch" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1141. ),
  1142. "indexes" => array(
  1143. "PRIMARY" => array("id"),
  1144. "cid" => array("cid"),
  1145. "created" => array("created"),
  1146. "last" => array("last"),
  1147. "network" => array("network"),
  1148. "batch" => array("batch"),
  1149. )
  1150. );
  1151. $database["register"] = array(
  1152. "fields" => array(
  1153. "id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1154. "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1155. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1156. "uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
  1157. "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1158. "language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
  1159. ),
  1160. "indexes" => array(
  1161. "PRIMARY" => array("id"),
  1162. )
  1163. );
  1164. $database["search"] = array(
  1165. "fields" => array(
  1166. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1167. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1168. "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1169. ),
  1170. "indexes" => array(
  1171. "PRIMARY" => array("id"),
  1172. "uid" => array("uid"),
  1173. "term" => array("term"),
  1174. )
  1175. );
  1176. $database["session"] = array(
  1177. "fields" => array(
  1178. "id" => array("type" => "bigint(20) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1179. "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1180. "data" => array("type" => "text", "not null" => "1"),
  1181. "expire" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1182. ),
  1183. "indexes" => array(
  1184. "PRIMARY" => array("id"),
  1185. "sid" => array("sid"),
  1186. "expire" => array("expire"),
  1187. )
  1188. );
  1189. $database["sign"] = array(
  1190. "fields" => array(
  1191. "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1192. "iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1193. "retract_iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1194. "signed_text" => array("type" => "mediumtext", "not null" => "1"),
  1195. "signature" => array("type" => "text", "not null" => "1"),
  1196. "signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1197. ),
  1198. "indexes" => array(
  1199. "PRIMARY" => array("id"),
  1200. "iid" => array("iid"),
  1201. "retract_iid" => array("retract_iid"),
  1202. )
  1203. );
  1204. $database["spam"] = array(
  1205. "fields" => array(
  1206. "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1207. "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1208. "spam" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1209. "ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
  1210. "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1211. "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1212. ),
  1213. "indexes" => array(
  1214. "PRIMARY" => array("id"),
  1215. "uid" => array("uid"),
  1216. "spam" => array("spam"),
  1217. "ham" => array("ham"),
  1218. "term" => array("term"),
  1219. )
  1220. );
  1221. $database["term"] = array(
  1222. "fields" => array(
  1223. "tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
  1224. "oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1225. "otype" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
  1226. "type" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
  1227. "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1228. "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1229. "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
  1230. "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1231. "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
  1232. "global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
  1233. "aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1234. "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
  1235. ),
  1236. "indexes" => array(
  1237. "PRIMARY" => array("tid"),
  1238. "oid_otype_type_term" => array("oid","otype","type","term"),
  1239. "uid_term_tid" => array("uid","term","tid"),
  1240. "type_term" => array("type","term"),
  1241. "uid_otype_type_term_global_created" => array("uid","otype","type","term","global","created"),
  1242. "otype_type_term_tid" => array