Merge pull request #1221 from annando/1411-default-value-type

Fix: "not null" fields were not set
This commit is contained in:
fabrixxm 2014-11-10 09:57:42 +01:00
commit fd61391e3e
6 changed files with 274 additions and 266 deletions

View File

@ -18,7 +18,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Ginger');
define ( 'FRIENDICA_VERSION', '3.3.1' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1174 );
define ( 'DB_UPDATE_VERSION', 1175 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View File

@ -92,7 +92,7 @@ function table_structure($table) {
if ($field["Null"] == "NO")
$fielddata[$field["Field"]]["not null"] = true;
if ($field["Default"] != "")
if (isset($field["Default"]))
$fielddata[$field["Field"]]["default"] = $field["Default"];
if ($field["Extra"] != "")
@ -102,7 +102,6 @@ function table_structure($table) {
$fielddata[$field["Field"]]["primary"] = true;
}
}
return(array("fields"=>$fielddata, "indexes"=>$indexdata));
}
@ -182,8 +181,8 @@ function update_structure($verbose, $action) {
$sql3 .= ", ".$sql2;
} else {
// Compare the field definition
$current_field_definition = implode($database[$name]["fields"][$fieldname]);
$new_field_definition = implode($parameters);
$current_field_definition = implode(",",$database[$name]["fields"][$fieldname]);
$new_field_definition = implode(",",$parameters);
if ($current_field_definition != $new_field_definition) {
$sql2=db_modify_table_field($fieldname, $parameters);
if ($sql3 == "")
@ -232,7 +231,7 @@ function db_field_command($parameters, $create = true) {
if ($parameters["not null"])
$fieldstruct .= " NOT NULL";
if ($parameters["default"] != "")
if (isset($parameters["default"]))
$fieldstruct .= " DEFAULT '".$parameters["default"]."'";
if ($parameters["extra"] != "")
@ -310,8 +309,8 @@ function db_definition() {
$database["addon"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"version" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"timestamp" => array("type" => "bigint(20)", "not null" => "1", "default" => "0"),
@ -324,11 +323,11 @@ function db_definition() {
$database["attach"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"hash" => array("type" => "varchar(64)", "not null" => "1"),
"filename" => array("type" => "varchar(255)", "not null" => "1"),
"filetype" => array("type" => "varchar(64)", "not null" => "1"),
"filesize" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"filesize" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"data" => array("type" => "longblob", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
@ -344,10 +343,10 @@ function db_definition() {
$database["auth_codes"] = array(
"fields" => array(
"id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
"client_id" => array("type" => "varchar(20)", "not null" => "1"),
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1"),
"expires" => array("type" => "int(11)", "not null" => "1"),
"scope" => array("type" => "varchar(250)", "not null" => "1"),
"client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -357,7 +356,7 @@ function db_definition() {
"fields" => array(
"k" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"),
"v" => array("type" => "text", "not null" => "1"),
"updated" => array("type" => "datetime", "not null" => "1"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
"indexes" => array(
"PRIMARY" => array("k"),
@ -367,11 +366,11 @@ function db_definition() {
$database["challenge"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"challenge" => array("type" => "varchar(255)", "not null" => "1"),
"dfrn-id" => array("type" => "varchar(255)", "not null" => "1"),
"expire" => array("type" => "int(11)", "not null" => "1"),
"type" => array("type" => "varchar(255)", "not null" => "1"),
"last_update" => array("type" => "varchar(255)", "not null" => "1"),
"challenge" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"last_update" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -380,8 +379,8 @@ function db_definition() {
$database["clients"] = array(
"fields" => array(
"client_id" => array("type" => "varchar(20)", "not null" => "1", "primary" => "1"),
"pw" => array("type" => "varchar(20)", "not null" => "1"),
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1"),
"pw" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"name" => array("type" => "text"),
"icon" => array("type" => "text"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
@ -393,8 +392,8 @@ function db_definition() {
$database["config"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cat" => array("type" => "varchar(255)", "not null" => "1"),
"k" => array("type" => "varchar(255)", "not null" => "1"),
"cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"v" => array("type" => "text", "not null" => "1"),
),
"indexes" => array(
@ -405,29 +404,29 @@ function db_definition() {
$database["contact"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"rel" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"nick" => array("type" => "varchar(255)", "not null" => "1"),
"attag" => array("type" => "varchar(255)", "not null" => "1"),
"network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"attag" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "text", "not null" => "1"),
"thumb" => array("type" => "text", "not null" => "1"),
"micro" => array("type" => "text", "not null" => "1"),
"site-pubkey" => array("type" => "text", "not null" => "1"),
"issued-id" => array("type" => "varchar(255)", "not null" => "1"),
"dfrn-id" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"nurl" => array("type" => "varchar(255)", "not null" => "1"),
"addr" => array("type" => "varchar(255)", "not null" => "1"),
"alias" => array("type" => "varchar(255)", "not null" => "1"),
"issued-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pubkey" => array("type" => "text", "not null" => "1"),
"prvkey" => array("type" => "text", "not null" => "1"),
"batch" => array("type" => "varchar(255)", "not null" => "1"),
"batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"request" => array("type" => "text", "not null" => "1"),
"notify" => array("type" => "text", "not null" => "1"),
"poll" => array("type" => "text", "not null" => "1"),
@ -437,14 +436,14 @@ function db_definition() {
"ret-aes" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"usehub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"subhub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hub-verify" => array("type" => "varchar(255)", "not null" => "1"),
"hub-verify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"last-update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"success_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"name-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"priority" => array("type" => "tinyint(3)", "not null" => "1"),
"priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
"blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
"readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -458,8 +457,8 @@ function db_definition() {
"closeness" => array("type" => "tinyint(2)", "not null" => "1", "default" => "99"),
"info" => array("type" => "mediumtext", "not null" => "1"),
"profile-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"bdyear" => array("type" => "varchar(4)", "not null" => "1"),
"bd" => array("type" => "date", "not null" => "1"),
"bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => ""),
"bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"),
"notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"),
@ -472,10 +471,10 @@ function db_definition() {
$database["conv"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"recips" => array("type" => "mediumtext", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"creator" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"subject" => array("type" => "mediumtext", "not null" => "1"),
@ -488,9 +487,9 @@ function db_definition() {
$database["deliverq"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cmd" => array("type" => "varchar(32)", "not null" => "1"),
"item" => array("type" => "int(11)", "not null" => "1"),
"contact" => array("type" => "int(11)", "not null" => "1"),
"cmd" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"item" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"contact" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -499,9 +498,9 @@ function db_definition() {
$database["dsprphotoq"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"msg" => array("type" => "mediumtext", "not null" => "1"),
"attempt" => array("type" => "tinyint(4)", "not null" => "1"),
"attempt" => array("type" => "tinyint(4)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -510,17 +509,17 @@ function db_definition() {
$database["event"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1"),
"uri" => array("type" => "varchar(255)", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1"),
"edited" => array("type" => "datetime", "not null" => "1"),
"start" => array("type" => "datetime", "not null" => "1"),
"finish" => array("type" => "datetime", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"start" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"finish" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"summary" => array("type" => "text", "not null" => "1"),
"desc" => array("type" => "text", "not null" => "1"),
"location" => array("type" => "text", "not null" => "1"),
"type" => array("type" => "varchar(255)", "not null" => "1"),
"type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nofinish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"adjust" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
"ignore" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"),
@ -537,19 +536,19 @@ function db_definition() {
$database["fcontact"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"photo" => array("type" => "varchar(255)", "not null" => "1"),
"request" => array("type" => "varchar(255)", "not null" => "1"),
"nick" => array("type" => "varchar(255)", "not null" => "1"),
"addr" => array("type" => "varchar(255)", "not null" => "1"),
"batch" => array("type" => "varchar(255)", "not null" => "1"),
"notify" => array("type" => "varchar(255)", "not null" => "1"),
"poll" => array("type" => "varchar(255)", "not null" => "1"),
"confirm" => array("type" => "varchar(255)", "not null" => "1"),
"priority" => array("type" => "tinyint(1)", "not null" => "1"),
"network" => array("type" => "varchar(32)", "not null" => "1"),
"alias" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"notify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"poll" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"confirm" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"priority" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pubkey" => array("type" => "text", "not null" => "1"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
@ -561,9 +560,9 @@ function db_definition() {
$database["ffinder"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"cid" => array("type" => "int(10) unsigned", "not null" => "1"),
"fid" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -572,8 +571,8 @@ function db_definition() {
$database["fserver"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"server" => array("type" => "varchar(255)", "not null" => "1"),
"posturl" => array("type" => "varchar(255)", "not null" => "1"),
"server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"posturl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"key" => array("type" => "text", "not null" => "1"),
),
"indexes" => array(
@ -584,14 +583,14 @@ function db_definition() {
$database["fsuggest"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"request" => array("type" => "varchar(255)", "not null" => "1"),
"photo" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"note" => array("type" => "text", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -600,8 +599,8 @@ function db_definition() {
$database["gcign"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"gcid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -612,11 +611,11 @@ function db_definition() {
$database["gcontact"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"nurl" => array("type" => "varchar(255)", "not null" => "1"),
"photo" => array("type" => "varchar(255)", "not null" => "1"),
"connect" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"connect" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -626,11 +625,11 @@ function db_definition() {
$database["glink"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"gcid" => array("type" => "int(11)", "not null" => "1"),
"zcid" => array("type" => "int(11)", "not null" => "1"),
"updated" => array("type" => "datetime", "not null" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -642,10 +641,10 @@ function db_definition() {
$database["group"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -655,9 +654,9 @@ function db_definition() {
$database["group_member"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"gid" => array("type" => "int(10) unsigned", "not null" => "1"),
"contact-id" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -667,7 +666,7 @@ function db_definition() {
$database["guid"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -677,9 +676,9 @@ function db_definition() {
$database["hook"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"hook" => array("type" => "varchar(255)", "not null" => "1"),
"file" => array("type" => "varchar(255)", "not null" => "1"),
"function" => array("type" => "varchar(255)", "not null" => "1"),
"hook" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"file" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"function" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"priority" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
),
"indexes" => array(
@ -690,14 +689,14 @@ function db_definition() {
$database["intro"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"fid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"contact-id" => array("type" => "int(11)", "not null" => "1"),
"knowyou" => array("type" => "tinyint(1)", "not null" => "1"),
"contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"knowyou" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"note" => array("type" => "text", "not null" => "1"),
"hash" => array("type" => "varchar(255)", "not null" => "1"),
"datetime" => array("type" => "datetime", "not null" => "1"),
"hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"datetime" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
"ignore" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
),
@ -708,46 +707,46 @@ function db_definition() {
$database["item"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1"),
"uri" => array("type" => "varchar(255)", "not null" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"contact-id" => array("type" => "int(11)", "not null" => "1"),
"type" => array("type" => "varchar(255)", "not null" => "1"),
"contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"parent" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"parent-uri" => array("type" => "varchar(255)", "not null" => "1"),
"extid" => array("type" => "varchar(255)", "not null" => "1"),
"thr-parent" => array("type" => "varchar(255)", "not null" => "1"),
"parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"extid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"thr-parent" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"owner-name" => array("type" => "varchar(255)", "not null" => "1"),
"owner-link" => array("type" => "varchar(255)", "not null" => "1"),
"owner-avatar" => array("type" => "varchar(255)", "not null" => "1"),
"author-name" => array("type" => "varchar(255)", "not null" => "1"),
"author-link" => array("type" => "varchar(255)", "not null" => "1"),
"author-avatar" => array("type" => "varchar(255)", "not null" => "1"),
"title" => array("type" => "varchar(255)", "not null" => "1"),
"owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"body" => array("type" => "mediumtext", "not null" => "1"),
"app" => array("type" => "varchar(255)", "not null" => "1"),
"verb" => array("type" => "varchar(255)", "not null" => "1"),
"object-type" => array("type" => "varchar(255)", "not null" => "1"),
"app" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"object-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"object" => array("type" => "text", "not null" => "1"),
"target-type" => array("type" => "varchar(255)", "not null" => "1"),
"target-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"target" => array("type" => "text", "not null" => "1"),
"postopts" => array("type" => "text", "not null" => "1"),
"plink" => array("type" => "varchar(255)", "not null" => "1"),
"resource-id" => array("type" => "varchar(255)", "not null" => "1"),
"event-id" => array("type" => "int(11)", "not null" => "1"),
"plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"event-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"tag" => array("type" => "mediumtext", "not null" => "1"),
"attach" => array("type" => "mediumtext", "not null" => "1"),
"inform" => array("type" => "mediumtext", "not null" => "1"),
"file" => array("type" => "mediumtext", "not null" => "1"),
"location" => array("type" => "varchar(255)", "not null" => "1"),
"coord" => array("type" => "varchar(255)", "not null" => "1"),
"location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"coord" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"allow_cid" => array("type" => "mediumtext", "not null" => "1"),
"allow_gid" => array("type" => "mediumtext", "not null" => "1"),
"deny_cid" => array("type" => "mediumtext", "not null" => "1"),
@ -765,7 +764,7 @@ function db_definition() {
"forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"last-child" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "1"),
"mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(32)", "not null" => "1"),
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -806,10 +805,10 @@ function db_definition() {
$database["item_id"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"iid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"sid" => array("type" => "varchar(255)", "not null" => "1"),
"service" => array("type" => "varchar(255)", "not null" => "1"),
"iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -822,7 +821,7 @@ function db_definition() {
$database["locks"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"name" => array("type" => "varchar(128)", "not null" => "1"),
"name" => array("type" => "varchar(128)", "not null" => "1", "default" => ""),
"locked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
@ -832,21 +831,21 @@ function db_definition() {
$database["mail"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1"),
"from-name" => array("type" => "varchar(255)", "not null" => "1"),
"from-photo" => array("type" => "varchar(255)", "not null" => "1"),
"from-url" => array("type" => "varchar(255)", "not null" => "1"),
"contact-id" => array("type" => "varchar(255)", "not null" => "1"),
"convid" => array("type" => "int(11) unsigned", "not null" => "1"),
"title" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"body" => array("type" => "mediumtext", "not null" => "1"),
"seen" => array("type" => "tinyint(1)", "not null" => "1"),
"seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"reply" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"replied" => array("type" => "tinyint(1)", "not null" => "1"),
"replied" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"unknown" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"uri" => array("type" => "varchar(255)", "not null" => "1"),
"parent-uri" => array("type" => "varchar(255)", "not null" => "1"),
"uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
"indexes" => array(
@ -862,16 +861,16 @@ function db_definition() {
$database["mailacct"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"server" => array("type" => "varchar(255)", "not null" => "1"),
"port" => array("type" => "int(11)", "not null" => "1"),
"ssltype" => array("type" => "varchar(16)", "not null" => "1"),
"mailbox" => array("type" => "varchar(255)", "not null" => "1"),
"user" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"port" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
"mailbox" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"user" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pass" => array("type" => "text", "not null" => "1"),
"reply_to" => array("type" => "varchar(255)", "not null" => "1"),
"action" => array("type" => "int(11)", "not null" => "1"),
"movetofolder" => array("type" => "varchar(255)", "not null" => "1"),
"reply_to" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"action" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"movetofolder" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"last_check" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
@ -882,8 +881,8 @@ function db_definition() {
$database["manage"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"mid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"mid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -893,19 +892,19 @@ function db_definition() {
$database["notify"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"hash" => array("type" => "varchar(64)", "not null" => "1"),
"type" => array("type" => "int(11)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"photo" => array("type" => "varchar(255)", "not null" => "1"),
"date" => array("type" => "datetime", "not null" => "1"),
"hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"type" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"msg" => array("type" => "mediumtext", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"link" => array("type" => "varchar(255)", "not null" => "1"),
"parent" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"parent" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"verb" => array("type" => "varchar(255)", "not null" => "1"),
"otype" => array("type" => "varchar(16)", "not null" => "1"),
"verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -915,10 +914,10 @@ function db_definition() {
$database["notify-threads"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"notify-id" => array("type" => "int(11)", "not null" => "1"),
"notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"receiver-uid" => array("type" => "int(11)", "not null" => "1"),
"receiver-uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -930,8 +929,8 @@ function db_definition() {
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"cat" => array("type" => "varchar(255)", "not null" => "1"),
"k" => array("type" => "varchar(255)", "not null" => "1"),
"cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"v" => array("type" => "mediumtext", "not null" => "1"),
),
"indexes" => array(
@ -942,22 +941,22 @@ function db_definition() {
$database["photo"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"guid" => array("type" => "varchar(64)", "not null" => "1"),
"resource-id" => array("type" => "varchar(255)", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1"),
"edited" => array("type" => "datetime", "not null" => "1"),
"title" => array("type" => "varchar(255)", "not null" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"desc" => array("type" => "text", "not null" => "1"),
"album" => array("type" => "varchar(255)", "not null" => "1"),
"filename" => array("type" => "varchar(255)", "not null" => "1"),
"album" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"type" => array("type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"),
"height" => array("type" => "smallint(6)", "not null" => "1"),
"width" => array("type" => "smallint(6)", "not null" => "1"),
"height" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
"width" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"),
"datasize" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"data" => array("type" => "mediumblob", "not null" => "1"),
"scale" => array("type" => "tinyint(3)", "not null" => "1"),
"scale" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
"profile" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"allow_cid" => array("type" => "mediumtext", "not null" => "1"),
"allow_gid" => array("type" => "mediumtext", "not null" => "1"),
@ -974,7 +973,7 @@ function db_definition() {
$database["poll"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"q0" => array("type" => "mediumtext", "not null" => "1"),
"q1" => array("type" => "mediumtext", "not null" => "1"),
"q2" => array("type" => "mediumtext", "not null" => "1"),
@ -994,8 +993,8 @@ function db_definition() {
$database["poll_result"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"poll_id" => array("type" => "int(11)", "not null" => "1"),
"choice" => array("type" => "int(11)", "not null" => "1"),
"poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1006,32 +1005,32 @@ function db_definition() {
$database["profile"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"profile-name" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"pdesc" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
"address" => array("type" => "varchar(255)", "not null" => "1"),
"locality" => array("type" => "varchar(255)", "not null" => "1"),
"region" => array("type" => "varchar(255)", "not null" => "1"),
"postal-code" => array("type" => "varchar(32)", "not null" => "1"),
"country-name" => array("type" => "varchar(255)", "not null" => "1"),
"hometown" => array("type" => "varchar(255)", "not null" => "1"),
"gender" => array("type" => "varchar(32)", "not null" => "1"),
"marital" => array("type" => "varchar(255)", "not null" => "1"),
"address" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"locality" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"region" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"postal-code" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"country-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"hometown" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"marital" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"with" => array("type" => "text", "not null" => "1"),
"howlong" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"sexual" => array("type" => "varchar(255)", "not null" => "1"),
"politic" => array("type" => "varchar(255)", "not null" => "1"),
"religion" => array("type" => "varchar(255)", "not null" => "1"),
"sexual" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"politic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"religion" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pub_keywords" => array("type" => "text", "not null" => "1"),
"prv_keywords" => array("type" => "text", "not null" => "1"),
"likes" => array("type" => "text", "not null" => "1"),
"dislikes" => array("type" => "text", "not null" => "1"),
"about" => array("type" => "text", "not null" => "1"),
"summary" => array("type" => "varchar(255)", "not null" => "1"),
"summary" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"music" => array("type" => "text", "not null" => "1"),
"book" => array("type" => "text", "not null" => "1"),
"tv" => array("type" => "text", "not null" => "1"),
@ -1041,9 +1040,9 @@ function db_definition() {
"work" => array("type" => "text", "not null" => "1"),
"education" => array("type" => "text", "not null" => "1"),
"contact" => array("type" => "text", "not null" => "1"),
"homepage" => array("type" => "varchar(255)", "not null" => "1"),
"photo" => array("type" => "varchar(255)", "not null" => "1"),
"thumb" => array("type" => "varchar(255)", "not null" => "1"),
"homepage" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"thumb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"net-publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
),
@ -1055,11 +1054,11 @@ function db_definition() {
$database["profile_check"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"dfrn_id" => array("type" => "varchar(255)", "not null" => "1"),
"sec" => array("type" => "varchar(255)", "not null" => "1"),
"expire" => array("type" => "int(11)", "not null" => "1"),
"dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"sec" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1068,13 +1067,13 @@ function db_definition() {
$database["push_subscriber"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"callback_url" => array("type" => "varchar(255)", "not null" => "1"),
"topic" => array("type" => "varchar(255)", "not null" => "1"),
"nickname" => array("type" => "varchar(255)", "not null" => "1"),
"push" => array("type" => "int(11)", "not null" => "1"),
"last_update" => array("type" => "datetime", "not null" => "1"),
"secret" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"topic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"push" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"last_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"secret" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1083,10 +1082,10 @@ function db_definition() {
$database["queue"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1"),
"network" => array("type" => "varchar(32)", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1"),
"last" => array("type" => "datetime", "not null" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"last" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"content" => array("type" => "mediumtext", "not null" => "1"),
"batch" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
),
@ -1102,11 +1101,11 @@ function db_definition() {
$database["register"] = array(
"fields" => array(
"id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"hash" => array("type" => "varchar(255)", "not null" => "1"),
"created" => array("type" => "datetime", "not null" => "1"),
"uid" => array("type" => "int(11) unsigned", "not null" => "1"),
"password" => array("type" => "varchar(255)", "not null" => "1"),
"language" => array("type" => "varchar(16)", "not null" => "1"),
"hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1115,8 +1114,8 @@ function db_definition() {
$database["search"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"term" => array("type" => "varchar(255)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1127,9 +1126,9 @@ function db_definition() {
$database["session"] = array(
"fields" => array(
"id" => array("type" => "bigint(20) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"sid" => array("type" => "varchar(255)", "not null" => "1"),
"sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"data" => array("type" => "text", "not null" => "1"),
"expire" => array("type" => "int(10) unsigned", "not null" => "1"),
"expire" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1144,7 +1143,7 @@ function db_definition() {
"retract_iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"signed_text" => array("type" => "mediumtext", "not null" => "1"),
"signature" => array("type" => "text", "not null" => "1"),
"signer" => array("type" => "varchar(255)", "not null" => "1"),
"signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1155,10 +1154,10 @@ function db_definition() {
$database["spam"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"spam" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"term" => array("type" => "varchar(255)", "not null" => "1"),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
),
"indexes" => array(
@ -1172,11 +1171,11 @@ function db_definition() {
$database["term"] = array(
"fields" => array(
"tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"oid" => array("type" => "int(10) unsigned", "not null" => "1"),
"otype" => array("type" => "tinyint(3) unsigned", "not null" => "1"),
"type" => array("type" => "tinyint(3) unsigned", "not null" => "1"),
"term" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"otype" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
"type" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
),
@ -1213,7 +1212,7 @@ function db_definition() {
"origin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(32)", "not null" => "1"),
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("iid"),
@ -1232,10 +1231,10 @@ function db_definition() {
"fields" => array(
"id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
"secret" => array("type" => "text", "not null" => "1"),
"client_id" => array("type" => "varchar(20)", "not null" => "1"),
"expires" => array("type" => "int(11)", "not null" => "1"),
"scope" => array("type" => "varchar(200)", "not null" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1"),
"client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""),
"expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"scope" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1244,10 +1243,10 @@ function db_definition() {
$database["unique_contacts"] = array(
"fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1"),
"nick" => array("type" => "varchar(255)", "not null" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1"),
"avatar" => array("type" => "varchar(255)", "not null" => "1"),
"url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
"indexes" => array(
"PRIMARY" => array("id"),
@ -1257,19 +1256,19 @@ function db_definition() {
$database["user"] = array(
"fields" => array(
"uid" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1"),
"username" => array("type" => "varchar(255)", "not null" => "1"),
"password" => array("type" => "varchar(255)", "not null" => "1"),
"nickname" => array("type" => "varchar(255)", "not null" => "1"),
"email" => array("type" => "varchar(255)", "not null" => "1"),
"openid" => array("type" => "varchar(255)", "not null" => "1"),
"timezone" => array("type" => "varchar(128)", "not null" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"username" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"email" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"openid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"timezone" => array("type" => "varchar(128)", "not null" => "1", "default" => ""),
"language" => array("type" => "varchar(32)", "not null" => "1", "default" => "en"),
"register_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"login_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"default-location" => array("type" => "varchar(255)", "not null" => "1"),
"default-location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"allow_location" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"theme" => array("type" => "varchar(255)", "not null" => "1"),
"theme" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pubkey" => array("type" => "text", "not null" => "1"),
"prvkey" => array("type" => "text", "not null" => "1"),
"spubkey" => array("type" => "text", "not null" => "1"),
@ -1284,14 +1283,14 @@ function db_definition() {
"notify-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "65535"),
"page-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"prvnets" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"pwdreset" => array("type" => "varchar(255)", "not null" => "1"),
"pwdreset" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"maxreq" => array("type" => "int(11)", "not null" => "1", "default" => "10"),
"expire" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"account_removed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"account_expired" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"account_expires_on" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"expire_notification_sent" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"service_class" => array("type" => "varchar(32)", "not null" => "1"),
"service_class" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"def_gid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"allow_cid" => array("type" => "mediumtext", "not null" => "1"),
"allow_gid" => array("type" => "mediumtext", "not null" => "1"),

View File

@ -1161,6 +1161,11 @@ function item_store($arr,$force_parent = false, $notify = false) {
$arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 );
$arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid(30));
$arr['network'] = ((x($arr,'network')) ? trim($arr['network']) : '');
$arr['postopts'] = ((x($arr,'postopts')) ? trim($arr['postopts']) : '');
$arr['resource-id'] = ((x($arr,'resource-id')) ? trim($arr['resource-id']) : '');
$arr['event-id'] = ((x($arr,'event-id')) ? intval($arr['event-id']) : 0 );
$arr['inform'] = ((x($arr,'inform')) ? trim($arr['inform']) : '');
$arr['file'] = ((x($arr,'file')) ? trim($arr['file']) : '');
if ($arr['plink'] == "") {
$a = get_app();

View File

@ -175,6 +175,8 @@ function dfrn_notify_content(&$a) {
$dfrn_id = notags(trim($_GET['dfrn_id']));
$dfrn_version = (float) $_GET['dfrn_version'];
$type = "";
$last_update = "";
logger('dfrn_notify: new notification dfrn_id=' . $dfrn_id);
@ -190,11 +192,13 @@ function dfrn_notify_content(&$a) {
$r = q("DELETE FROM `challenge` WHERE `expire` < " . intval(time()));
$r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` )
$r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
VALUES( '%s', '%s', %d ) ",
dbesc($hash),
dbesc($dfrn_id),
intval(time() + 90 )
intval(time() + 90 ),
dbesc($type),
dbesc($last_update)
);
logger('dfrn_notify: challenge=' . $hash, LOGGER_DEBUG );

View File

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1174 );
define( 'UPDATE_VERSION' , 1175 );
/**
*