X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fdatabase%2Fdb_post.md;h=303269b1c6342196b46a18f34e980bc96714c841;hb=c8d1bf4cdf1e1d0f16538b3121f8c022c17d02bf;hp=020e5e9c9fb630be834d0c5131de072ae8a8e1b4;hpb=31db9dbef7f6a4f98a6c29d15493bcffb0c39929;p=friendica.git diff --git a/doc/database/db_post.md b/doc/database/db_post.md index 020e5e9c9f..303269b1c6 100644 --- a/doc/database/db_post.md +++ b/doc/database/db_post.md @@ -1,26 +1,58 @@ Table post =========== + Structure for all posts -| Field | Description | Type | Null | Key | Default | Extra | -| ----- | ----------- | ---- | ---- | --- | ------- | ----- | -| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | YES | PRI | NULL | | -| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | NO | | NULL | | -| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | NO | | NULL | | -| external-id | Id of the item-uri table entry that contains the external uri | int unsigned | NO | | NULL | | -| created | Creation timestamp. | datetime | YES | | 0001-01-01 00:00:00 | | -| edited | Date of last edit (default is created) | datetime | YES | | 0001-01-01 00:00:00 | | -| received | datetime | datetime | YES | | 0001-01-01 00:00:00 | | -| gravity | | tinyint unsigned | YES | | 0 | | -| network | Network from where the item comes from | char(4) | YES | | | | -| owner-id | Link to the contact table with uid=0 of the owner of this item | int unsigned | YES | | 0 | | -| author-id | Link to the contact table with uid=0 of the author of this item | int unsigned | YES | | 0 | | -| causer-id | Link to the contact table with uid=0 of the contact that caused the item creation | int unsigned | NO | | NULL | | -| post-type | Post type (personal note, image, article, ...) | tinyint unsigned | YES | | 0 | | -| vid | Id of the verb table entry that contains the activity verbs | smallint unsigned | NO | | NULL | | -| private | 0=public, 1=private, 2=unlisted | tinyint unsigned | YES | | 0 | | -| global | | boolean | YES | | 0 | | -| visible | | boolean | YES | | 0 | | -| deleted | item has been marked for deletion | boolean | YES | | 0 | | +Fields +------ + +| Field | Description | Type | Null | Key | Default | Extra | +| ------------- | --------------------------------------------------------------------------------- | ----------------- | ---- | --- | ------------------- | ----- | +| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | | +| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | YES | | NULL | | +| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | YES | | NULL | | +| external-id | Id of the item-uri table entry that contains the external uri | int unsigned | YES | | NULL | | +| created | Creation timestamp. | datetime | NO | | 0001-01-01 00:00:00 | | +| edited | Date of last edit (default is created) | datetime | NO | | 0001-01-01 00:00:00 | | +| received | datetime | datetime | NO | | 0001-01-01 00:00:00 | | +| gravity | | tinyint unsigned | NO | | 0 | | +| network | Network from where the item comes from | char(4) | NO | | | | +| owner-id | Link to the contact table with uid=0 of the owner of this item | int unsigned | NO | | 0 | | +| author-id | Link to the contact table with uid=0 of the author of this item | int unsigned | NO | | 0 | | +| causer-id | Link to the contact table with uid=0 of the contact that caused the item creation | int unsigned | YES | | NULL | | +| post-type | Post type (personal note, image, article, ...) | tinyint unsigned | NO | | 0 | | +| vid | Id of the verb table entry that contains the activity verbs | smallint unsigned | YES | | NULL | | +| private | 0=public, 1=private, 2=unlisted | tinyint unsigned | NO | | 0 | | +| global | | boolean | NO | | 0 | | +| visible | | boolean | NO | | 0 | | +| deleted | item has been marked for deletion | boolean | NO | | 0 | | + +Indexes +------------ + +| Name | Fields | +| ------------- | ------------- | +| PRIMARY | uri-id | +| parent-uri-id | parent-uri-id | +| thr-parent-id | thr-parent-id | +| external-id | external-id | +| owner-id | owner-id | +| author-id | author-id | +| causer-id | causer-id | +| vid | vid | + +Foreign Keys +------------ + +| Field | Target Table | Target Field | +|-------|--------------|--------------| +| uri-id | [item-uri](help/database/db_item-uri) | id | +| parent-uri-id | [item-uri](help/database/db_item-uri) | id | +| thr-parent-id | [item-uri](help/database/db_item-uri) | id | +| external-id | [item-uri](help/database/db_item-uri) | id | +| owner-id | [contact](help/database/db_contact) | id | +| author-id | [contact](help/database/db_contact) | id | +| causer-id | [contact](help/database/db_contact) | id | +| vid | [verb](help/database/db_verb) | id | Return to [database documentation](help/database)