2 require_once("boot.php");
3 require_once("include/text.php");
5 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
8 * send the email and do what is needed to do on update fails
10 * @param update_id (int) number of failed update
11 * @param error_message (str) error message
13 function update_fail($update_id, $error_message){
14 //send the administrators an e-mail
15 $admin_mail_list = "'".implode("','", array_map(dbesc, explode(",", str_replace(" ", "", $a->config['admin_email']))))."'";
16 $adminlist = q("SELECT uid, language, email FROM user WHERE email IN (%s)",
20 // every admin could had different language
22 foreach ($adminlist as $admin) {
23 $lang = (($admin['language'])?$admin['language']:'en');
26 $preamble = deindent(t("
27 The friendica developers released update %s recently,
28 but when I tried to install it, something went terribly wrong.
29 This needs to be fixed soon and I can't do it alone. Please contact a
30 friendica developer if you can not help me on your own. My database might be invalid."));
31 $body = t("The error message is\n[pre]%s[/pre]");
32 $preamble = sprintf($preamble, $update_id);
33 $body = sprintf($body, $error_message);
36 'type' => "SYSTEM_EMAIL",
37 'to_email' => $admin['email'],
38 'preamble' => $preamble,
48 $email_tpl = get_intltext_template("update_fail_eml.tpl");
49 $email_msg = replace_macros($email_tpl, array(
50 '$sitename' => $a->config['sitename'],
51 '$siteurl' => $a->get_baseurl(),
52 '$update' => DB_UPDATE_VERSION,
53 '$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
55 $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
56 require_once('include/email.php');
57 $subject = email_header_encode($subject,'UTF-8');
58 mail($a->config['admin_email'], $subject, $email_msg,
59 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME']."\n"
60 .'Content-type: text/plain; charset=UTF-8'."\n"
61 .'Content-transfer-encoding: 8bit');
64 logger("CRITICAL: Database structure update failed: ".$retval);
68 function table_structure($table) {
69 $structures = q("DESCRIBE `%s`", $table);
71 $indexes = q("SHOW INDEX FROM `%s`", $table);
76 if (is_array($indexes))
77 foreach ($indexes AS $index) {
78 if ($index["Index_type"] == "FULLTEXT")
81 $column = $index["Column_name"];
82 if ($index["Sub_part"] != "")
83 $column .= "(".$index["Sub_part"].")";
85 $indexdata[$index["Key_name"]][] = $column;
88 if (is_array($structures)) {
89 foreach($structures AS $field) {
90 $fielddata[$field["Field"]]["type"] = $field["Type"];
91 if ($field["Null"] == "NO")
92 $fielddata[$field["Field"]]["not null"] = true;
94 if (isset($field["Default"]))
95 $fielddata[$field["Field"]]["default"] = $field["Default"];
97 if ($field["Extra"] != "")
98 $fielddata[$field["Field"]]["extra"] = $field["Extra"];
100 if ($field["Key"] == "PRI")
101 $fielddata[$field["Field"]]["primary"] = true;
104 return(array("fields"=>$fielddata, "indexes"=>$indexdata));
107 function print_structure($database) {
108 echo "-- ------------------------------------------\n";
109 echo "-- ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION." (".FRIENDICA_CODENAME,")\n";
110 echo "-- DB_UPDATE_VERSION ".DB_UPDATE_VERSION."\n";
111 echo "-- ------------------------------------------\n\n\n";
112 foreach ($database AS $name => $structure) {
114 echo "-- TABLE $name\n";
116 db_create_table($name, $structure['fields'], true, false, $structure["indexes"]);
122 function update_structure($verbose, $action, $tables=null, $definition=null) {
127 logger('updating structure', LOGGER_DEBUG);
129 // Get the current structure
132 if (is_null($tables))
133 $tables = q("show tables");
135 foreach ($tables AS $table) {
136 $table = current($table);
138 $database[$table] = table_structure($table);
141 // Get the definition
142 if (is_null($definition))
143 $definition = db_definition();
147 foreach ($definition AS $name => $structure) {
148 $is_new_table = False;
150 if (!isset($database[$name])) {
151 $r = db_create_table($name, $structure["fields"], $verbose, $action, $structure['indexes']);
153 $errors .= t('Errors encountered creating database tables.').$name.EOL;
155 $is_new_table = True;
157 // Drop the index if it isn't present in the definition
158 // or the definition differ from current status
159 // and index name doesn't start with "local_"
160 foreach ($database[$name]["indexes"] AS $indexname => $fieldnames) {
161 $current_index_definition = implode(",",$fieldnames);
162 if (isset($structure["indexes"][$indexname])) {
163 $new_index_definition = implode(",",$structure["indexes"][$indexname]);
165 $new_index_definition = "__NOT_SET__";
167 if ($current_index_definition != $new_index_definition && substr($indexname, 0, 6) != 'local_') {
168 $sql2=db_drop_index($indexname);
170 $sql3 = "ALTER TABLE `".$name."` ".$sql2;
175 // Compare the field structure field by field
176 foreach ($structure["fields"] AS $fieldname => $parameters) {
177 if (!isset($database[$name]["fields"][$fieldname])) {
178 $sql2=db_add_table_field($fieldname, $parameters);
180 $sql3 = "ALTER TABLE `".$name."` ".$sql2;
184 // Compare the field definition
185 $current_field_definition = implode(",",$database[$name]["fields"][$fieldname]);
186 $new_field_definition = implode(",",$parameters);
187 if ($current_field_definition != $new_field_definition) {
188 $sql2=db_modify_table_field($fieldname, $parameters);
190 $sql3 = "ALTER TABLE `".$name."` ".$sql2;
199 // Create the index if the index don't exists in database
200 // or the definition differ from the current status.
201 // Don't create keys if table is new
202 if (!$is_new_table) {
203 foreach ($structure["indexes"] AS $indexname => $fieldnames) {
204 if (isset($database[$name]["indexes"][$indexname])) {
205 $current_index_definition = implode(",",$database[$name]["indexes"][$indexname]);
207 $current_index_definition = "__NOT_SET__";
209 $new_index_definition = implode(",",$fieldnames);
210 if ($current_index_definition != $new_index_definition) {
211 $sql2=db_create_index($indexname, $fieldnames);
214 $sql3 = "ALTER TABLE `".$name."` ".$sql2;
230 $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
238 function db_field_command($parameters, $create = true) {
239 $fieldstruct = $parameters["type"];
241 if ($parameters["not null"])
242 $fieldstruct .= " NOT NULL";
244 if (isset($parameters["default"])){
245 if (strpos(strtolower($parameters["type"]),"int")!==false) {
246 $fieldstruct .= " DEFAULT ".$parameters["default"];
248 $fieldstruct .= " DEFAULT '".$parameters["default"]."'";
251 if ($parameters["extra"] != "")
252 $fieldstruct .= " ".$parameters["extra"];
254 /*if (($parameters["primary"] != "") AND $create)
255 $fieldstruct .= " PRIMARY KEY";*/
257 return($fieldstruct);
260 function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
268 $primary_keys = array();
269 foreach($fields AS $fieldname => $field) {
270 $sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field);
271 if (x($field,'primary') and $field['primary']!=''){
272 $primary_keys[] = $fieldname;
276 if (!is_null($indexes)) {
277 foreach ($indexes AS $indexname => $fieldnames) {
278 $sql_index = db_create_index($indexname, $fieldnames, "");
279 if (!is_null($sql_index)) $sql_rows[] = $sql_index;
283 $sql = implode(",\n\t", $sql_rows);
285 $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT CHARSET=utf8";
295 function db_add_table_field($fieldname, $parameters) {
296 $sql = sprintf("ADD `%s` %s", dbesc($fieldname), db_field_command($parameters));
300 function db_modify_table_field($fieldname, $parameters) {
301 $sql = sprintf("MODIFY `%s` %s", dbesc($fieldname), db_field_command($parameters, false));
305 function db_drop_index($indexname) {
306 $sql = sprintf("DROP INDEX `%s`", dbesc($indexname));
310 function db_create_index($indexname, $fieldnames, $method="ADD") {
312 $method = strtoupper(trim($method));
313 if ($method!="" && $method!="ADD") {
314 throw new Exception("Invalid parameter 'method' in db_create_index(): '$method'");
319 if ($indexname == "PRIMARY") {
320 return sprintf("%s PRIMARY KEY(`%s`)", $method, implode("`,`", $fieldnames));
324 foreach ($fieldnames AS $fieldname) {
328 if (preg_match('|(.+)\((\d+)\)|', $fieldname, $matches))
329 $names .= "`".dbesc($matches[1])."`(".intval($matches[2]).")";
331 $names .= "`".dbesc($fieldname)."`";
335 $sql = sprintf("%s INDEX `%s` (%s)", $method, dbesc($indexname), $names);
339 function db_definition() {
343 $database["addon"] = array(
345 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
346 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
347 "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
348 "installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
349 "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
350 "timestamp" => array("type" => "bigint(20)", "not null" => "1", "default" => "0"),
351 "plugin_admin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
354 "PRIMARY" => array("id"),
357 $database["attach"] = array(
359 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
360 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
361 "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
362 "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
363 "filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
364 "filesize" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
365 "data" => array("type" => "longblob", "not null" => "1"),
366 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
367 "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
368 "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
369 "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
370 "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
371 "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
374 "PRIMARY" => array("id"),
377 $database["auth_codes"] = array(
379 "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
380 "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
381 "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
382 "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
383 "scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""),
386 "PRIMARY" => array("id"),
389 $database["cache"] = array(
391 "k" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
392 "v" => array("type" => "text", "not null" => "1"),
393 "expire_mode" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
394 "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
397 "PRIMARY" => array("k"),
398 "updated" => array("updated"),
401 $database["challenge"] = array(
403 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
404 "challenge" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
405 "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
406 "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
407 "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
408 "last_update" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
411 "PRIMARY" => array("id"),
414 $database["clients"] = array(
416 "client_id" => array("type" => "varchar(20)", "not null" => "1", "primary" => "1"),
417 "pw" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
418 "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
419 "name" => array("type" => "text"),
420 "icon" => array("type" => "text"),
421 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
424 "PRIMARY" => array("client_id"),
427 $database["config"] = array(
429 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
430 "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
431 "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
432 "v" => array("type" => "text", "not null" => "1"),
435 "PRIMARY" => array("id"),
436 "cat_k" => array("cat(30)","k(30)"),
439 $database["contact"] = array(
441 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
442 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
443 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
444 "self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
445 "remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
446 "rel" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
447 "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
448 "network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
449 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
450 "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
451 "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
452 "about" => array("type" => "text", "not null" => "1"),
453 "keywords" => array("type" => "text", "not null" => "1"),
454 "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
455 "attag" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
456 "photo" => array("type" => "text", "not null" => "1"),
457 "thumb" => array("type" => "text", "not null" => "1"),
458 "micro" => array("type" => "text", "not null" => "1"),
459 "site-pubkey" => array("type" => "text", "not null" => "1"),
460 "issued-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
461 "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
462 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
463 "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
464 "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
465 "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
466 "pubkey" => array("type" => "text", "not null" => "1"),
467 "prvkey" => array("type" => "text", "not null" => "1"),
468 "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
469 "request" => array("type" => "text", "not null" => "1"),
470 "notify" => array("type" => "text", "not null" => "1"),
471 "poll" => array("type" => "text", "not null" => "1"),
472 "confirm" => array("type" => "text", "not null" => "1"),
473 "poco" => array("type" => "text", "not null" => "1"),
474 "aes_allow" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
475 "ret-aes" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
476 "usehub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
477 "subhub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
478 "hub-verify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
479 "last-update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
480 "success_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
481 "failure_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
482 "name-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
483 "uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
484 "avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
485 "term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
486 "last-item" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
487 "priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
488 "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
489 "readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
490 "writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
491 "forum" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
492 "prv" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
493 "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
494 "archive" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
495 "pending" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
496 "rating" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
497 "reason" => array("type" => "text", "not null" => "1"),
498 "closeness" => array("type" => "tinyint(2)", "not null" => "1", "default" => "99"),
499 "info" => array("type" => "mediumtext", "not null" => "1"),
500 "profile-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
501 "bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => ""),
502 "bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"),
503 "notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
504 "fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
505 "ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"),
508 "PRIMARY" => array("id"),
509 "uid" => array("uid"),
512 $database["conv"] = array(
514 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
515 "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
516 "recips" => array("type" => "mediumtext", "not null" => "1"),
517 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
518 "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
519 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
520 "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
521 "subject" => array("type" => "mediumtext", "not null" => "1"),
524 "PRIMARY" => array("id"),
525 "uid" => array("uid"),
528 $database["deliverq"] = array(
530 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
531 "cmd" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
532 "item" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
533 "contact" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
536 "PRIMARY" => array("id"),
539 $database["dsprphotoq"] = array(
541 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
542 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
543 "msg" => array("type" => "mediumtext", "not null" => "1"),
544 "attempt" => array("type" => "tinyint(4)", "not null" => "1", "default" => "0"),
547 "PRIMARY" => array("id"),
550 $database["event"] = array(
552 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
553 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
554 "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
555 "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
556 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
557 "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
558 "start" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
559 "finish" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
560 "summary" => array("type" => "text", "not null" => "1"),
561 "desc" => array("type" => "text", "not null" => "1"),
562 "location" => array("type" => "text", "not null" => "1"),
563 "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
564 "nofinish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
565 "adjust" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
566 "ignore" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
567 "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
568 "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
569 "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
570 "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
573 "PRIMARY" => array("id"),
574 "uid" => array("uid"),
577 $database["fcontact"] = array(
579 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
580 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
581 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
582 "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
583 "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
584 "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
585 "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
586 "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
587 "notify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
588 "poll" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
589 "confirm" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
590 "priority" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
591 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
592 "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
593 "pubkey" => array("type" => "text", "not null" => "1"),
594 "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
597 "PRIMARY" => array("id"),
598 "addr" => array("addr"),
601 $database["ffinder"] = array(
603 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
604 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
605 "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
606 "fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
609 "PRIMARY" => array("id"),
612 $database["fserver"] = array(
614 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
615 "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
616 "posturl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
617 "key" => array("type" => "text", "not null" => "1"),
620 "PRIMARY" => array("id"),
621 "server" => array("server"),
624 $database["fsuggest"] = array(
626 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
627 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
628 "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
629 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
630 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
631 "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
632 "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
633 "note" => array("type" => "text", "not null" => "1"),
634 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
637 "PRIMARY" => array("id"),
640 $database["gcign"] = array(
642 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
643 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
644 "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
647 "PRIMARY" => array("id"),
648 "uid" => array("uid"),
649 "gcid" => array("gcid"),
652 $database["gcontact"] = array(
654 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
655 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
656 "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
657 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
658 "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
659 "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
660 "connect" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
661 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
662 "updated" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
663 "last_contact" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
664 "last_failure" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
665 "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
666 "about" => array("type" => "text", "not null" => "1"),
667 "keywords" => array("type" => "text", "not null" => "1"),
668 "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
669 "birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
670 "community" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
671 "hide" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
672 "nsfw" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
673 "network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
674 "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
675 "notify" => array("type" => "text", "not null" => "1"),
676 "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
677 "generation" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
678 "server_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
681 "PRIMARY" => array("id"),
682 "nurl" => array("nurl"),
683 "updated" => array("updated"),
686 $database["glink"] = array(
688 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
689 "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
690 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
691 "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
692 "zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
693 "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
696 "PRIMARY" => array("id"),
697 "cid_uid_gcid_zcid" => array("cid","uid","gcid","zcid"),
698 "gcid" => array("gcid"),
699 "zcid" => array("zcid"),
702 $database["group"] = array(
704 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
705 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
706 "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
707 "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
708 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
711 "PRIMARY" => array("id"),
712 "uid" => array("uid"),
715 $database["group_member"] = array(
717 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
718 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
719 "gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
720 "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
723 "PRIMARY" => array("id"),
724 "uid_gid_contactid" => array("uid","gid","contact-id"),
727 $database["gserver"] = array(
729 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
730 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
731 "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
732 "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
733 "site_name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
734 "info" => array("type" => "text", "not null" => "1"),
735 "register_policy" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
736 "poco" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
737 "noscrape" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
738 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
739 "platform" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
740 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
741 "last_poco_query" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
742 "last_contact" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
743 "last_failure" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
746 "PRIMARY" => array("id"),
747 "nurl" => array("nurl"),
750 $database["guid"] = array(
752 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
753 "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
754 "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
755 "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
756 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
759 "PRIMARY" => array("id"),
760 "guid" => array("guid"),
761 "plink" => array("plink"),
762 "uri" => array("uri"),
765 $database["hook"] = array(
767 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
768 "hook" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
769 "file" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
770 "function" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
771 "priority" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
774 "PRIMARY" => array("id"),
775 "hook_file_function" => array("hook(30)","file(60)","function(30)"),
778 $database["intro"] = array(
780 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
781 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
782 "fid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
783 "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
784 "knowyou" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
785 "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
786 "note" => array("type" => "text", "not null" => "1"),
787 "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
788 "datetime" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
789 "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
790 "ignore" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
793 "PRIMARY" => array("id"),
796 $database["item"] = array(
798 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
799 "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
800 "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
801 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
802 "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
803 "gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
804 "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
805 "wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
806 "gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
807 "parent" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
808 "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
809 "extid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
810 "thr-parent" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
811 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
812 "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
813 "commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
814 "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
815 "changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
816 "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
817 "owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
818 "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
819 "author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
820 "author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
821 "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
822 "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
823 "body" => array("type" => "mediumtext", "not null" => "1"),
824 "app" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
825 "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
826 "object-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
827 "object" => array("type" => "text", "not null" => "1"),
828 "target-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
829 "target" => array("type" => "text", "not null" => "1"),
830 "postopts" => array("type" => "text", "not null" => "1"),
831 "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
832 "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
833 "event-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
834 "tag" => array("type" => "mediumtext", "not null" => "1"),
835 "attach" => array("type" => "mediumtext", "not null" => "1"),
836 "inform" => array("type" => "mediumtext", "not null" => "1"),
837 "file" => array("type" => "mediumtext", "not null" => "1"),
838 "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
839 "coord" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
840 "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
841 "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
842 "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
843 "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
844 "private" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
845 "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
846 "moderated" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
847 "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
848 "spam" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
849 "starred" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
850 "bookmark" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
851 "unseen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
852 "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
853 "origin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
854 "forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
855 "last-child" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "1"),
856 "mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
857 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
858 "rendered-hash" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
859 "rendered-html" => array("type" => "mediumtext", "not null" => "1"),
860 "global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
863 "PRIMARY" => array("id"),
864 "guid" => array("guid"),
865 "uri" => array("uri"),
866 "parent" => array("parent"),
867 "parent-uri" => array("parent-uri"),
868 "extid" => array("extid"),
869 "uid_id" => array("uid","id"),
870 "uid_created" => array("uid","created"),
871 "uid_unseen" => array("uid","unseen"),
872 "uid_network_received" => array("uid","network","received"),
873 "uid_received" => array("uid","received"),
874 "uid_network_commented" => array("uid","network","commented"),
875 "uid_commented" => array("uid","commented"),
876 "uid_title" => array("uid","title"),
877 "uid_thrparent" => array("uid","thr-parent"),
878 "uid_parenturi" => array("uid","parent-uri"),
879 "uid_contactid_created" => array("uid","contact-id","created"),
880 "gcontactid_uid_created" => array("gcontact-id","uid","created"),
881 "wall_body" => array("wall","body(6)"),
882 "uid_visible_moderated_created" => array("uid","visible","moderated","created"),
883 "uid_uri" => array("uid","uri"),
884 "uid_wall_created" => array("uid","wall","created"),
885 "resource-id" => array("resource-id"),
886 "uid_type" => array("uid","type"),
887 "uid_starred" => array("uid","starred"),
888 "contactid_allowcid_allowpid_denycid_denygid" => array("contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"),
889 "uid_wall_parent_created" => array("uid","wall","parent","created"),
890 "uid_type_changed" => array("uid","type","changed"),
891 "contactid_verb" => array("contact-id","verb"),
892 "deleted_changed" => array("deleted","changed"),
893 "uid_wall_changed" => array("uid","wall","changed"),
894 "uid_eventid" => array("uid","event-id"),
895 "uid_authorlink" => array("uid","author-link"),
896 "uid_ownerlink" => array("uid","owner-link"),
899 $database["item_id"] = array(
901 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
902 "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
903 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
904 "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
905 "service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
908 "PRIMARY" => array("id"),
909 "uid" => array("uid"),
910 "sid" => array("sid"),
911 "service" => array("service"),
912 "iid" => array("iid"),
915 $database["locks"] = array(
917 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
918 "name" => array("type" => "varchar(128)", "not null" => "1", "default" => ""),
919 "locked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
920 "created" => array("type" => "datetime", "default" => "0000-00-00 00:00:00"),
923 "PRIMARY" => array("id"),
926 $database["mail"] = array(
928 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
929 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
930 "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
931 "from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
932 "from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
933 "from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
934 "contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
935 "convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
936 "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
937 "body" => array("type" => "mediumtext", "not null" => "1"),
938 "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
939 "reply" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
940 "replied" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
941 "unknown" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
942 "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
943 "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
944 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
947 "PRIMARY" => array("id"),
948 "uid" => array("uid"),
949 "guid" => array("guid"),
950 "convid" => array("convid"),
951 "reply" => array("reply"),
952 "uri" => array("uri"),
953 "parent-uri" => array("parent-uri"),
956 $database["mailacct"] = array(
958 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
959 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
960 "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
961 "port" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
962 "ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
963 "mailbox" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
964 "user" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
965 "pass" => array("type" => "text", "not null" => "1"),
966 "reply_to" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
967 "action" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
968 "movetofolder" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
969 "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
970 "last_check" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
973 "PRIMARY" => array("id"),
976 $database["manage"] = array(
978 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
979 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
980 "mid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
983 "PRIMARY" => array("id"),
984 "uid_mid" => array("uid","mid"),
987 $database["notify"] = array(
989 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
990 "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
991 "type" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
992 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
993 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
994 "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
995 "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
996 "msg" => array("type" => "mediumtext", "not null" => "1"),
997 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
998 "link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
999 "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1000 "parent" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1001 "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1002 "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1003 "otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
1006 "PRIMARY" => array("id"),
1007 "uid" => array("uid"),
1010 $database["notify-threads"] = array(
1012 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1013 "notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1014 "master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1015 "parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1016 "receiver-uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1019 "PRIMARY" => array("id"),
1020 "master-parent-item" => array("master-parent-item"),
1021 "receiver-uid" => array("receiver-uid"),
1024 $database["oembed"] = array(
1026 "url" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
1027 "content" => array("type" => "text", "not null" => "1"),
1030 "PRIMARY" => array("url"),
1033 $database["parsed_url"] = array(
1035 "url" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
1036 "guessing" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
1037 "oembed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
1038 "content" => array("type" => "text", "not null" => "1"),
1041 "PRIMARY" => array("url", "guessing", "oembed"),
1044 $database["pconfig"] = array(
1046 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1047 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1048 "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1049 "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1050 "v" => array("type" => "mediumtext", "not null" => "1"),
1053 "PRIMARY" => array("id"),
1054 "uid_cat_k" => array("uid","cat(30)","k(30)"),
1057 $database["photo"] = array(
1059 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1060 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1061 "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1062 "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
1063 "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1064 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1065 "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1066 "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1067 "desc" => array("type" => "text", "not null" => "1"),
1068 "album" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1069 "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1070 "type" => array("type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"),
1071 "height" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
1072 "width" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
1073 "datasize" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1074 "data" => array("type" => "mediumblob", "not null" => "1"),
1075 "scale" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
1076 "profile" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1077 "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
1078 "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
1079 "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
1080 "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
1083 "PRIMARY" => array("id"),
1084 "uid" => array("uid"),
1085 "resource-id" => array("resource-id"),
1086 "guid" => array("guid"),
1089 $database["poll"] = array(
1091 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1092 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1093 "q0" => array("type" => "mediumtext", "not null" => "1"),
1094 "q1" => array("type" => "mediumtext", "not null" => "1"),
1095 "q2" => array("type" => "mediumtext", "not null" => "1"),
1096 "q3" => array("type" => "mediumtext", "not null" => "1"),
1097 "q4" => array("type" => "mediumtext", "not null" => "1"),
1098 "q5" => array("type" => "mediumtext", "not null" => "1"),
1099 "q6" => array("type" => "mediumtext", "not null" => "1"),
1100 "q7" => array("type" => "mediumtext", "not null" => "1"),
1101 "q8" => array("type" => "mediumtext", "not null" => "1"),
1102 "q9" => array("type" => "mediumtext", "not null" => "1"),
1105 "PRIMARY" => array("id"),
1106 "uid" => array("uid"),
1109 $database["poll_result"] = array(
1111 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1112 "poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1113 "choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1116 "PRIMARY" => array("id"),
1117 "poll_id" => array("poll_id"),
1118 "choice" => array("choice"),
1121 $database["profile"] = array(
1123 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1124 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1125 "profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1126 "is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1127 "hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1128 "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1129 "pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1130 "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
1131 "address" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1132 "locality" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1133 "region" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1134 "postal-code" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
1135 "country-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1136 "hometown" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1137 "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
1138 "marital" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1139 "with" => array("type" => "text", "not null" => "1"),
1140 "howlong" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1141 "sexual" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1142 "politic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1143 "religion" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1144 "pub_keywords" => array("type" => "text", "not null" => "1"),
1145 "prv_keywords" => array("type" => "text", "not null" => "1"),
1146 "likes" => array("type" => "text", "not null" => "1"),
1147 "dislikes" => array("type" => "text", "not null" => "1"),
1148 "about" => array("type" => "text", "not null" => "1"),
1149 "summary" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1150 "music" => array("type" => "text", "not null" => "1"),
1151 "book" => array("type" => "text", "not null" => "1"),
1152 "tv" => array("type" => "text", "not null" => "1"),
1153 "film" => array("type" => "text", "not null" => "1"),
1154 "interest" => array("type" => "text", "not null" => "1"),
1155 "romance" => array("type" => "text", "not null" => "1"),
1156 "work" => array("type" => "text", "not null" => "1"),
1157 "education" => array("type" => "text", "not null" => "1"),
1158 "contact" => array("type" => "text", "not null" => "1"),
1159 "homepage" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1160 "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1161 "thumb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1162 "publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1163 "net-publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1166 "PRIMARY" => array("id"),
1167 "hometown" => array("hometown"),
1170 $database["profile_check"] = array(
1172 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1173 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1174 "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1175 "dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1176 "sec" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1177 "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1180 "PRIMARY" => array("id"),
1183 $database["push_subscriber"] = array(
1185 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1186 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1187 "callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1188 "topic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1189 "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1190 "push" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1191 "last_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1192 "secret" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1195 "PRIMARY" => array("id"),
1198 $database["queue"] = array(
1200 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1201 "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1202 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
1203 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1204 "last" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1205 "content" => array("type" => "mediumtext", "not null" => "1"),
1206 "batch" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1209 "PRIMARY" => array("id"),
1210 "cid" => array("cid"),
1211 "created" => array("created"),
1212 "last" => array("last"),
1213 "network" => array("network"),
1214 "batch" => array("batch"),
1217 $database["register"] = array(
1219 "id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1220 "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1221 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1222 "uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
1223 "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1224 "language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
1227 "PRIMARY" => array("id"),
1230 $database["search"] = array(
1232 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1233 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1234 "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1237 "PRIMARY" => array("id"),
1238 "uid" => array("uid"),
1239 "term" => array("term"),
1242 $database["session"] = array(
1244 "id" => array("type" => "bigint(20) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1245 "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1246 "data" => array("type" => "text", "not null" => "1"),
1247 "expire" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1250 "PRIMARY" => array("id"),
1251 "sid" => array("sid"),
1252 "expire" => array("expire"),
1255 $database["sign"] = array(
1257 "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1258 "iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1259 "retract_iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1260 "signed_text" => array("type" => "mediumtext", "not null" => "1"),
1261 "signature" => array("type" => "text", "not null" => "1"),
1262 "signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1265 "PRIMARY" => array("id"),
1266 "iid" => array("iid"),
1267 "retract_iid" => array("retract_iid"),
1270 $database["spam"] = array(
1272 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1273 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1274 "spam" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1275 "ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1276 "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1277 "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1280 "PRIMARY" => array("id"),
1281 "uid" => array("uid"),
1282 "spam" => array("spam"),
1283 "ham" => array("ham"),
1284 "term" => array("term"),
1287 $database["term"] = array(
1289 "tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1290 "oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1291 "otype" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
1292 "type" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
1293 "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1294 "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1295 "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1296 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1297 "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1298 "global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1299 "aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1300 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1303 "PRIMARY" => array("tid"),
1304 "oid_otype_type_term" => array("oid","otype","type","term"),
1305 "uid_term_tid" => array("uid","term","tid"),
1306 "type_term" => array("type","term"),
1307 "uid_otype_type_term_global_created" => array("uid","otype","type","term","global","created"),
1308 "otype_type_term_tid" => array("otype","type","term","tid"),
1309 "guid" => array("guid"),
1312 $database["thread"] = array(
1314 "iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "primary" => "1"),
1315 "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
1316 "contact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
1317 "gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
1318 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1319 "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1320 "commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1321 "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1322 "changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1323 "wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1324 "private" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1325 "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1326 "moderated" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1327 "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1328 "spam" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1329 "starred" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1330 "ignored" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1331 "bookmark" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1332 "unseen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
1333 "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1334 "origin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1335 "forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1336 "mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1337 "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
1340 "PRIMARY" => array("iid"),
1341 "created" => array("created"),
1342 "commented" => array("commented"),
1343 "uid_network_commented" => array("uid","network","commented"),
1344 "uid_network_created" => array("uid","network","created"),
1345 "uid_contactid_commented" => array("uid","contact-id","commented"),
1346 "uid_contactid_created" => array("uid","contact-id","created"),
1347 "uid_gcontactid_commented" => array("uid","gcontact-id","commented"),
1348 "uid_gcontactid_created" => array("uid","gcontact-id","created"),
1349 "wall_private_received" => array("wall","private","received"),
1350 "uid_created" => array("uid","created"),
1351 "uid_commented" => array("uid","commented"),
1354 $database["tokens"] = array(
1356 "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
1357 "secret" => array("type" => "text", "not null" => "1"),
1358 "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
1359 "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1360 "scope" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
1361 "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1364 "PRIMARY" => array("id"),
1367 $database["user"] = array(
1369 "uid" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1370 "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
1371 "username" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1372 "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1373 "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1374 "email" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1375 "openid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1376 "timezone" => array("type" => "varchar(128)", "not null" => "1", "default" => ""),
1377 "language" => array("type" => "varchar(32)", "not null" => "1", "default" => "en"),
1378 "register_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1379 "login_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1380 "default-location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1381 "allow_location" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1382 "theme" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1383 "pubkey" => array("type" => "text", "not null" => "1"),
1384 "prvkey" => array("type" => "text", "not null" => "1"),
1385 "spubkey" => array("type" => "text", "not null" => "1"),
1386 "sprvkey" => array("type" => "text", "not null" => "1"),
1387 "verified" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
1388 "blocked" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
1389 "blockwall" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
1390 "hidewall" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
1391 "blocktags" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
1392 "unkmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1393 "cntunkmail" => array("type" => "int(11)", "not null" => "1", "default" => "10"),
1394 "notify-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "65535"),
1395 "page-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
1396 "prvnets" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1397 "pwdreset" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
1398 "maxreq" => array("type" => "int(11)", "not null" => "1", "default" => "10"),
1399 "expire" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
1400 "account_removed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1401 "account_expired" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
1402 "account_expires_on" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1403 "expire_notification_sent" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1404 "service_class" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
1405 "def_gid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1406 "allow_cid" => array("type" => "mediumtext", "not null" => "1"),
1407 "allow_gid" => array("type" => "mediumtext", "not null" => "1"),
1408 "deny_cid" => array("type" => "mediumtext", "not null" => "1"),
1409 "deny_gid" => array("type" => "mediumtext", "not null" => "1"),
1410 "openidserver" => array("type" => "text", "not null" => "1"),
1413 "PRIMARY" => array("uid"),
1414 "nickname" => array("nickname"),
1417 $database["userd"] = array(
1419 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1420 "username" => array("type" => "varchar(255)", "not null" => "1"),
1423 "PRIMARY" => array("id"),
1424 "username" => array("username"),
1427 $database["workerqueue"] = array(
1429 "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
1430 "parameter" => array("type" => "text", "not null" => "1"),
1431 "priority" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
1432 "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1433 "pid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
1434 "executed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
1437 "PRIMARY" => array("id"),
1438 "created" => array("created"),
1447 * run from command line
1449 function dbstructure_run(&$argv, &$argc) {
1457 @include(".htconfig.php");
1458 require_once("include/dba.php");
1459 $db = new dba($db_host, $db_user, $db_pass, $db_data);
1460 unset($db_host, $db_user, $db_pass, $db_data);
1466 update_structure(true, true);
1469 print_structure(db_definition());
1476 echo $argv[0]." <command>\n";
1479 echo "update update database schema\n";
1480 echo "dumpsql dump database schema\n";
1488 if (array_search(__file__,get_included_files())===0){
1489 dbstructure_run($_SERVER["argv"],$_SERVER["argc"]);