function update_structure($verbose, $action, $tables=null, $definition=null) {
global $a, $db;
+ if ($action)
+ set_config('system', 'maintenance', 1);
+
if (isset($a->config["system"]["db_charset"]))
$charset = $a->config["system"]["db_charset"];
else
}
}
+ if ($action)
+ set_config('system', 'maintenance', 0);
+
return $errors;
}
"gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
"community" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
+ "contact-type" => array("type" => "tinyint(1)", "not null" => "1", "default" => "-1"),
"hide" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"nsfw" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
switch ($argv[1]) {
case "update":
update_structure(true, true);
+
+ $build = get_config('system','build');
+ if (!x($build)) {
+ set_config('system','build',DB_UPDATE_VERSION);
+ $build = DB_UPDATE_VERSION;
+ }
+
+ $stored = intval($build);
+ $current = intval(DB_UPDATE_VERSION);
+
+ // run any left update_nnnn functions in update.php
+ for($x = $stored; $x < $current; $x ++) {
+ $r = run_update_function($x);
+ if (!$r) break;
+ }
+
set_config('system','build',DB_UPDATE_VERSION);
return;
case "dumpsql":