]> git.mxchange.org Git - friendica.git/blob - doc/database/db_contact.md
All URL fields are now binary and longer
[friendica.git] / doc / database / db_contact.md
1 Table contact
2 ===========
3
4 contact table
5
6 Fields
7 ------
8
9 | Field                     | Description                                                                                                    | Type               | Null | Key | Default             | Extra          |
10 | ------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
11 | id                        | sequential ID                                                                                                  | int unsigned       | NO   | PRI | NULL                | auto_increment |
12 | uid                       | Owner User id                                                                                                  | mediumint unsigned | NO   |     | 0                   |                |
13 | created                   |                                                                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
14 | updated                   | Date of last contact update                                                                                    | datetime           | YES  |     | 0001-01-01 00:00:00 |                |
15 | network                   | Network of the contact                                                                                         | char(4)            | NO   |     |                     |                |
16 | name                      | Name that this contact is known by                                                                             | varchar(255)       | NO   |     |                     |                |
17 | nick                      | Nick- and user name of the contact                                                                             | varchar(255)       | NO   |     |                     |                |
18 | location                  |                                                                                                                | varchar(255)       | YES  |     |                     |                |
19 | about                     |                                                                                                                | text               | YES  |     | NULL                |                |
20 | keywords                  | public keywords (interests) of the contact                                                                     | text               | YES  |     | NULL                |                |
21 | xmpp                      | XMPP address                                                                                                   | varchar(255)       | NO   |     |                     |                |
22 | matrix                    | Matrix address                                                                                                 | varchar(255)       | NO   |     |                     |                |
23 | avatar                    |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
24 | header                    | Header picture                                                                                                 | varbinary(383)     | YES  |     | NULL                |                |
25 | url                       |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
26 | nurl                      |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
27 | uri-id                    | Id of the item-uri table entry that contains the contact url                                                   | int unsigned       | YES  |     | NULL                |                |
28 | addr                      |                                                                                                                | varchar(255)       | NO   |     |                     |                |
29 | alias                     |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
30 | pubkey                    | RSA public key 4096 bit                                                                                        | text               | YES  |     | NULL                |                |
31 | prvkey                    | RSA private key 4096 bit                                                                                       | text               | YES  |     | NULL                |                |
32 | batch                     |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
33 | notify                    |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
34 | poll                      |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
35 | subscribe                 |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
36 | last-update               | Date of the last try to update the contact info                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
37 | next-update               | Next connection request                                                                                        | datetime           | YES  |     | NULL                |                |
38 | success_update            | Date of the last successful contact update                                                                     | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
39 | failure_update            | Date of the last failed update                                                                                 | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
40 | failed                    | Connection failed                                                                                              | boolean            | YES  |     | NULL                |                |
41 | term-date                 |                                                                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
42 | last-item                 | date of the last post                                                                                          | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
43 | last-discovery            | date of the last follower discovery                                                                            | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
44 | local-data                | Is true when there are posts with this contact on the system                                                   | boolean            | YES  |     | NULL                |                |
45 | blocked                   | Node-wide block status                                                                                         | boolean            | NO   |     | 1                   |                |
46 | block_reason              | Node-wide block reason                                                                                         | text               | YES  |     | NULL                |                |
47 | readonly                  | posts of the contact are readonly                                                                              | boolean            | NO   |     | 0                   |                |
48 | contact-type              | Person, organisation, news, community, relay                                                                   | tinyint            | NO   |     | 0                   |                |
49 | manually-approve          | Contact requests have to be approved manually                                                                  | boolean            | YES  |     | NULL                |                |
50 | archive                   |                                                                                                                | boolean            | NO   |     | 0                   |                |
51 | unsearchable              | Contact prefers to not be searchable                                                                           | boolean            | NO   |     | 0                   |                |
52 | sensitive                 | Contact posts sensitive content                                                                                | boolean            | NO   |     | 0                   |                |
53 | baseurl                   | baseurl of the contact                                                                                         | varbinary(383)     | YES  |     |                     |                |
54 | gsid                      | Global Server ID                                                                                               | int unsigned       | YES  |     | NULL                |                |
55 | bd                        |                                                                                                                | date               | NO   |     | 0001-01-01          |                |
56 | reason                    |                                                                                                                | text               | YES  |     | NULL                |                |
57 | self                      | 1 if the contact is the user him/her self                                                                      | boolean            | NO   |     | 0                   |                |
58 | remote_self               |                                                                                                                | boolean            | NO   |     | 0                   |                |
59 | rel                       | The kind of the relation between the user and the contact                                                      | tinyint unsigned   | NO   |     | 0                   |                |
60 | protocol                  | Protocol of the contact                                                                                        | char(4)            | NO   |     |                     |                |
61 | subhub                    |                                                                                                                | boolean            | NO   |     | 0                   |                |
62 | hub-verify                |                                                                                                                | varbinary(383)     | NO   |     |                     |                |
63 | rating                    | Automatically detected feed poll frequency                                                                     | tinyint            | NO   |     | 0                   |                |
64 | priority                  | Feed poll priority                                                                                             | tinyint unsigned   | NO   |     | 0                   |                |
65 | attag                     |                                                                                                                | varchar(255)       | NO   |     |                     |                |
66 | hidden                    |                                                                                                                | boolean            | NO   |     | 0                   |                |
67 | pending                   | Contact request is pending                                                                                     | boolean            | NO   |     | 1                   |                |
68 | deleted                   | Contact has been deleted                                                                                       | boolean            | NO   |     | 0                   |                |
69 | info                      |                                                                                                                | mediumtext         | YES  |     | NULL                |                |
70 | notify_new_posts          |                                                                                                                | boolean            | NO   |     | 0                   |                |
71 | fetch_further_information |                                                                                                                | tinyint unsigned   | NO   |     | 0                   |                |
72 | ffi_keyword_denylist      |                                                                                                                | text               | YES  |     | NULL                |                |
73 | photo                     | Link to the profile photo of the contact                                                                       | varbinary(383)     | YES  |     |                     |                |
74 | thumb                     | Link to the profile photo (thumb size)                                                                         | varbinary(383)     | YES  |     |                     |                |
75 | micro                     | Link to the profile photo (micro size)                                                                         | varbinary(383)     | YES  |     |                     |                |
76 | name-date                 |                                                                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
77 | uri-date                  |                                                                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
78 | avatar-date               |                                                                                                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
79 | request                   |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
80 | confirm                   |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
81 | poco                      |                                                                                                                | varbinary(383)     | YES  |     | NULL                |                |
82 | writable                  |                                                                                                                | boolean            | NO   |     | 0                   |                |
83 | forum                     | contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead        | boolean            | NO   |     | 0                   |                |
84 | prv                       | contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead | boolean            | NO   |     | 0                   |                |
85 | bdyear                    |                                                                                                                | varchar(4)         | NO   |     |                     |                |
86 | site-pubkey               | Deprecated                                                                                                     | text               | YES  |     | NULL                |                |
87 | gender                    | Deprecated                                                                                                     | varchar(32)        | NO   |     |                     |                |
88 | duplex                    | Deprecated                                                                                                     | boolean            | NO   |     | 0                   |                |
89 | issued-id                 | Deprecated                                                                                                     | varbinary(383)     | NO   |     |                     |                |
90 | dfrn-id                   | Deprecated                                                                                                     | varbinary(383)     | NO   |     |                     |                |
91 | aes_allow                 | Deprecated                                                                                                     | boolean            | NO   |     | 0                   |                |
92 | ret-aes                   | Deprecated                                                                                                     | boolean            | NO   |     | 0                   |                |
93 | usehub                    | Deprecated                                                                                                     | boolean            | NO   |     | 0                   |                |
94 | closeness                 | Deprecated                                                                                                     | tinyint unsigned   | NO   |     | 99                  |                |
95 | profile-id                | Deprecated                                                                                                     | int unsigned       | YES  |     | NULL                |                |
96
97 Indexes
98 ------------
99
100 | Name                        | Fields                               |
101 | --------------------------- | ------------------------------------ |
102 | PRIMARY                     | id                                   |
103 | uid_name                    | uid, name(190)                       |
104 | self_uid                    | self, uid                            |
105 | alias_uid                   | alias(128), uid                      |
106 | pending_uid                 | pending, uid                         |
107 | blocked_uid                 | blocked, uid                         |
108 | uid_rel_network_poll        | uid, rel, network, poll(64), archive |
109 | uid_network_batch           | uid, network, batch(64)              |
110 | batch_contact-type          | batch(64), contact-type              |
111 | addr_uid                    | addr(128), uid                       |
112 | nurl_uid                    | nurl(128), uid                       |
113 | nick_uid                    | nick(128), uid                       |
114 | attag_uid                   | attag(96), uid                       |
115 | network_uid_lastupdate      | network, uid, last-update            |
116 | uid_network_self_lastupdate | uid, network, self, last-update      |
117 | next-update                 | next-update                          |
118 | local-data-next-update      | local-data, next-update              |
119 | uid_lastitem                | uid, last-item                       |
120 | baseurl                     | baseurl(64)                          |
121 | uid_contact-type            | uid, contact-type                    |
122 | uid_self_contact-type       | uid, self, contact-type              |
123 | self_network_uid            | self, network, uid                   |
124 | gsid_uid_failed             | gsid, uid, failed                    |
125 | uri-id                      | uri-id                               |
126
127 Foreign Keys
128 ------------
129
130 | Field | Target Table | Target Field |
131 |-------|--------------|--------------|
132 | uid | [user](help/database/db_user) | uid |
133 | uri-id | [item-uri](help/database/db_item-uri) | id |
134 | gsid | [gserver](help/database/db_gserver) | id |
135
136 Return to [database documentation](help/database)