]> git.mxchange.org Git - friendica.git/blob - doc/database/db_post-user.md
Merge remote-tracking branch 'upstream/2021.06-rc' into issue-10386
[friendica.git] / doc / database / db_post-user.md
1 Table post-user
2 ===========
3
4 User specific post data
5
6 Fields
7 ------
8
9 | Field             | Description                                                                       | Type               | Null | Key | Default             | Extra          |
10 | ----------------- | --------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
11 | id                |                                                                                   | int unsigned       | NO   | PRI | NULL                | auto_increment |
12 | uri-id            | Id of the item-uri table entry that contains the item uri                         | int unsigned       | NO   |     | NULL                |                |
13 | parent-uri-id     | Id of the item-uri table that contains the parent uri                             | int unsigned       | YES  |     | NULL                |                |
14 | thr-parent-id     | Id of the item-uri table that contains the thread parent uri                      | int unsigned       | YES  |     | NULL                |                |
15 | external-id       | Id of the item-uri table entry that contains the external uri                     | int unsigned       | YES  |     | NULL                |                |
16 | created           | Creation timestamp.                                                               | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
17 | edited            | Date of last edit (default is created)                                            | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
18 | received          | datetime                                                                          | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
19 | gravity           |                                                                                   | tinyint unsigned   | NO   |     | 0                   |                |
20 | network           | Network from where the item comes from                                            | char(4)            | NO   |     |                     |                |
21 | owner-id          | Link to the contact table with uid=0 of the owner of this item                    | int unsigned       | NO   |     | 0                   |                |
22 | author-id         | Link to the contact table with uid=0 of the author of this item                   | int unsigned       | NO   |     | 0                   |                |
23 | causer-id         | Link to the contact table with uid=0 of the contact that caused the item creation | int unsigned       | YES  |     | NULL                |                |
24 | post-type         | Post type (personal note, image, article, ...)                                    | tinyint unsigned   | NO   |     | 0                   |                |
25 | post-reason       | Reason why the post arrived at the user                                           | tinyint unsigned   | NO   |     | 0                   |                |
26 | vid               | Id of the verb table entry that contains the activity verbs                       | smallint unsigned  | YES  |     | NULL                |                |
27 | private           | 0=public, 1=private, 2=unlisted                                                   | tinyint unsigned   | NO   |     | 0                   |                |
28 | global            |                                                                                   | boolean            | NO   |     | 0                   |                |
29 | visible           |                                                                                   | boolean            | NO   |     | 0                   |                |
30 | deleted           | item has been marked for deletion                                                 | boolean            | NO   |     | 0                   |                |
31 | uid               | Owner id which owns this copy of the item                                         | mediumint unsigned | NO   |     | NULL                |                |
32 | protocol          | Protocol used to deliver the item for this user                                   | tinyint unsigned   | YES  |     | NULL                |                |
33 | contact-id        | contact.id                                                                        | int unsigned       | NO   |     | 0                   |                |
34 | event-id          | Used to link to the event.id                                                      | int unsigned       | YES  |     | NULL                |                |
35 | unseen            | post has not been seen                                                            | boolean            | NO   |     | 1                   |                |
36 | hidden            | Marker to hide the post from the user                                             | boolean            | NO   |     | 0                   |                |
37 | notification-type |                                                                                   | tinyint unsigned   | NO   |     | 0                   |                |
38 | wall              | This item was posted to the wall of uid                                           | boolean            | NO   |     | 0                   |                |
39 | origin            | item originated at this site                                                      | boolean            | NO   |     | 0                   |                |
40 | psid              | ID of the permission set of this post                                             | int unsigned       | YES  |     | NULL                |                |
41
42 Indexes
43 ------------
44
45 | Name                 | Fields                  |
46 | -------------------- | ----------------------- |
47 | PRIMARY              | id                      |
48 | uid_uri-id           | UNIQUE, uid, uri-id     |
49 | uri-id               | uri-id                  |
50 | parent-uri-id        | parent-uri-id           |
51 | thr-parent-id        | thr-parent-id           |
52 | external-id          | external-id             |
53 | owner-id             | owner-id                |
54 | author-id            | author-id               |
55 | causer-id            | causer-id               |
56 | vid                  | vid                     |
57 | contact-id           | contact-id              |
58 | event-id             | event-id                |
59 | psid                 | psid                    |
60 | author-id_uid        | author-id, uid          |
61 | author-id_received   | author-id, received     |
62 | parent-uri-id_uid    | parent-uri-id, uid      |
63 | uid_contactid        | uid, contact-id         |
64 | uid_unseen_contactid | uid, unseen, contact-id |
65 | uid_unseen           | uid, unseen             |
66 | uid_hidden_uri-id    | uid, hidden, uri-id     |
67
68 Foreign Keys
69 ------------
70
71 | Field | Target Table | Target Field |
72 |-------|--------------|--------------|
73 | uri-id | [item-uri](help/database/db_item-uri) | id |
74 | parent-uri-id | [item-uri](help/database/db_item-uri) | id |
75 | thr-parent-id | [item-uri](help/database/db_item-uri) | id |
76 | external-id | [item-uri](help/database/db_item-uri) | id |
77 | owner-id | [contact](help/database/db_contact) | id |
78 | author-id | [contact](help/database/db_contact) | id |
79 | causer-id | [contact](help/database/db_contact) | id |
80 | vid | [verb](help/database/db_verb) | id |
81 | uid | [user](help/database/db_user) | uid |
82 | contact-id | [contact](help/database/db_contact) | id |
83 | event-id | [event](help/database/db_event) | id |
84 | psid | [permissionset](help/database/db_permissionset) | id |
85
86 Return to [database documentation](help/database)