Added information about table relations

This commit is contained in:
Michael 2017-04-29 23:33:02 +00:00
parent 9ff4fed7d2
commit 44beb62e5a

View file

@ -300,6 +300,9 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
// Compare the field definition // Compare the field definition
$field_definition = $database[$name]["fields"][$fieldname]; $field_definition = $database[$name]["fields"][$fieldname];
// Remove the relation data that is used for the referential integrity
unset($parameters['relation']);
// We change the collation after the indexes had been changed. // We change the collation after the indexes had been changed.
// This is done to avoid index length problems. // This is done to avoid index length problems.
// So here we always ensure that there is no need to change it. // So here we always ensure that there is no need to change it.
@ -627,7 +630,7 @@ function db_definition() {
$database["attach"] = array( $database["attach"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
@ -647,7 +650,7 @@ function db_definition() {
$database["auth_codes"] = array( $database["auth_codes"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"), "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
"client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""), "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => array("clients" => "client_id")),
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""), "scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""),
@ -688,7 +691,7 @@ function db_definition() {
"redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"name" => array("type" => "text"), "name" => array("type" => "text"),
"icon" => array("type" => "text"), "icon" => array("type" => "text"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("client_id"), "PRIMARY" => array("client_id"),
@ -709,7 +712,7 @@ function db_definition() {
$database["contact"] = array( $database["contact"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -798,7 +801,7 @@ function db_definition() {
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"recips" => array("type" => "text"), "recips" => array("type" => "text"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
@ -828,8 +831,8 @@ function db_definition() {
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
@ -881,9 +884,9 @@ function db_definition() {
$database["ffinder"] = array( $database["ffinder"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("fcontact" => "id")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -904,8 +907,8 @@ function db_definition() {
$database["fsuggest"] = array( $database["fsuggest"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"url" => 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" => ""), "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -920,8 +923,8 @@ function db_definition() {
$database["gcign"] = array( $database["gcign"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -971,10 +974,10 @@ function db_definition() {
$database["glink"] = array( $database["glink"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id")),
"zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id")),
"updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
), ),
"indexes" => array( "indexes" => array(
@ -986,7 +989,7 @@ function db_definition() {
$database["group"] = array( $database["group"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"visible" => array("type" => "tinyint(1)", "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"), "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -999,9 +1002,9 @@ function db_definition() {
$database["group_member"] = array( $database["group_member"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("group" => "id")),
"contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -1049,9 +1052,9 @@ function db_definition() {
$database["intro"] = array( $database["intro"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"fid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "fid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("fcontact" => "id")),
"contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"knowyou" => array("type" => "tinyint(1)", "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"), "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"note" => array("type" => "text"), "note" => array("type" => "text"),
@ -1069,9 +1072,9 @@ function db_definition() {
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"uri" => 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"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id")),
"type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -1084,11 +1087,11 @@ function db_definition() {
"commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"changed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "changed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"owner-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "owner-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"owner-link" => 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" => ""), "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "author-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"author-name" => 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-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -1103,7 +1106,7 @@ function db_definition() {
"postopts" => array("type" => "text"), "postopts" => array("type" => "text"),
"plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"resource-id" => 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"), "event-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("event" => "id")),
"tag" => array("type" => "mediumtext"), "tag" => array("type" => "mediumtext"),
"attach" => array("type" => "mediumtext"), "attach" => array("type" => "mediumtext"),
"inform" => array("type" => "mediumtext"), "inform" => array("type" => "mediumtext"),
@ -1164,8 +1167,8 @@ function db_definition() {
$database["item_id"] = array( $database["item_id"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
), ),
@ -1191,13 +1194,13 @@ function db_definition() {
$database["mail"] = array( $database["mail"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"from-name" => array("type" => "varchar(255)", "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-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-url" => 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" => ""), "contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => array("contact" => "id")),
"convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("conv" => "id")),
"title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"body" => array("type" => "mediumtext"), "body" => array("type" => "mediumtext"),
"seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -1219,7 +1222,7 @@ function db_definition() {
$database["mailacct"] = array( $database["mailacct"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"port" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "port" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), "ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
@ -1239,8 +1242,8 @@ function db_definition() {
$database["manage"] = array( $database["manage"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"mid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "mid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -1257,10 +1260,10 @@ function db_definition() {
"photo" => 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" => NULL_DATE), "date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"msg" => array("type" => "mediumtext"), "msg" => array("type" => "mediumtext"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"parent" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "parent" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), "otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
@ -1278,10 +1281,10 @@ function db_definition() {
$database["notify-threads"] = array( $database["notify-threads"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("notify" => "id")),
"master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"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", "default" => "0"), "receiver-uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "id")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -1314,7 +1317,7 @@ function db_definition() {
$database["pconfig"] = array( $database["pconfig"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""), "cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""),
"k" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""), "k" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""),
"v" => array("type" => "mediumtext"), "v" => array("type" => "mediumtext"),
@ -1327,8 +1330,8 @@ function db_definition() {
$database["photo"] = array( $database["photo"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
@ -1361,7 +1364,7 @@ function db_definition() {
$database["poll"] = array( $database["poll"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"q0" => array("type" => "text"), "q0" => array("type" => "text"),
"q1" => array("type" => "text"), "q1" => array("type" => "text"),
"q2" => array("type" => "text"), "q2" => array("type" => "text"),
@ -1381,7 +1384,7 @@ function db_definition() {
$database["poll_result"] = array( $database["poll_result"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("poll" => "id")),
"choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
), ),
"indexes" => array( "indexes" => array(
@ -1404,7 +1407,7 @@ function db_definition() {
$database["profile"] = array( $database["profile"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -1454,8 +1457,8 @@ function db_definition() {
$database["profile_check"] = array( $database["profile_check"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"sec" => 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"), "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
@ -1467,7 +1470,7 @@ function db_definition() {
$database["push_subscriber"] = array( $database["push_subscriber"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"topic" => 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" => ""), "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -1482,7 +1485,7 @@ function db_definition() {
$database["queue"] = array( $database["queue"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"last" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "last" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
@ -1503,7 +1506,7 @@ function db_definition() {
"id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), "language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
"note" => array("type" => "text"), "note" => array("type" => "text"),
@ -1515,7 +1518,7 @@ function db_definition() {
$database["search"] = array( $database["search"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
), ),
"indexes" => array( "indexes" => array(
@ -1539,7 +1542,7 @@ function db_definition() {
$database["sign"] = array( $database["sign"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"signed_text" => array("type" => "mediumtext"), "signed_text" => array("type" => "mediumtext"),
"signature" => array("type" => "text"), "signature" => array("type" => "text"),
"signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -1552,7 +1555,7 @@ function db_definition() {
$database["spam"] = array( $database["spam"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"spam" => 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"), "ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -1569,7 +1572,7 @@ function db_definition() {
$database["term"] = array( $database["term"] = array(
"fields" => array( "fields" => array(
"tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("item" => "id")),
"otype" => array("type" => "tinyint(3) 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"), "type" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"),
"term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
@ -1579,7 +1582,7 @@ function db_definition() {
"received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "global" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("tid"), "PRIMARY" => array("tid"),
@ -1591,12 +1594,12 @@ function db_definition() {
); );
$database["thread"] = array( $database["thread"] = array(
"fields" => array( "fields" => array(
"iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "primary" => "1"), "iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => array("item" => "id")),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"contact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "gcontact-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id")),
"owner-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "owner-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"author-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "author-id" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), "commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
@ -1633,10 +1636,10 @@ function db_definition() {
"fields" => array( "fields" => array(
"id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"), "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"),
"secret" => array("type" => "text"), "secret" => array("type" => "text"),
"client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""), "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => array("clients" => "client_id")),
"expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"scope" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), "scope" => array("type" => "varchar(200)", "not null" => "1", "default" => ""),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),