]> git.mxchange.org Git - friendica.git/blob - doc/database/db_contact.md
ae49777aa378bbfda50f6045c2cacc052ca50c1c
[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 | self                      | 1 if the contact is the user him/her self                 | boolean            | NO   |     | 0                   |                |
16 | remote_self               |                                                           | boolean            | NO   |     | 0                   |                |
17 | rel                       | The kind of the relation between the user and the contact | tinyint unsigned   | NO   |     | 0                   |                |
18 | duplex                    |                                                           | boolean            | NO   |     | 0                   |                |
19 | network                   | Network of the contact                                    | char(4)            | NO   |     |                     |                |
20 | protocol                  | Protocol of the contact                                   | char(4)            | NO   |     |                     |                |
21 | name                      | Name that this contact is known by                        | varchar(255)       | NO   |     |                     |                |
22 | nick                      | Nick- and user name of the contact                        | varchar(255)       | NO   |     |                     |                |
23 | location                  |                                                           | varchar(255)       | YES  |     |                     |                |
24 | about                     |                                                           | text               | YES  |     | NULL                |                |
25 | keywords                  | public keywords (interests) of the contact                | text               | YES  |     | NULL                |                |
26 | gender                    | Deprecated                                                | varchar(32)        | NO   |     |                     |                |
27 | xmpp                      |                                                           | varchar(255)       | NO   |     |                     |                |
28 | attag                     |                                                           | varchar(255)       | NO   |     |                     |                |
29 | avatar                    |                                                           | varchar(255)       | NO   |     |                     |                |
30 | photo                     | Link to the profile photo of the contact                  | varchar(255)       | YES  |     |                     |                |
31 | thumb                     | Link to the profile photo (thumb size)                    | varchar(255)       | YES  |     |                     |                |
32 | micro                     | Link to the profile photo (micro size)                    | varchar(255)       | YES  |     |                     |                |
33 | site-pubkey               |                                                           | text               | YES  |     | NULL                |                |
34 | issued-id                 |                                                           | varchar(255)       | NO   |     |                     |                |
35 | dfrn-id                   |                                                           | varchar(255)       | NO   |     |                     |                |
36 | url                       |                                                           | varchar(255)       | NO   |     |                     |                |
37 | nurl                      |                                                           | varchar(255)       | NO   |     |                     |                |
38 | addr                      |                                                           | varchar(255)       | NO   |     |                     |                |
39 | alias                     |                                                           | varchar(255)       | NO   |     |                     |                |
40 | pubkey                    | RSA public key 4096 bit                                   | text               | YES  |     | NULL                |                |
41 | prvkey                    | RSA private key 4096 bit                                  | text               | YES  |     | NULL                |                |
42 | batch                     |                                                           | varchar(255)       | NO   |     |                     |                |
43 | request                   |                                                           | varchar(255)       | YES  |     | NULL                |                |
44 | notify                    |                                                           | varchar(255)       | YES  |     | NULL                |                |
45 | poll                      |                                                           | varchar(255)       | YES  |     | NULL                |                |
46 | confirm                   |                                                           | varchar(255)       | YES  |     | NULL                |                |
47 | subscribe                 |                                                           | varchar(255)       | YES  |     | NULL                |                |
48 | poco                      |                                                           | varchar(255)       | YES  |     | NULL                |                |
49 | aes_allow                 |                                                           | boolean            | NO   |     | 0                   |                |
50 | ret-aes                   |                                                           | boolean            | NO   |     | 0                   |                |
51 | usehub                    |                                                           | boolean            | NO   |     | 0                   |                |
52 | subhub                    |                                                           | boolean            | NO   |     | 0                   |                |
53 | hub-verify                |                                                           | varchar(255)       | NO   |     |                     |                |
54 | last-update               | Date of the last try to update the contact info           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
55 | success_update            | Date of the last successful contact update                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
56 | failure_update            | Date of the last failed update                            | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
57 | failed                    | Connection failed                                         | boolean            | YES  |     | NULL                |                |
58 | name-date                 |                                                           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
59 | uri-date                  |                                                           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
60 | avatar-date               |                                                           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
61 | term-date                 |                                                           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
62 | last-item                 | date of the last post                                     | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
63 | last-discovery            | date of the last follower discovery                       | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
64 | priority                  |                                                           | tinyint unsigned   | NO   |     | 0                   |                |
65 | blocked                   | Node-wide block status                                    | boolean            | NO   |     | 1                   |                |
66 | block_reason              | Node-wide block reason                                    | text               | YES  |     | NULL                |                |
67 | readonly                  | posts of the contact are readonly                         | boolean            | NO   |     | 0                   |                |
68 | writable                  |                                                           | boolean            | NO   |     | 0                   |                |
69 | forum                     | contact is a forum                                        | boolean            | NO   |     | 0                   |                |
70 | prv                       | contact is a private group                                | boolean            | NO   |     | 0                   |                |
71 | contact-type              |                                                           | tinyint            | NO   |     | 0                   |                |
72 | manually-approve          |                                                           | boolean            | YES  |     | NULL                |                |
73 | hidden                    |                                                           | boolean            | NO   |     | 0                   |                |
74 | archive                   |                                                           | boolean            | NO   |     | 0                   |                |
75 | pending                   |                                                           | boolean            | NO   |     | 1                   |                |
76 | deleted                   | Contact has been deleted                                  | boolean            | NO   |     | 0                   |                |
77 | rating                    |                                                           | tinyint            | NO   |     | 0                   |                |
78 | unsearchable              | Contact prefers to not be searchable                      | boolean            | NO   |     | 0                   |                |
79 | sensitive                 | Contact posts sensitive content                           | boolean            | NO   |     | 0                   |                |
80 | baseurl                   | baseurl of the contact                                    | varchar(255)       | YES  |     |                     |                |
81 | gsid                      | Global Server ID                                          | int unsigned       | YES  |     | NULL                |                |
82 | reason                    |                                                           | text               | YES  |     | NULL                |                |
83 | closeness                 |                                                           | tinyint unsigned   | NO   |     | 99                  |                |
84 | info                      |                                                           | mediumtext         | YES  |     | NULL                |                |
85 | profile-id                | Deprecated                                                | int unsigned       | YES  |     | NULL                |                |
86 | bdyear                    |                                                           | varchar(4)         | NO   |     |                     |                |
87 | bd                        |                                                           | date               | NO   |     | 0001-01-01          |                |
88 | notify_new_posts          |                                                           | boolean            | NO   |     | 0                   |                |
89 | fetch_further_information |                                                           | tinyint unsigned   | NO   |     | 0                   |                |
90 | ffi_keyword_denylist      |                                                           | text               | YES  |     | NULL                |                |
91
92 Indexes
93 ------------
94
95 | Name | Fields |
96 |------|---------|
97 | PRIMARY | id |
98 | uid_name | uid, name(190) |
99 | self_uid | self, uid |
100 | alias_uid | alias(128), uid |
101 | pending_uid | pending, uid |
102 | blocked_uid | blocked, uid |
103 | uid_rel_network_poll | uid, rel, network, poll(64), archive |
104 | uid_network_batch | uid, network, batch(64) |
105 | batch_contact-type | batch(64), contact-type |
106 | addr_uid | addr(128), uid |
107 | nurl_uid | nurl(128), uid |
108 | nick_uid | nick(128), uid |
109 | attag_uid | attag(96), uid |
110 | dfrn-id | dfrn-id(64) |
111 | issued-id | issued-id(64) |
112 | network_uid_lastupdate | network, uid, last-update |
113 | uid_network_self_lastupdate | uid, network, self, last-update |
114 | uid_lastitem | uid, last-item |
115 | baseurl | baseurl(64) |
116 | uid_contact-type | uid, contact-type |
117 | uid_self_contact-type | uid, self, contact-type |
118 | self_network_uid | self, network, uid |
119 | gsid | gsid |
120
121 Foreign Keys
122 ------------
123
124 | Field | Target Table | Target Field |
125 |-------|--------------|--------------|
126 | uid | [user](help/database/db_user) | uid |
127 | gsid | [gserver](help/database/db_gserver) | id |
128
129 Return to [database documentation](help/database)