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.

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