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