From 84ab5d61594ed92e0e28415d6c33df267a3636c5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Jun 2021 20:33:50 +0000 Subject: [PATCH] Updates database structure documentation --- doc/database.md | 120 +++++++++------ doc/database/db_2fa_app_specific_password.md | 14 ++ doc/database/db_2fa_recovery_codes.md | 12 ++ doc/database/db_2fa_trusted_browser.md | 13 ++ doc/database/db_addon.md | 22 ++- doc/database/db_apcontact.md | 32 ++++ doc/database/db_application-token.md | 18 +++ doc/database/db_application.md | 19 +++ doc/database/db_attach.md | 37 ++--- doc/database/db_auth_codes.md | 19 ++- doc/database/db_cache.md | 13 +- doc/database/db_challenge.md | 19 +-- doc/database/db_clients.md | 19 +-- doc/database/db_config.md | 15 +- doc/database/db_contact-relation.md | 13 ++ doc/database/db_contact.md | 152 ++++++++++--------- doc/database/db_conv.md | 23 +-- doc/database/db_conversation.md | 22 +-- doc/database/db_delayed-post.md | 12 ++ doc/database/db_diaspora-interaction.md | 10 ++ doc/database/db_event.md | 44 +++--- doc/database/db_fcontact.md | 41 ++--- doc/database/db_fsuggest.md | 25 +-- doc/database/db_group.md | 15 +- doc/database/db_group_member.md | 14 +- doc/database/db_gserver-tag.md | 10 ++ doc/database/db_gserver.md | 47 +++--- doc/database/db_hook.md | 17 ++- doc/database/db_host.md | 10 ++ doc/database/db_inbox-status.md | 15 ++ doc/database/db_intro.md | 27 ++-- doc/database/db_item-uri.md | 11 ++ doc/database/db_item.md | 72 --------- doc/database/db_locks.md | 14 +- doc/database/db_mail.md | 46 +++--- doc/database/db_mailacct.md | 33 ++-- doc/database/db_manage.md | 13 +- doc/database/db_notification.md | 17 +++ doc/database/db_notify-threads.md | 18 ++- doc/database/db_notify.md | 42 ++--- doc/database/db_oembed.md | 15 +- doc/database/db_openwebauth-token.md | 14 ++ doc/database/db_parsed_url.md | 19 ++- doc/database/db_pconfig.md | 19 +-- doc/database/db_permissionset.md | 14 ++ doc/database/db_photo.md | 54 ++++--- doc/database/db_poll.md | 19 --- doc/database/db_poll_result.md | 10 -- doc/database/db_post-category.md | 12 ++ doc/database/db_post-content.md | 25 +++ doc/database/db_post-delivery-data.md | 19 +++ doc/database/db_post-media.md | 27 ++++ doc/database/db_post-tag.md | 12 ++ doc/database/db_post-thread-user.md | 31 ++++ doc/database/db_post-thread.md | 17 +++ doc/database/db_post-user-notification.md | 11 ++ doc/database/db_post-user.md | 38 +++++ doc/database/db_post.md | 26 ++++ doc/database/db_process.md | 11 ++ doc/database/db_profile.md | 90 +++++------ doc/database/db_profile_check.md | 19 +-- doc/database/db_profile_field.md | 16 ++ doc/database/db_push_subscriber.md | 20 ++- doc/database/db_queue.md | 14 -- doc/database/db_register.md | 20 +-- doc/database/db_search.md | 13 +- doc/database/db_session.md | 15 +- doc/database/db_sign.md | 12 -- doc/database/db_storage.md | 10 ++ doc/database/db_tag.md | 11 ++ doc/database/db_term.md | 19 --- doc/database/db_thread.md | 33 ---- doc/database/db_tokens.md | 19 +-- doc/database/db_user-contact.md | 13 ++ doc/database/db_user.md | 122 ++++++--------- doc/database/db_userd.md | 9 +- doc/database/db_verb.md | 10 ++ doc/database/db_worker-ipc.md | 10 ++ doc/database/db_workerqueue.md | 24 +-- src/Console/DatabaseStructure.php | 1 + src/Database/DBStructure.php | 36 +++++ view/templates/structure.tpl | 11 ++ view/templates/tables.tpl | 10 ++ 83 files changed, 1289 insertions(+), 796 deletions(-) create mode 100644 doc/database/db_2fa_app_specific_password.md create mode 100644 doc/database/db_2fa_recovery_codes.md create mode 100644 doc/database/db_2fa_trusted_browser.md create mode 100644 doc/database/db_apcontact.md create mode 100644 doc/database/db_application-token.md create mode 100644 doc/database/db_application.md create mode 100644 doc/database/db_contact-relation.md create mode 100644 doc/database/db_delayed-post.md create mode 100644 doc/database/db_diaspora-interaction.md create mode 100644 doc/database/db_gserver-tag.md create mode 100644 doc/database/db_host.md create mode 100644 doc/database/db_inbox-status.md create mode 100644 doc/database/db_item-uri.md delete mode 100644 doc/database/db_item.md create mode 100644 doc/database/db_notification.md create mode 100644 doc/database/db_openwebauth-token.md create mode 100644 doc/database/db_permissionset.md delete mode 100644 doc/database/db_poll.md delete mode 100644 doc/database/db_poll_result.md create mode 100644 doc/database/db_post-category.md create mode 100644 doc/database/db_post-content.md create mode 100644 doc/database/db_post-delivery-data.md create mode 100644 doc/database/db_post-media.md create mode 100644 doc/database/db_post-tag.md create mode 100644 doc/database/db_post-thread-user.md create mode 100644 doc/database/db_post-thread.md create mode 100644 doc/database/db_post-user-notification.md create mode 100644 doc/database/db_post-user.md create mode 100644 doc/database/db_post.md create mode 100644 doc/database/db_process.md create mode 100644 doc/database/db_profile_field.md delete mode 100644 doc/database/db_queue.md delete mode 100644 doc/database/db_sign.md create mode 100644 doc/database/db_storage.md create mode 100644 doc/database/db_tag.md delete mode 100644 doc/database/db_term.md delete mode 100644 doc/database/db_thread.md create mode 100644 doc/database/db_user-contact.md create mode 100644 doc/database/db_verb.md create mode 100644 doc/database/db_worker-ipc.md create mode 100644 view/templates/structure.tpl create mode 100644 view/templates/tables.tpl diff --git a/doc/database.md b/doc/database.md index 447607f8da..4e22add378 100644 --- a/doc/database.md +++ b/doc/database.md @@ -3,50 +3,76 @@ Database Tables * [Home](help) -| Table | Description | -|------------------------------------------------------|--------------------------------------------------| -| [addon](help/database/db_addon) | registered addons | -| [attach](help/database/db_attach) | file attachments | -| [auth_codes](help/database/db_auth_codes) | OAuth usage | -| [cache](help/database/db_cache) | OEmbed cache | -| [challenge](help/database/db_challenge) | | -| [clients](help/database/db_clients) | OAuth usage | -| [config](help/database/db_config) | main configuration storage | -| [contact](help/database/db_contact) | contact table | -| [conv](help/database/db_conv) | private messages | -| [conversation](help/database/db_conversation) | Raw data and structure information for messages | -| [event](help/database/db_event) | Events | -| [fcontact](help/database/db_fcontact) | friend suggestion stuff | -| [fsuggest](help/database/db_fsuggest) | friend suggestion stuff | -| [group](help/database/db_group) | privacy groups, group info | -| [group_member](help/database/db_group_member) | privacy groups, member info | -| [gserver](help/database/db_gserver) | | -| [hook](help/database/db_hook) | addon hook registry | -| [intro](help/database/db_intro) | | -| [item](help/database/db_item) | all posts | -| [locks](help/database/db_locks) | | -| [mail](help/database/db_mail) | private messages | -| [mailacct](help/database/db_mailacct) | | -| [manage](help/database/db_manage) | table of accounts that can "su" each other | -| [notify](help/database/db_notify) | notifications | -| [notify-threads](help/database/db_notify-threads) | | -| [oembed](help/database/db_oembed) | cache for OEmbed queries | -| [parsed_url](help/database/db_parsed_url) | cache for "parse_url" queries | -| [pconfig](help/database/db_pconfig) | personal (per user) configuration storage | -| [photo](help/database/db_photo) | photo storage | -| [poll](help/database/db_poll) | data for polls | -| [poll_result](help/database/db_poll_result) | data for poll elements | -| [profile](help/database/db_profile) | user profiles data | -| [profile_check](help/database/db_profile_check) | DFRN remote auth use | -| [push_subscriber](help/database/db_push_subscriber) | | -| [queue](help/database/db_queue) | | -| [register](help/database/db_register) | registrations requiring admin approval | -| [search](help/database/db_search) | | -| [session](help/database/db_session) | web session storage | -| [sign](help/database/db_sign) | Diaspora signatures | -| [term](help/database/db_term) | item taxonomy (categories, tags, etc.) table | -| [thread](help/database/db_thread) | | -| [tokens](help/database/db_tokens) | OAuth usage | -| [user](help/database/db_user) | local user table | -| [userd](help/database/db_userd) | | -| [workerqueue](help/database/db_workerqueue) | | +| Table | Description | +|-------|-------------| +| [gserver](help/database/db_gserver) | Global servers | +| [user](help/database/db_user) | The local users | +| [contact](help/database/db_contact) | contact table | +| [item-uri](help/database/db_item-uri) | URI and GUID for items | +| [tag](help/database/db_tag) | tags and mentions | +| [clients](help/database/db_clients) | OAuth usage | +| [permissionset](help/database/db_permissionset) | | +| [verb](help/database/db_verb) | Activity Verbs | +| [2fa_app_specific_password](help/database/db_2fa_app_specific_password) | Two-factor app-specific _password | +| [2fa_recovery_codes](help/database/db_2fa_recovery_codes) | Two-factor authentication recovery codes | +| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers | +| [addon](help/database/db_addon) | registered addons | +| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation | +| [application](help/database/db_application) | OAuth application | +| [application-token](help/database/db_application-token) | OAuth user token | +| [attach](help/database/db_attach) | file attachments | +| [auth_codes](help/database/db_auth_codes) | OAuth usage | +| [cache](help/database/db_cache) | Stores temporary data | +| [challenge](help/database/db_challenge) | | +| [config](help/database/db_config) | main configuration storage | +| [contact-relation](help/database/db_contact-relation) | Contact relations | +| [conv](help/database/db_conv) | private messages | +| [conversation](help/database/db_conversation) | Raw data and structure information for messages | +| [delayed-post](help/database/db_delayed-post) | Posts that are about to be distributed at a later time | +| [diaspora-interaction](help/database/db_diaspora-interaction) | Signed Diaspora Interaction | +| [event](help/database/db_event) | Events | +| [fcontact](help/database/db_fcontact) | Diaspora compatible contacts - used in the Diaspora implementation | +| [fsuggest](help/database/db_fsuggest) | friend suggestion stuff | +| [group](help/database/db_group) | privacy groups, group info | +| [group_member](help/database/db_group_member) | privacy groups, member info | +| [gserver-tag](help/database/db_gserver-tag) | Tags that the server has subscribed | +| [hook](help/database/db_hook) | addon hook registry | +| [host](help/database/db_host) | Hostname | +| [inbox-status](help/database/db_inbox-status) | Status of ActivityPub inboxes | +| [intro](help/database/db_intro) | | +| [locks](help/database/db_locks) | | +| [mail](help/database/db_mail) | private messages | +| [mailacct](help/database/db_mailacct) | Mail account data for fetching mails | +| [manage](help/database/db_manage) | table of accounts that can manage each other | +| [notification](help/database/db_notification) | notifications | +| [notify](help/database/db_notify) | notifications | +| [notify-threads](help/database/db_notify-threads) | | +| [oembed](help/database/db_oembed) | cache for OEmbed queries | +| [openwebauth-token](help/database/db_openwebauth-token) | Store OpenWebAuth token to verify contacts | +| [parsed_url](help/database/db_parsed_url) | cache for 'parse_url' queries | +| [pconfig](help/database/db_pconfig) | personal (per user) configuration storage | +| [photo](help/database/db_photo) | photo storage | +| [post](help/database/db_post) | Structure for all posts | +| [post-category](help/database/db_post-category) | post relation to categories | +| [post-content](help/database/db_post-content) | Content for all posts | +| [post-delivery-data](help/database/db_post-delivery-data) | Delivery data for items | +| [post-media](help/database/db_post-media) | Attached media | +| [post-tag](help/database/db_post-tag) | post relation to tags | +| [post-thread](help/database/db_post-thread) | Thread related data | +| [post-user](help/database/db_post-user) | User specific post data | +| [post-thread-user](help/database/db_post-thread-user) | Thread related data per user | +| [post-user-notification](help/database/db_post-user-notification) | User post notifications | +| [process](help/database/db_process) | Currently running system processes | +| [profile](help/database/db_profile) | user profiles data | +| [profile_check](help/database/db_profile_check) | DFRN remote auth use | +| [profile_field](help/database/db_profile_field) | Custom profile fields | +| [push_subscriber](help/database/db_push_subscriber) | Used for OStatus: Contains feed subscribers | +| [register](help/database/db_register) | registrations requiring admin approval | +| [search](help/database/db_search) | | +| [session](help/database/db_session) | web session storage | +| [storage](help/database/db_storage) | Data stored by Database storage backend | +| [tokens](help/database/db_tokens) | OAuth usage | +| [userd](help/database/db_userd) | Deleted usernames | +| [user-contact](help/database/db_user-contact) | User specific public contact data | +| [worker-ipc](help/database/db_worker-ipc) | Inter process communication between the frontend and the worker | +| [workerqueue](help/database/db_workerqueue) | Background tasks queue entries | diff --git a/doc/database/db_2fa_app_specific_password.md b/doc/database/db_2fa_app_specific_password.md new file mode 100644 index 0000000000..9e3680b768 --- /dev/null +++ b/doc/database/db_2fa_app_specific_password.md @@ -0,0 +1,14 @@ +Table 2fa_app_specific_password +=========== +Two-factor app-specific _password + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | Password ID for revocation | mediumint unsigned | YES | PRI | | auto_increment | +| uid | User ID | mediumint unsigned | YES | | | | +| description | Description of the usage of the password | varchar(255) | NO | | | | +| hashed_password | Hashed password | varchar(255) | YES | | | | +| generated | Datetime the password was generated | datetime | YES | | | | +| last_used | Datetime the password was last used | datetime | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_2fa_recovery_codes.md b/doc/database/db_2fa_recovery_codes.md new file mode 100644 index 0000000000..7b3b9d649c --- /dev/null +++ b/doc/database/db_2fa_recovery_codes.md @@ -0,0 +1,12 @@ +Table 2fa_recovery_codes +=========== +Two-factor authentication recovery codes + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| uid | User ID | mediumint unsigned | YES | PRI | | | +| code | Recovery code string | varchar(50) | YES | PRI | | | +| generated | Datetime the code was generated | datetime | YES | | | | +| used | Datetime the code was used | datetime | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_2fa_trusted_browser.md b/doc/database/db_2fa_trusted_browser.md new file mode 100644 index 0000000000..29be4646a7 --- /dev/null +++ b/doc/database/db_2fa_trusted_browser.md @@ -0,0 +1,13 @@ +Table 2fa_trusted_browser +=========== +Two-factor authentication trusted browsers + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| cookie_hash | Trusted cookie hash | varchar(80) | YES | PRI | | | +| uid | User ID | mediumint unsigned | YES | | | | +| user_agent | User agent string | text | NO | | | | +| created | Datetime the trusted browser was recorded | datetime | YES | | | | +| last_used | Datetime the trusted browser was last used | datetime | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_addon.md b/doc/database/db_addon.md index cd8a3d44a6..db3a5d44bb 100644 --- a/doc/database/db_addon.md +++ b/doc/database/db_addon.md @@ -1,17 +1,15 @@ Table addon =========== +registered addons -| Field | Description | Type | Null | Key | Default | Extra | -| ------------- | --------------------------------------------- | ---------- | ---- | --- | ------- | --------------- | -| id | | int(11) | NO | PRI | NULL | auto_increment | -| name | addon base (file)name | char(255) | NO | | | | -| version | currently unused | char(255) | NO | | | | -| installed | currently always 1 | tinyint(1) | NO | | 0 | | -| hidden | currently unused | tinyint(1) | NO | | 0 | | -| timestamp | file timestamp to check for reloads | bigint(20) | NO | | 0 | | -| plugin_admin | 1 = has admin config, 0 = has no admin config | tinyint(1) | NO | | 0 | | - -Notes: -These are addons which have been enabled by the site administrator on the addon page +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| name | addon base (file)name | varchar(50) | YES | | | | +| version | currently unused | varchar(50) | YES | | | | +| installed | currently always 1 | boolean | YES | | 0 | | +| hidden | currently unused | boolean | YES | | 0 | | +| timestamp | file timestamp to check for reloads | int unsigned | YES | | 0 | | +| plugin_admin | 1 = has admin config, 0 = has no admin config | boolean | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_apcontact.md b/doc/database/db_apcontact.md new file mode 100644 index 0000000000..bea394bc22 --- /dev/null +++ b/doc/database/db_apcontact.md @@ -0,0 +1,32 @@ +Table apcontact +=========== +ActivityPub compatible contacts - used in the ActivityPub implementation + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| url | URL of the contact | varbinary(255) | YES | PRI | | | +| uuid | | varchar(255) | NO | | | | +| type | | varchar(20) | YES | | | | +| following | | varchar(255) | NO | | | | +| followers | | varchar(255) | NO | | | | +| inbox | | varchar(255) | YES | | | | +| outbox | | varchar(255) | NO | | | | +| sharedinbox | | varchar(255) | NO | | | | +| manually-approve | | boolean | NO | | | | +| nick | | varchar(255) | YES | | | | +| name | | varchar(255) | NO | | | | +| about | | text | NO | | | | +| photo | | varchar(255) | NO | | | | +| addr | | varchar(255) | NO | | | | +| alias | | varchar(255) | NO | | | | +| pubkey | | text | NO | | | | +| subscribe | | varchar(255) | NO | | | | +| baseurl | baseurl of the ap contact | varchar(255) | NO | | | | +| gsid | Global Server ID | int unsigned | NO | | | | +| generator | Name of the contact's system | varchar(255) | NO | | | | +| following_count | Number of following contacts | int unsigned | NO | | 0 | | +| followers_count | Number of followers | int unsigned | NO | | 0 | | +| statuses_count | Number of posts | int unsigned | NO | | 0 | | +| updated | | datetime | YES | | 0001-01-01 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_application-token.md b/doc/database/db_application-token.md new file mode 100644 index 0000000000..8b3d601ff7 --- /dev/null +++ b/doc/database/db_application-token.md @@ -0,0 +1,18 @@ +Table application-token +=========== +OAuth user token + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| application-id | | int unsigned | YES | PRI | | | +| uid | Owner User id | mediumint unsigned | YES | PRI | | | +| code | | varchar(64) | YES | | | | +| access_token | | varchar(64) | YES | | | | +| created_at | creation time | datetime | YES | | | | +| scopes | | varchar(255) | NO | | | | +| read | Read scope | boolean | NO | | | | +| write | Write scope | boolean | NO | | | | +| follow | Follow scope | boolean | NO | | | | +| push | Push scope | boolean | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_application.md b/doc/database/db_application.md new file mode 100644 index 0000000000..26b9232660 --- /dev/null +++ b/doc/database/db_application.md @@ -0,0 +1,19 @@ +Table application +=========== +OAuth application + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | generated index | int unsigned | YES | PRI | | auto_increment | +| client_id | | varchar(64) | YES | | | | +| client_secret | | varchar(64) | YES | | | | +| name | | varchar(255) | YES | | | | +| redirect_uri | | varchar(255) | YES | | | | +| website | | varchar(255) | NO | | | | +| scopes | | varchar(255) | NO | | | | +| read | Read scope | boolean | NO | | | | +| write | Write scope | boolean | NO | | | | +| follow | Follow scope | boolean | NO | | | | +| push | Push scope | boolean | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_attach.md b/doc/database/db_attach.md index 7dde8f860d..e35003c368 100644 --- a/doc/database/db_attach.md +++ b/doc/database/db_attach.md @@ -1,22 +1,23 @@ Table attach -============ +=========== +file attachments -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | ------------------------------------------------------| ------------ | ---- | --- | ------------------- | --------------- | -| id | generated index | int(11) | NO | PRI | NULL | auto_increment | -| uid | user_id of owner | int(11) | NO | | 0 | | -| hash | hash | varchar(64) | NO | | | | -| filename | filename of original | varchar(255) | NO | | | | -| filetype | mimetype | varchar(64) | NO | | | | -| filesize | size in bytes | int(11) | NO | | 0 | | -| data | file data | longblob | NO | | NULL | | -| created | creation time | datetime | NO | | 0001-01-01 00:00:00 | | -| edited | last edit time | datetime | NO | | 0001-01-01 00:00:00 | | -| allow_cid | Access Control - list of allowed contact.id '<19><78> | mediumtext | NO | | NULL | | -| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | NULL | | -| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | NULL | | -| deny_gid | Access Control - list of denied groups | mediumtext | NO | | NULL | | - -Notes: Permissions are surrounded by angle chars. e.g. <4> +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | generated index | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| hash | hash | varchar(64) | YES | | | | +| filename | filename of original | varchar(255) | YES | | | | +| filetype | mimetype | varchar(64) | YES | | | | +| filesize | size in bytes | int unsigned | YES | | 0 | | +| data | file data | longblob | YES | | | | +| created | creation time | datetime | YES | | 0001-01-01 00:00:00 | | +| edited | last edit time | datetime | YES | | 0001-01-01 00:00:00 | | +| allow_cid | Access Control - list of allowed contact.id '<19><78> | mediumtext | NO | | | | +| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | | | +| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | | | +| deny_gid | Access Control - list of denied groups | mediumtext | NO | | | | +| backend-class | Storage backend class | tinytext | NO | | | | +| backend-ref | Storage backend data reference | text | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_auth_codes.md b/doc/database/db_auth_codes.md index 1fec38500d..6a33a30a14 100644 --- a/doc/database/db_auth_codes.md +++ b/doc/database/db_auth_codes.md @@ -1,14 +1,13 @@ Table auth_codes -================ +=========== +OAuth usage -OAuth2 authorisation register - currently implemented but unused - -| Field | Description | Type | Null | Key | Default | Extra | -| ------------- | ----------- | ------------ | ---- | --- | ------- | ----- | -| id | | varchar(40) | NO | PRI | NULL | | -| client_id | | varchar(20) | NO | | | | -| redirect_uri | | varchar(200) | NO | | | | -| expires | | int(11) | NO | | 0 | | -| scope | | varchar(250) | NO | | | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | varchar(40) | YES | PRI | | | +| client_id | | varchar(20) | YES | | | | +| redirect_uri | | varchar(200) | YES | | | | +| expires | | int | YES | | 0 | | +| scope | | varchar(250) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_cache.md b/doc/database/db_cache.md index f5691d08a6..328f485e05 100644 --- a/doc/database/db_cache.md +++ b/doc/database/db_cache.md @@ -1,13 +1,12 @@ Table cache =========== - Stores temporary data -| Field | Description | Type | Null | Key | Default | Extra | -| ------------ | ---------------------------------- | ------------ | ---- | --- | ------------------- | ----- | -| k | cache key | varchar(255) | NO | PRI | NULL | | -| v | cached serialized value | text | NO | | NULL | | -| expires | datetime of cache expiration | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| updated | datetime of cache insertion | datetime | NO | MUL | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| k | cache key | varbinary(255) | YES | PRI | | | +| v | cached serialized value | mediumtext | NO | | | | +| expires | datetime of cache expiration | datetime | YES | | 0001-01-01 00:00:00 | | +| updated | datetime of cache insertion | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_challenge.md b/doc/database/db_challenge.md index aa7b263fdf..59534ba137 100644 --- a/doc/database/db_challenge.md +++ b/doc/database/db_challenge.md @@ -1,13 +1,14 @@ Table challenge -=============== +=========== -| Field | Description | Type | Null | Key | Default | Extra | -|-------------|------------------|------------------|------|-----|---------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| challenge | | varchar(255) | NO | | | | -| dfrn-id | | varchar(255) | NO | | | | -| expire | | int(11) | NO | | 0 | | -| type | | varchar(255) | NO | | | | -| last_update | | varchar(255) | NO | | | | + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| challenge | | varchar(255) | YES | | | | +| dfrn-id | | varchar(255) | YES | | | | +| expire | | int unsigned | YES | | 0 | | +| type | | varchar(255) | YES | | | | +| last_update | | varchar(255) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_clients.md b/doc/database/db_clients.md index 228b45cc21..89025d428b 100644 --- a/doc/database/db_clients.md +++ b/doc/database/db_clients.md @@ -1,13 +1,14 @@ Table clients -============= +=========== +OAuth usage -| Field | Description | Type | Null | Key | Default | Extra | -| ------------- | ----------- | ------------ | ---- | --- | ------- | ----- | -| client_id | | varchar(20) | NO | PRI | NULL | | -| pw | | varchar(20) | NO | | | | -| redirect_uri | | varchar(200) | NO | | | | -| name | | text | YES | | NULL | | -| icon | | text | YES | | NULL | | -| uid | | int(11) | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| client_id | | varchar(20) | YES | PRI | | | +| pw | | varchar(20) | YES | | | | +| redirect_uri | | varchar(200) | YES | | | | +| name | | text | NO | | | | +| icon | | text | NO | | | | +| uid | User id | mediumint unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_config.md b/doc/database/db_config.md index 6bcb4bcf89..994b1a8713 100644 --- a/doc/database/db_config.md +++ b/doc/database/db_config.md @@ -1,11 +1,12 @@ Table config -============ +=========== +main configuration storage -| Field | Description | Type | Null | Key | Default | Extra | -| ----- | ----------- | ---------------- | ---- | --- | ------- | --------------- | -| id | | int(10) unsigned | NO | PRI | NULL | auto_increment | -| cat | | char(255) | NO | MUL | | | -| k | | char(255) | NO | | | | -| v | | text | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| cat | | varbinary(50) | YES | | | | +| k | | varbinary(50) | YES | | | | +| v | | mediumtext | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_contact-relation.md b/doc/database/db_contact-relation.md new file mode 100644 index 0000000000..5077cd753f --- /dev/null +++ b/doc/database/db_contact-relation.md @@ -0,0 +1,13 @@ +Table contact-relation +=========== +Contact relations + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| cid | contact the related contact had interacted with | int unsigned | YES | PRI | 0 | | +| relation-cid | related contact who had interacted with the contact | int unsigned | YES | PRI | 0 | | +| last-interaction | Date of the last interaction | datetime | YES | | 0001-01-01 00:00:00 | | +| follow-updated | Date of the last update of the contact relationship | datetime | YES | | 0001-01-01 00:00:00 | | +| follows | | boolean | YES | | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_contact.md b/doc/database/db_contact.md index 2963a1a2a4..108157fc09 100644 --- a/doc/database/db_contact.md +++ b/doc/database/db_contact.md @@ -1,72 +1,88 @@ Table contact -============= +=========== +contact table -| Field | Description | Type | Null | Key | Default | Extra | -|---------------------------|-----------------------------------------------------------|--------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(11) | NO | MUL | 0 | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | -| self | 1 if the contact is the user him/her self | tinyint(1) | NO | | 0 | | -| remote_self | | tinyint(1) | NO | | 0 | | -| rel | The kind of the relation between the user and the contact | tinyint(1) | NO | | 0 | | -| duplex | | tinyint(1) | NO | | 0 | | -| network | Network protocol of the contact | varchar(255) | NO | | | | -| name | Name that this contact is known by | varchar(255) | NO | | | | -| nick | Nick- and user name of the contact | varchar(255) | NO | | | | -| location | | varchar(255) | NO | | | | -| about | | text | NO | | NULL | | -| keywords | public keywords (interests) of the contact | text | NO | | NULL | | -| gender | | varchar(32) | NO | | | | -| attag | | varchar(255) | NO | | | | -| photo | Link to the profile photo of the contact | text | NO | | NULL | | -| thumb | Link to the profile photo (thumb size) | text | NO | | NULL | | -| micro | Link to the profile photo (micro size) | text | NO | | NULL | | -| site-pubkey | | text | NO | | NULL | | -| issued-id | | varchar(255) | NO | | | | -| dfrn-id | | varchar(255) | NO | | | | -| url | | varchar(255) | NO | | | | -| nurl | | varchar(255) | NO | | | | -| addr | | varchar(255) | NO | | | | -| alias | | varchar(255) | NO | | | | -| pubkey | RSA public key 4096 bit | text | NO | | NULL | | -| prvkey | RSA private key 4096 bit | text | NO | | NULL | | -| batch | | varchar(255) | NO | | | | -| request | | text | NO | | NULL | | -| notify | | text | NO | | NULL | | -| poll | | text | NO | | NULL | | -| confirm | | text | NO | | NULL | | -| poco | | text | NO | | NULL | | -| aes_allow | | tinyint(1) | NO | | 0 | | -| ret-aes | | tinyint(1) | NO | | 0 | | -| usehub | | tinyint(1) | NO | | 0 | | -| subhub | | tinyint(1) | NO | | 0 | | -| hub-verify | | varchar(255) | NO | | | | -| last-update | Date of the last try to update the contact info | datetime | NO | | 0001-01-01 00:00:00 | | -| success_update | Date of the last successful contact update | datetime | NO | | 0001-01-01 00:00:00 | | -| failure_update | Date of the last failed update | datetime | NO | | 0001-01-01 00:00:00 | | -| name-date | | datetime | NO | | 0001-01-01 00:00:00 | | -| uri-date | | datetime | NO | | 0001-01-01 00:00:00 | | -| avatar-date | | datetime | NO | | 0001-01-01 00:00:00 | | -| term-date | | datetime | NO | | 0001-01-01 00:00:00 | | -| last-item | date of the last post | datetime | NO | | 0001-01-01 00:00:00 | | -| priority | | tinyint(3) | NO | | 0 | | -| blocked | | tinyint(1) | NO | | 1 | | -| readonly | posts of the contact are readonly | tinyint(1) | NO | | 0 | | -| writable | | tinyint(1) | NO | | 0 | | -| forum | contact is a forum | tinyint(1) | NO | | 0 | | -| prv | contact is a private group | tinyint(1) | NO | | 0 | | -| hidden | | tinyint(1) | NO | | 0 | | -| archive | | tinyint(1) | NO | | 0 | | -| pending | | tinyint(1) | NO | | 1 | | -| rating | | tinyint(1) | NO | | 0 | | -| reason | | text | NO | | NULL | | -| closeness | | tinyint(2) | NO | | 99 | | -| info | | mediumtext | NO | | NULL | | -| profile-id | | int(11) | NO | | 0 | | -| bdyear | | varchar(4) | NO | | | | -| bd | | date | NO | | 0001-01-01 | | -| notify_new_posts | | tinyint(1) | NO | | 0 | | -| fetch_further_information | | tinyint(1) | NO | | 0 | | -| ffi_keyword_denylist | | mediumtext | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | +| updated | Date of last contact update | datetime | NO | | 0001-01-01 00:00:00 | | +| self | 1 if the contact is the user him/her self | boolean | YES | | 0 | | +| remote_self | | boolean | YES | | 0 | | +| rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | 0 | | +| duplex | | boolean | YES | | 0 | | +| network | Network of the contact | char(4) | YES | | | | +| protocol | Protocol of the contact | char(4) | YES | | | | +| name | Name that this contact is known by | varchar(255) | YES | | | | +| nick | Nick- and user name of the contact | varchar(255) | YES | | | | +| location | | varchar(255) | NO | | | | +| about | | text | NO | | | | +| keywords | public keywords (interests) of the contact | text | NO | | | | +| gender | Deprecated | varchar(32) | YES | | | | +| xmpp | | varchar(255) | YES | | | | +| attag | | varchar(255) | YES | | | | +| avatar | | varchar(255) | YES | | | | +| photo | Link to the profile photo of the contact | varchar(255) | NO | | | | +| thumb | Link to the profile photo (thumb size) | varchar(255) | NO | | | | +| micro | Link to the profile photo (micro size) | varchar(255) | NO | | | | +| site-pubkey | | text | NO | | | | +| issued-id | | varchar(255) | YES | | | | +| dfrn-id | | varchar(255) | YES | | | | +| url | | varchar(255) | YES | | | | +| nurl | | varchar(255) | YES | | | | +| addr | | varchar(255) | YES | | | | +| alias | | varchar(255) | YES | | | | +| pubkey | RSA public key 4096 bit | text | NO | | | | +| prvkey | RSA private key 4096 bit | text | NO | | | | +| batch | | varchar(255) | YES | | | | +| request | | varchar(255) | NO | | | | +| notify | | varchar(255) | NO | | | | +| poll | | varchar(255) | NO | | | | +| confirm | | varchar(255) | NO | | | | +| subscribe | | varchar(255) | NO | | | | +| poco | | varchar(255) | NO | | | | +| aes_allow | | boolean | YES | | 0 | | +| ret-aes | | boolean | YES | | 0 | | +| usehub | | boolean | YES | | 0 | | +| subhub | | boolean | YES | | 0 | | +| hub-verify | | varchar(255) | YES | | | | +| last-update | Date of the last try to update the contact info | datetime | YES | | 0001-01-01 00:00:00 | | +| success_update | Date of the last successful contact update | datetime | YES | | 0001-01-01 00:00:00 | | +| failure_update | Date of the last failed update | datetime | YES | | 0001-01-01 00:00:00 | | +| failed | Connection failed | boolean | NO | | | | +| name-date | | datetime | YES | | 0001-01-01 00:00:00 | | +| uri-date | | datetime | YES | | 0001-01-01 00:00:00 | | +| avatar-date | | datetime | YES | | 0001-01-01 00:00:00 | | +| term-date | | datetime | YES | | 0001-01-01 00:00:00 | | +| last-item | date of the last post | datetime | YES | | 0001-01-01 00:00:00 | | +| last-discovery | date of the last follower discovery | datetime | YES | | 0001-01-01 00:00:00 | | +| priority | | tinyint unsigned | YES | | 0 | | +| blocked | Node-wide block status | boolean | YES | | 1 | | +| block_reason | Node-wide block reason | text | NO | | | | +| readonly | posts of the contact are readonly | boolean | YES | | 0 | | +| writable | | boolean | YES | | 0 | | +| forum | contact is a forum | boolean | YES | | 0 | | +| prv | contact is a private group | boolean | YES | | 0 | | +| contact-type | | tinyint | YES | | 0 | | +| manually-approve | | boolean | NO | | | | +| hidden | | boolean | YES | | 0 | | +| archive | | boolean | YES | | 0 | | +| pending | | boolean | YES | | 1 | | +| deleted | Contact has been deleted | boolean | YES | | 0 | | +| rating | | tinyint | YES | | 0 | | +| unsearchable | Contact prefers to not be searchable | boolean | YES | | 0 | | +| sensitive | Contact posts sensitive content | boolean | YES | | 0 | | +| baseurl | baseurl of the contact | varchar(255) | NO | | | | +| gsid | Global Server ID | int unsigned | NO | | | | +| reason | | text | NO | | | | +| closeness | | tinyint unsigned | YES | | 99 | | +| info | | mediumtext | NO | | | | +| profile-id | Deprecated | int unsigned | NO | | | | +| bdyear | | varchar(4) | YES | | | | +| bd | | date | YES | | 0001-01-01 | | +| notify_new_posts | | boolean | YES | | 0 | | +| fetch_further_information | | tinyint unsigned | YES | | 0 | | +| ffi_keyword_denylist | | text | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_conv.md b/doc/database/db_conv.md index f70191b88e..bcea6012d6 100644 --- a/doc/database/db_conv.md +++ b/doc/database/db_conv.md @@ -1,15 +1,16 @@ Table conv -========== +=========== +private messages -| Field | Description | Type | Null | Key | Default | Extra | -| ------- | ----------------------------------------- | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| guid | A unique identifier for this conversation | varchar(64) | NO | | | | -| recips | sender_handle;recipient_handle | mediumtext | NO | | NULL | | -| uid | user_id of the owner of this data | int(11) | NO | MUL | 0 | | -| creator | handle of creator | varchar(255) | NO | | | | -| created | creation timestamp | datetime | NO | | 0001-01-01 00:00:00 | | -| updated | edited timestamp | datetime | NO | | 0001-01-01 00:00:00 | | -| subject | subject of initial message | mediumtext | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| guid | A unique identifier for this conversation | varchar(255) | YES | | | | +| recips | sender_handle;recipient_handle | text | NO | | | | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| creator | handle of creator | varchar(255) | YES | | | | +| created | creation timestamp | datetime | YES | | 0001-01-01 00:00:00 | | +| updated | edited timestamp | datetime | YES | | 0001-01-01 00:00:00 | | +| subject | subject of initial message | text | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_conversation.md b/doc/database/db_conversation.md index 32d030cb15..e9ce966905 100644 --- a/doc/database/db_conversation.md +++ b/doc/database/db_conversation.md @@ -1,14 +1,16 @@ Table conversation -================== +=========== +Raw data and structure information for messages -| Field | Description | Type | Null | Key | Default | Extra | -|-------------------| ---------------------------------- |---------------------|------|-----|---------------------|----------------| -| item-uri | URI of the item | varbinary(255) | NO | PRI | NULL | | -| reply-to-uri | URI to which this item is a reply | varbinary(255) | NO | | | | -| conversation-uri | GNU Social conversation URI | varbinary(255) | NO | | | | -| conversation-href | GNU Social conversation link | varbinary(255) | NO | | | | -| protocol | The protocol of the item | tinyint(1) unsigned | NO | | 0 | | -| source | Original source | mediumtext | NO | | | | -| received | Receiving date | datetime | NO | | 0001-01-01 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| item-uri | Original URI of the item - unrelated to the table with the same name | varbinary(255) | YES | PRI | | | +| reply-to-uri | URI to which this item is a reply | varbinary(255) | YES | | | | +| conversation-uri | GNU Social conversation URI | varbinary(255) | YES | | | | +| conversation-href | GNU Social conversation link | varbinary(255) | YES | | | | +| protocol | The protocol of the item | tinyint unsigned | YES | | 255 | | +| direction | How the message arrived here: 1=push, 2=pull | tinyint unsigned | YES | | 0 | | +| source | Original source | mediumtext | NO | | | | +| received | Receiving date | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_delayed-post.md b/doc/database/db_delayed-post.md new file mode 100644 index 0000000000..3f83f49c24 --- /dev/null +++ b/doc/database/db_delayed-post.md @@ -0,0 +1,12 @@ +Table delayed-post +=========== +Posts that are about to be distributed at a later time + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| uri | URI of the post that will be distributed later | varchar(255) | NO | | | | +| uid | Owner User id | mediumint unsigned | NO | | | | +| delayed | delay time | datetime | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_diaspora-interaction.md b/doc/database/db_diaspora-interaction.md new file mode 100644 index 0000000000..f2906e9d27 --- /dev/null +++ b/doc/database/db_diaspora-interaction.md @@ -0,0 +1,10 @@ +Table diaspora-interaction +=========== +Signed Diaspora Interaction + +| 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 | | | +| interaction | The Diaspora interaction | mediumtext | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_event.md b/doc/database/db_event.md index 2c0650a8d8..9c46939f3c 100644 --- a/doc/database/db_event.md +++ b/doc/database/db_event.md @@ -1,26 +1,28 @@ Table event =========== +Events -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | ----------------------------------------------- -------| ------------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | user_id of the owner of this data | int(11) | NO | MUL | 0 | | -| cid | contact_id (ID of the contact in contact table) | int(11) | NO | | 0 | | -| uri | | varchar(255) | NO | | | | -| created | creation time | datetime | NO | | 0001-01-01 00:00:00 | | -| edited | last edit time | datetime | NO | | 0001-01-01 00:00:00 | | -| start | event start time | datetime | NO | | 0001-01-01 00:00:00 | | -| finish | event end time | datetime | NO | | 0001-01-01 00:00:00 | | -| summary | short description or title of the event | text | NO | | NULL | | -| desc | event description | text | NO | | NULL | | -| location | event location | text | NO | | NULL | | -| type | event or birthday | varchar(255) | NO | | | | -| nofinish | if event does have no end this is 1 | tinyint(1) | NO | | 0 | | -| adjust | adjust to timezone of the recipient (0 or 1) | tinyint(1) | NO | | 1 | | -| ignore | 0 or 1 | tinyint(1) unsigned | NO | | 0 | | -| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | NULL | | -| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | NULL | | -| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | NULL | | -| deny_gid | Access Control - list of denied groups | mediumtext | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| guid | | varchar(255) | YES | | | | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| cid | contact_id (ID of the contact in contact table) | int unsigned | YES | | 0 | | +| uri | | varchar(255) | YES | | | | +| created | creation time | datetime | YES | | 0001-01-01 00:00:00 | | +| edited | last edit time | datetime | YES | | 0001-01-01 00:00:00 | | +| start | event start time | datetime | YES | | 0001-01-01 00:00:00 | | +| finish | event end time | datetime | YES | | 0001-01-01 00:00:00 | | +| summary | short description or title of the event | text | NO | | | | +| desc | event description | text | NO | | | | +| location | event location | text | NO | | | | +| type | event or birthday | varchar(20) | YES | | | | +| nofinish | if event does have no end this is 1 | boolean | YES | | 0 | | +| adjust | adjust to timezone of the recipient (0 or 1) | boolean | YES | | 1 | | +| ignore | 0 or 1 | boolean | YES | | 0 | | +| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | | | +| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | | | +| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | | | +| deny_gid | Access Control - list of denied groups | mediumtext | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_fcontact.md b/doc/database/db_fcontact.md index d9a786acc9..ed468633d0 100644 --- a/doc/database/db_fcontact.md +++ b/doc/database/db_fcontact.md @@ -1,24 +1,25 @@ Table fcontact -============== +=========== +Diaspora compatible contacts - used in the Diaspora implementation -| Field | Description | Type | Null | Key | Default | Extra | -| -------- | ------------- | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| guid | unique id | varchar(64) | NO | | | | -| url | | varchar(255) | NO | | | | -| name | | varchar(255) | NO | | | | -| photo | | varchar(255) | NO | | | | -| request | | varchar(255) | NO | | | | -| nick | | varchar(255) | NO | | | | -| addr | | varchar(255) | NO | MUL | | | -| batch | | varchar(255) | NO | | | | -| notify | | varchar(255) | NO | | | | -| poll | | varchar(255) | NO | | | | -| confirm | | varchar(255) | NO | | | | -| priority | | tinyint(1) | NO | | 0 | | -| network | | varchar(32) | NO | | | | -| alias | | varchar(255) | NO | | | | -| pubkey | | text | NO | | NULL | | -| updated | | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| guid | unique id | varchar(255) | YES | | | | +| url | | varchar(255) | YES | | | | +| name | | varchar(255) | YES | | | | +| photo | | varchar(255) | YES | | | | +| request | | varchar(255) | YES | | | | +| nick | | varchar(255) | YES | | | | +| addr | | varchar(255) | YES | | | | +| batch | | varchar(255) | YES | | | | +| notify | | varchar(255) | YES | | | | +| poll | | varchar(255) | YES | | | | +| confirm | | varchar(255) | YES | | | | +| priority | | tinyint unsigned | YES | | 0 | | +| network | | char(4) | YES | | | | +| alias | | varchar(255) | YES | | | | +| pubkey | | text | NO | | | | +| updated | | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_fsuggest.md b/doc/database/db_fsuggest.md index e461895c80..66865b5063 100644 --- a/doc/database/db_fsuggest.md +++ b/doc/database/db_fsuggest.md @@ -1,16 +1,17 @@ Table fsuggest -============== +=========== +friend suggestion stuff -| Field | Description | Type | Null | Key | Default | Extra | -| ------- | ----------- | ------------ | ---- | --- | ------------------- | --------------- | -| id | | int(11) | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | | 0 | | -| cid | | int(11) | NO | | 0 | | -| name | | varchar(255) | NO | | | | -| url | | varchar(255) | NO | | | | -| request | | varchar(255) | NO | | | | -| photo | | varchar(255) | NO | | | | -| note | | text | NO | | NULL | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| cid | | int unsigned | YES | | 0 | | +| name | | varchar(255) | YES | | | | +| url | | varchar(255) | YES | | | | +| request | | varchar(255) | YES | | | | +| photo | | varchar(255) | YES | | | | +| note | | text | NO | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_group.md b/doc/database/db_group.md index f27b9a75f7..f4f60436cd 100644 --- a/doc/database/db_group.md +++ b/doc/database/db_group.md @@ -1,12 +1,13 @@ Table group =========== +privacy groups, group info -| Field | Description | Type | Null | Key | Default | Extra | -| ------- | ------------------------------------------ | ---------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id owning this data | int(10) unsigned | NO | MUL | 0 | | -| visible | 1 indicates the member list is not private | tinyint(1) | NO | | 0 | | -| deleted | 1 indicates the group has been deleted | tinyint(1) | NO | | 0 | | -| name | human readable name of group | varchar(255) | NO | | | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| visible | 1 indicates the member list is not private | boolean | YES | | 0 | | +| deleted | 1 indicates the group has been deleted | boolean | YES | | 0 | | +| name | human readable name of group | varchar(255) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_group_member.md b/doc/database/db_group_member.md index f8a402ef6e..a4ecfdf7db 100644 --- a/doc/database/db_group_member.md +++ b/doc/database/db_group_member.md @@ -1,11 +1,11 @@ Table group_member -================== +=========== +privacy groups, member info -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | ----------------------------------------------------------- | ---------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(10) unsigned | NO | MUL | 0 | | -| gid | groups.id of the associated group | int(10) unsigned | NO | | 0 | | -| contact-id | contact.id of the member assigned to the associated group | int(10) unsigned | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| gid | groups.id of the associated group | int unsigned | YES | | 0 | | +| contact-id | contact.id of the member assigned to the associated group | int unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_gserver-tag.md b/doc/database/db_gserver-tag.md new file mode 100644 index 0000000000..96a5f02f49 --- /dev/null +++ b/doc/database/db_gserver-tag.md @@ -0,0 +1,10 @@ +Table gserver-tag +=========== +Tags that the server has subscribed + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| gserver-id | The id of the gserver | int unsigned | YES | PRI | 0 | | +| tag | Tag that the server has subscribed | varchar(100) | YES | PRI | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_gserver.md b/doc/database/db_gserver.md index d9ec69a53c..919363def7 100644 --- a/doc/database/db_gserver.md +++ b/doc/database/db_gserver.md @@ -1,24 +1,31 @@ Table gserver -============= - -| Field | Description | Type | Null | Key | Default | Extra | -|------------------|---------------------------|------------------|------|-----|---------------------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| url | | varchar(255) | NO | | | | -| nurl | | varchar(255) | NO | MUL | | | -| version | | varchar(255) | NO | | | | -| site_name | | varchar(255) | NO | | | | -| info | | text | NO | | NULL | | -| register_policy | | tinyint(1) | NO | | 0 | | -| registered-users |Number of registered users | int(10) | NO | | 0 | | -| poco | | varchar(255) | NO | | | | -| noscrape | | varchar(255) | NO | | | | -| network | | varchar(32) | NO | | | | -| platform | | varchar(255) | NO | | | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | -| last_poco_query | | datetime | YES | | 0001-01-01 00:00:00 | | -| last_contact | | datetime | YES | | 0001-01-01 00:00:00 | | -| last_failure | | datetime | YES | | 0001-01-01 00:00:00 | | +=========== +Global servers +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| url | | varchar(255) | YES | | | | +| nurl | | varchar(255) | YES | | | | +| version | | varchar(255) | YES | | | | +| site_name | | varchar(255) | YES | | | | +| info | | text | NO | | | | +| register_policy | | tinyint | YES | | 0 | | +| registered-users | Number of registered users | int unsigned | YES | | 0 | | +| directory-type | Type of directory service (Poco, Mastodon) | tinyint | NO | | 0 | | +| poco | | varchar(255) | YES | | | | +| noscrape | | varchar(255) | YES | | | | +| network | | char(4) | YES | | | | +| protocol | The protocol of the server | tinyint unsigned | NO | | | | +| platform | | varchar(255) | YES | | | | +| relay-subscribe | Has the server subscribed to the relay system | boolean | YES | | 0 | | +| relay-scope | The scope of messages that the server wants to get | varchar(10) | YES | | | | +| detection-method | Method that had been used to detect that server | tinyint unsigned | NO | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | +| last_poco_query | | datetime | NO | | 0001-01-01 00:00:00 | | +| last_contact | Last successful connection request | datetime | NO | | 0001-01-01 00:00:00 | | +| last_failure | Last failed connection request | datetime | NO | | 0001-01-01 00:00:00 | | +| failed | Connection failed | boolean | NO | | | | +| next_contact | Next connection request | datetime | NO | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_hook.md b/doc/database/db_hook.md index 06eb84a182..71be258f3d 100644 --- a/doc/database/db_hook.md +++ b/doc/database/db_hook.md @@ -1,12 +1,13 @@ Table hook -========== +=========== +addon hook registry -| Field | Description | Type | Null | Key | Default | Extra | -| -------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| hook | name of hook | varchar(255) | NO | MUL | | | -| file | relative filename of hook handler | varchar(255) | NO | | | | -| function | function name of hook handler | varchar(255) | NO | | | | -| priority | not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order | int(11) unsigned | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| hook | name of hook | varbinary(100) | YES | | | | +| file | relative filename of hook handler | varbinary(200) | YES | | | | +| function | function name of hook handler | varbinary(200) | YES | | | | +| priority | not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order | smallint unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_host.md b/doc/database/db_host.md new file mode 100644 index 0000000000..0ce2932286 --- /dev/null +++ b/doc/database/db_host.md @@ -0,0 +1,10 @@ +Table host +=========== +Hostname + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | tinyint unsigned | YES | PRI | | auto_increment | +| name | The hostname | varchar(128) | YES | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_inbox-status.md b/doc/database/db_inbox-status.md new file mode 100644 index 0000000000..93e99dc5d4 --- /dev/null +++ b/doc/database/db_inbox-status.md @@ -0,0 +1,15 @@ +Table inbox-status +=========== +Status of ActivityPub inboxes + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| url | URL of the inbox | varbinary(255) | YES | PRI | | | +| created | Creation date of this entry | datetime | YES | | 0001-01-01 00:00:00 | | +| success | Date of the last successful delivery | datetime | YES | | 0001-01-01 00:00:00 | | +| failure | Date of the last failed delivery | datetime | YES | | 0001-01-01 00:00:00 | | +| previous | Previous delivery date | datetime | YES | | 0001-01-01 00:00:00 | | +| archive | Is the inbox archived? | boolean | YES | | 0 | | +| shared | Is it a shared inbox? | boolean | YES | | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_intro.md b/doc/database/db_intro.md index a71154a4f9..a05494de5c 100644 --- a/doc/database/db_intro.md +++ b/doc/database/db_intro.md @@ -1,18 +1,19 @@ Table intro =========== -| Field | Description | Type | Null | Key | Default | Extra | -|------------|------------------|------------------|------|-----|---------------------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | | int(10) unsigned | NO | | 0 | | -| fid | | int(11) | NO | | 0 | | -| contact-id | | int(11) | NO | | 0 | | -| knowyou | | tinyint(1) | NO | | 0 | | -| duplex | | tinyint(1) | NO | | 0 | | -| note | | text | NO | | NULL | | -| hash | | varchar(255) | NO | | | | -| datetime | | datetime | NO | | 0001-01-01 00:00:00 | | -| blocked | | tinyint(1) | NO | | 1 | | -| ignore | | tinyint(1) | NO | | 0 | | + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| fid | | int unsigned | NO | | | | +| contact-id | | int unsigned | YES | | 0 | | +| knowyou | | boolean | YES | | 0 | | +| duplex | | boolean | YES | | 0 | | +| note | | text | NO | | | | +| hash | | varchar(255) | YES | | | | +| datetime | | datetime | YES | | 0001-01-01 00:00:00 | | +| blocked | | boolean | YES | | 1 | | +| ignore | | boolean | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_item-uri.md b/doc/database/db_item-uri.md new file mode 100644 index 0000000000..5f1d447147 --- /dev/null +++ b/doc/database/db_item-uri.md @@ -0,0 +1,11 @@ +Table item-uri +=========== +URI and GUID for items + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| uri | URI of an item | varbinary(255) | YES | | | | +| guid | A unique identifier for an item | varbinary(255) | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_item.md b/doc/database/db_item.md deleted file mode 100644 index d24d92bad8..0000000000 --- a/doc/database/db_item.md +++ /dev/null @@ -1,72 +0,0 @@ -Table item -========== - -| Field | Description | Type | Null | Key | Default | Extra | -|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|------|-----|---------------------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| guid | A unique identifier for this item | varchar(255) | NO | MUL | | | -| uri | | varchar(255) | NO | MUL | | | -| uid | user.id which owns this copy of the item | int(10) unsigned | NO | MUL | 0 | | -| contact-id | contact.id | int(11) | NO | MUL | 0 | | -| gcontact-id | ID of the global contact | int(11) | NO | MUL | 0 | | -| type | | varchar(255) | NO | | | | -| wall | This item was posted to the wall of uid | tinyint(1) | NO | MUL | 0 | | -| gravity | | tinyint(1) | NO | | 0 | | -| parent | item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item | int(10) unsigned | NO | MUL | 0 | | -| parent-uri | uri of the parent to this item | varchar(255) | NO | MUL | | | -| extid | | varchar(255 | NO | MUL | | | -| thr-parent | If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri | varchar(255) | NO | | | | -| 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 | | -| commented | Date of last comment/reply to this item | datetime | NO | | 0001-01-01 00:00:00 | | -| received | datetime | datetime | NO | | 0001-01-01 00:00:00 | | -| changed | Date that something in the conversation changed, indicating clients should fetch the conversation again | datetime | NO | | 0001-01-01 00:00:00 | | -| owner-name | Name of the owner of this item | varchar(255) | NO | | | | -| owner-link | Link to the profile page of the owner of this item | varchar(255) | NO | | | | -| owner-avatar | Link to the avatar picture of the owner of this item | varchar(255) | NO | | | | -| owner-id | Link to the contact table with uid=0 of the owner of this item | int(11) | NO | MUL | 0 | | -| author-name | Name of the author of this item | varchar(255) | NO | | | | -| author-link | Link to the profile page of the author of this item | varchar(255) | NO | | | | -| author-avatar | Link to the avatar picture of the author of this item | varchar(255) | NO | | | | -| author-id | Link to the contact table with uid=0 of the author of this item | int(11) | NO | MUL | 0 | | -| title | item title | varchar(255) | NO | | | | -| body | item body content | mediumtext | NO | | NULL | | -| app | application which generated this item | varchar(255) | NO | | | | -| verb | ActivityStreams verb | varchar(255) | NO | | | | -| object-type | ActivityStreams object type | varchar(255) | NO | | | | -| object | JSON encoded object structure unless it is an implied object (normal post) | text | NO | | NULL | | -| target-type | ActivityStreams target type if applicable (URI) | varchar(255) | NO | | | | -| target | JSON encoded target structure if used | text | NO | | NULL | | -| postopts | External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery | text | NO | | NULL | | -| plink | permalink or URL toa displayable copy of the message at its source | varchar(255) | NO | | | | -| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(255) | NO | MUL | | | -| event-id | Used to link to the event.id | int(11) | NO | | 0 | | -| tag | | mediumtext | NO | | NULL | | -| attach | JSON structure representing attachments to this item | mediumtext | NO | | NULL | | -| inform | | mediumtext | NO | | NULL | | -| file | | mediumtext | NO | | NULL | | -| location | text location where this item originated | varchar(255) | NO | | | | -| coord | longitude/latitude pair representing location where this item originated | varchar(255) | NO | | | | -| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | NULL | | -| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | NULL | | -| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | NULL | | -| deny_gid | Access Control - list of denied groups | mediumtext | NO | | NULL | | -| private | distribution is restricted | tinyint(1) | NO | | 0 | | -| pubmail | | tinyint(1) | NO | | 0 | | -| moderated | | tinyint(1) | NO | | 0 | | -| visible | | tinyint(1) | NO | | 0 | | -| spam | | tinyint(1) | NO | | 0 | | -| starred | item has been favourited | tinyint(1) | NO | | 0 | | -| bookmark | item has been bookmarked | tinyint(1) | NO | | 0 | | -| unseen | item has not been seen | tinyint(1) | NO | | 1 | | -| deleted | item has been deleted | tinyint(1) | NO | MUL | 0 | | -| origin | item originated at this site | tinyint(1) | NO | | 0 | | -| forum_mode | | tinyint(1) | NO | | 0 | | -| last-child | | tinyint(1) unsigned | NO | | 1 | | -| mention | The owner of this item was mentioned in it | tinyint(1) | NO | | 0 | | -| network | Network from where the item comes from | varchar(32) | NO | | | | -| rendered-hash | | varchar(32) | NO | | | | -| rendered-html | item.body converted to html | mediumtext | NO | | NULL | | -| global | | tinyint(1) | NO | | 0 | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_locks.md b/doc/database/db_locks.md index 4de6fbf961..3c219c2cc5 100644 --- a/doc/database/db_locks.md +++ b/doc/database/db_locks.md @@ -1,11 +1,13 @@ Table locks =========== -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|------------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| name | | varchar(128) | NO | | | | -| locked | | tinyint(1) | NO | | 0 | | -| pid | Process ID | int(10) unsigned | NO | | 0 | | + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| name | | varchar(128) | YES | | | | +| locked | | boolean | YES | | 0 | | +| pid | Process ID | int unsigned | YES | | 0 | | +| expires | datetime of cache expiration | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_mail.md b/doc/database/db_mail.md index 623b8c9c85..43c9baf33c 100644 --- a/doc/database/db_mail.md +++ b/doc/database/db_mail.md @@ -1,24 +1,30 @@ Table mail -========== +=========== +private messages -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | -------------------------------------------- | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(10) unsigned | NO | MUL | 0 | | -| guid | A unique identifier for this private message | int(10) unsigned | NO | MUL | | | -| from-name | name of the sender | varchar(255) | NO | | | | -| from-photo | contact photo link of the sender | varchar(255) | NO | | | | -| from-url | profile linke of the sender | varchar(255) | NO | | | | -| contact-id | contact.id | varchar(255) | NO | | | | -| convid | conv.id | int(11) unsigned | NO | MUL | 0 | | -| title | | varchar(255) | NO | | | | -| body | | mediumtext | NO | | NULL | | -| seen | if message visited it is 1 | varchar(255) | NO | | 0 | | -| reply | | varchar(255) | NO | MUL | 0 | | -| replied | | varchar(255) | NO | | 0 | | -| unknown | if sender not in the contact table this is 1 | varchar(255) | NO | | 0 | | -| uri | | varchar(255) | NO | MUL | | | -| parent-uri | | varchar(255) | NO | MUL | | | -| created | creation time of the private message | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| guid | A unique identifier for this private message | varchar(255) | YES | | | | +| from-name | name of the sender | varchar(255) | YES | | | | +| from-photo | contact photo link of the sender | varchar(255) | YES | | | | +| from-url | profile linke of the sender | varchar(255) | YES | | | | +| contact-id | contact.id | varchar(255) | NO | | | | +| author-id | Link to the contact table with uid=0 of the author of the mail | int unsigned | NO | | | | +| convid | conv.id | int unsigned | NO | | | | +| title | | varchar(255) | YES | | | | +| body | | mediumtext | NO | | | | +| seen | if message visited it is 1 | boolean | YES | | 0 | | +| reply | | boolean | YES | | 0 | | +| replied | | boolean | YES | | 0 | | +| unknown | if sender not in the contact table this is 1 | boolean | YES | | 0 | | +| uri | | varchar(255) | YES | | | | +| uri-id | Item-uri id of the related mail | int unsigned | NO | | | | +| parent-uri | | varchar(255) | YES | | | | +| parent-uri-id | Item-uri id of the parent of the related mail | int unsigned | NO | | | | +| thr-parent | | varchar(255) | NO | | | | +| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | NO | | | | +| created | creation time of the private message | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_mailacct.md b/doc/database/db_mailacct.md index 9f6484f818..2c2b4e7af4 100644 --- a/doc/database/db_mailacct.md +++ b/doc/database/db_mailacct.md @@ -1,20 +1,21 @@ Table mailacct -============== +=========== +Mail account data for fetching mails -| Field | Description | Type | Null | Key | Default | Extra | -|--------------|------------------|--------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | | 0 | | -| server | | varchar(255) | NO | | | | -| port | | int(11) | NO | | 0 | | -| ssltype | | varchar(16) | NO | | | | -| mailbox | | varchar(255) | NO | | | | -| user | | varchar(255) | NO | | | | -| pass | | text | NO | | NULL | | -| reply_to | | varchar(255) | NO | | | | -| action | | int(11) | NO | | 0 | | -| movetofolder | | varchar(255) | NO | | | | -| pubmail | | tinyint(1) | NO | | 0 | | -| last_check | | datetime | NO | | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| server | | varchar(255) | YES | | | | +| port | | smallint unsigned | YES | | 0 | | +| ssltype | | varchar(16) | YES | | | | +| mailbox | | varchar(255) | YES | | | | +| user | | varchar(255) | YES | | | | +| pass | | text | NO | | | | +| reply_to | | varchar(255) | YES | | | | +| action | | tinyint unsigned | YES | | 0 | | +| movetofolder | | varchar(255) | YES | | | | +| pubmail | | boolean | YES | | 0 | | +| last_check | | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_manage.md b/doc/database/db_manage.md index 4cfc1d0a11..94994ec9b0 100644 --- a/doc/database/db_manage.md +++ b/doc/database/db_manage.md @@ -1,10 +1,11 @@ Table manage -============ +=========== +table of accounts that can manage each other -| Field | Description | Type | Null | Key | Default | Extra | -| ----- | ------------- | ------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | user.id | int(11) | NO | MUL | 0 | | -| mid | | int(11) | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| mid | User id | mediumint unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_notification.md b/doc/database/db_notification.md new file mode 100644 index 0000000000..f4e524d73c --- /dev/null +++ b/doc/database/db_notification.md @@ -0,0 +1,17 @@ +Table notification +=========== +notifications + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | NO | | | | +| vid | Id of the verb table entry that contains the activity verbs | smallint unsigned | NO | | | | +| type | | tinyint unsigned | NO | | | | +| actor-id | Link to the contact table with uid=0 of the actor that caused the notification | int unsigned | NO | | | | +| target-uri-id | Item-uri id of the related post | int unsigned | NO | | | | +| parent-uri-id | Item-uri id of the parent of the related post | int unsigned | NO | | | | +| created | | datetime | NO | | | | +| seen | | boolean | NO | | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_notify-threads.md b/doc/database/db_notify-threads.md index 5c196628d4..a788e82242 100644 --- a/doc/database/db_notify-threads.md +++ b/doc/database/db_notify-threads.md @@ -1,12 +1,14 @@ Table notify-threads -==================== +=========== -| Field | Description | Type | Null | Key | Default | Extra | -|--------------------|------------------|------------------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| notify-id | | int(11) | NO | | 0 | | -| master-parent-item | | int(10) unsigned | NO | MUL | 0 | | -| parent-item | | int(10) unsigned | NO | | 0 | | -| receiver-uid | | int(11) | NO | MUL | 0 | | + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| notify-id | | int unsigned | YES | | 0 | | +| master-parent-item | Deprecated | int unsigned | NO | | | | +| master-parent-uri-id | Item-uri id of the parent of the related post | int unsigned | NO | | | | +| parent-item | | int unsigned | YES | | 0 | | +| receiver-uid | User id | mediumint unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_notify.md b/doc/database/db_notify.md index fbf0db7705..360e93ba24 100644 --- a/doc/database/db_notify.md +++ b/doc/database/db_notify.md @@ -1,24 +1,26 @@ Table notify -============ +=========== +notifications -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | --------------------------------- | ------------ | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| hash | | varchar(64) | NO | | | | -| type | | int(11) | NO | | 0 | | -| name | | varchar(255) | NO | | | | -| url | | varchar(255) | NO | | | | -| photo | | varchar(255) | NO | | | | -| date | | datetime | NO | | 0001-01-01 00:00:00 | | -| msg | | mediumtext | YES | | NULL | | -| uid | user.id of the owner of this data | int(11) | NO | MUL | 0 | | -| link | | varchar(255) | NO | | | | -| iid | item.id | int(11) | NO | | 0 | | -| parent | | int(11) | NO | | 0 | | -| seen | | tinyint(1) | NO | | 0 | | -| verb | | varchar(255) | NO | | | | -| otype | | varchar(16) | NO | | | | -| name_cache | Cached bbcode parsing of name | tinytext | YES | | NULL | | -| msg_cache | Cached bbcode parsing of msg | mediumtext | YES | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| type | | smallint unsigned | YES | | 0 | | +| name | | varchar(255) | YES | | | | +| url | | varchar(255) | YES | | | | +| photo | | varchar(255) | YES | | | | +| date | | datetime | YES | | 0001-01-01 00:00:00 | | +| msg | | mediumtext | NO | | | | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| link | | varchar(255) | YES | | | | +| iid | | int unsigned | NO | | | | +| parent | | int unsigned | NO | | | | +| uri-id | Item-uri id of the related post | int unsigned | NO | | | | +| parent-uri-id | Item-uri id of the parent of the related post | int unsigned | NO | | | | +| seen | | boolean | YES | | 0 | | +| verb | | varchar(100) | YES | | | | +| otype | | varchar(10) | YES | | | | +| name_cache | Cached bbcode parsing of name | tinytext | NO | | | | +| msg_cache | Cached bbcode parsing of msg | mediumtext | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_oembed.md b/doc/database/db_oembed.md index 651a52e740..e08af5f010 100644 --- a/doc/database/db_oembed.md +++ b/doc/database/db_oembed.md @@ -1,11 +1,12 @@ Table oembed -============ +=========== +cache for OEmbed queries -| Field | Description | Type | Null | Key | Default | Extra | -| ------------ | ---------------------------------- | ------------ | ---- | --- | ------------------- | ----- | -| url | page url | varchar(255) | NO | PRI | NULL | | -| maxwidth | Maximum width passed to Oembed | int(11) | NO | PRI | 0 | | -| content | OEmbed data of the page | text | NO | | NULL | | -| created | datetime of creation | datetime | NO | MUL | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| url | page url | varbinary(255) | YES | PRI | | | +| maxwidth | Maximum width passed to Oembed | mediumint unsigned | YES | PRI | | | +| content | OEmbed data of the page | mediumtext | NO | | | | +| created | datetime of creation | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_openwebauth-token.md b/doc/database/db_openwebauth-token.md new file mode 100644 index 0000000000..98fa7b6a41 --- /dev/null +++ b/doc/database/db_openwebauth-token.md @@ -0,0 +1,14 @@ +Table openwebauth-token +=========== +Store OpenWebAuth token to verify contacts + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id - currently unused | mediumint unsigned | YES | | 0 | | +| type | Verify type | varchar(32) | YES | | | | +| token | A generated token | varchar(255) | YES | | | | +| meta | | varchar(255) | YES | | | | +| created | datetime of creation | datetime | YES | | 0001-01-01 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_parsed_url.md b/doc/database/db_parsed_url.md index 343e5a8bed..9b2912ccea 100644 --- a/doc/database/db_parsed_url.md +++ b/doc/database/db_parsed_url.md @@ -1,12 +1,15 @@ Table parsed_url -================ +=========== +cache for 'parse_url' queries -| Field | Description | Type | Null | Key | Default | Extra | -| ------------ | ---------------------------------- | ------------ | ---- | --- | ------------------- | ----- | -| url | page url | varchar(255) | NO | PRI | NULL | | -| guessing | is the "guessing" mode active? | tinyint(1) | NO | PRI | 0 | | -| oembed | is the data the result of oembed? | tinyint(1) | NO | PRI | 0 | | -| content | page data | text | NO | | NULL | | -| created | datetime of creation | datetime | NO | MUL | 0001-01-01 00:00:00 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| url_hash | page url hash | binary(64) | YES | PRI | | | +| guessing | is the 'guessing' mode active? | boolean | YES | PRI | 0 | | +| oembed | is the data the result of oembed? | boolean | YES | PRI | 0 | | +| url | page url | text | YES | | | | +| content | page data | mediumtext | NO | | | | +| created | datetime of creation | datetime | YES | | 0001-01-01 00:00:00 | | +| expires | datetime of expiration | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_pconfig.md b/doc/database/db_pconfig.md index a4ed10a359..2bffcff5ad 100644 --- a/doc/database/db_pconfig.md +++ b/doc/database/db_pconfig.md @@ -1,12 +1,13 @@ -Table pconfic -============= +Table pconfig +=========== +personal (per user) configuration storage -| Field | Description | Type | Null | Key | Default | Extra | -|-------|-------------|------------|------|-----|---------|----------------| -| id | | int(11) | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | MUL | 0 | | -| cat | | char(255) | NO | | | | -| k | | char(255) | NO | | | | -| v | | mediumtext | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | Primary key | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| cat | Category | varchar(50) | YES | | | | +| k | Key | varchar(100) | YES | | | | +| v | Value | mediumtext | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_permissionset.md b/doc/database/db_permissionset.md new file mode 100644 index 0000000000..0e60ff3800 --- /dev/null +++ b/doc/database/db_permissionset.md @@ -0,0 +1,14 @@ +Table permissionset +=========== + + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner id of this permission set | mediumint unsigned | YES | | 0 | | +| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | | | +| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | | | +| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | | | +| deny_gid | Access Control - list of denied groups | mediumtext | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_photo.md b/doc/database/db_photo.md index 2bb7473e21..ef8f2b1824 100644 --- a/doc/database/db_photo.md +++ b/doc/database/db_photo.md @@ -1,29 +1,35 @@ Table photo =========== +photo storage -| Field | Description | Type | Null | Key | Default | Extra | -| ----------- | ------------------------------------------------------ | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(10) unsigned | NO | MUL | 0 | | -| contact-id | contact.id | int(10) unsigned | NO | | 0 | | -| guid | A unique identifier for this photo | varchar(64) | NO | MUL | | | -| resource-id | | varchar(255) | NO | MUL | | | -| created | creation date | datetime | NO | | 0001-01-01 00:00:00 | | -| edited | last edited date | datetime | NO | | 0001-01-01 00:00:00 | | -| title | | varchar(255) | NO | | | | -| desc | | text | NO | | NULL | | -| album | The name of the album to which the photo belongs | varchar(255) | NO | | | | -| filename | | varchar(255) | NO | | | | -| type | image type | varchar(128) | NO | | image/jpeg | | -| height | | smallint(6) | NO | | 0 | | -| width | | smallint(6) | NO | | 0 | | -| size | | int(10) unsigned | NO | | 0 | | -| data | | mediumblob | NO | | NULL | | -| scale | | tinyint(3) | NO | | 0 | | -| profile | | tinyint(1) | NO | | 0 | | -| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | NULL | | -| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | NULL | | -| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | NULL | | -| deny_gid | Access Control - list of denied groups | mediumtext | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| contact-id | contact.id | int unsigned | YES | | 0 | | +| guid | A unique identifier for this photo | char(16) | YES | | | | +| resource-id | | char(32) | YES | | | | +| hash | hash value of the photo | char(32) | NO | | | | +| created | creation date | datetime | YES | | 0001-01-01 00:00:00 | | +| edited | last edited date | datetime | YES | | 0001-01-01 00:00:00 | | +| title | | varchar(255) | YES | | | | +| desc | | text | NO | | | | +| album | The name of the album to which the photo belongs | varchar(255) | YES | | | | +| filename | | varchar(255) | YES | | | | +| type | | varchar(30) | YES | | image/jpeg | | +| height | | smallint unsigned | YES | | 0 | | +| width | | smallint unsigned | YES | | 0 | | +| datasize | | int unsigned | YES | | 0 | | +| data | | mediumblob | YES | | | | +| scale | | tinyint unsigned | YES | | 0 | | +| profile | | boolean | YES | | 0 | | +| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | | | +| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | | | +| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | | | +| deny_gid | Access Control - list of denied groups | mediumtext | NO | | | | +| accessible | Make photo publicly accessible, ignoring permissions | boolean | YES | | 0 | | +| backend-class | Storage backend class | tinytext | NO | | | | +| backend-ref | Storage backend data reference | text | NO | | | | +| updated | | datetime | YES | | 0001-01-01 00:00:00 | | Return to [database documentation](help/database) diff --git a/doc/database/db_poll.md b/doc/database/db_poll.md deleted file mode 100644 index fd89b345c1..0000000000 --- a/doc/database/db_poll.md +++ /dev/null @@ -1,19 +0,0 @@ -Table poll -========== - -| Field | Description | Type | Null | Key | Default | Extra | -|-------|-------------|------------|------|-----|---------|----------------| -| id | | int(11) | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | MUL | 0 | | -| q0 | | mediumtext | NO | | NULL | | -| q1 | | mediumtext | NO | | NULL | | -| q2 | | mediumtext | NO | | NULL | | -| q3 | | mediumtext | NO | | NULL | | -| q4 | | mediumtext | NO | | NULL | | -| q5 | | mediumtext | NO | | NULL | | -| q6 | | mediumtext | NO | | NULL | | -| q7 | | mediumtext | NO | | NULL | | -| q8 | | mediumtext | NO | | NULL | | -| q9 | | mediumtext | NO | | NULL | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_poll_result.md b/doc/database/db_poll_result.md deleted file mode 100644 index 5a732d0adf..0000000000 --- a/doc/database/db_poll_result.md +++ /dev/null @@ -1,10 +0,0 @@ -Table poll_result -================= - -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|---------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| poll_id | | int(11) | NO | MUL | 0 | | -| choice | | int(11) | NO | MUL | 0 | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_post-category.md b/doc/database/db_post-category.md new file mode 100644 index 0000000000..3765072d0e --- /dev/null +++ b/doc/database/db_post-category.md @@ -0,0 +1,12 @@ +Table post-category +=========== +post relation to categories + +| 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 | | | +| uid | User id | mediumint unsigned | YES | PRI | 0 | | +| type | | tinyint unsigned | YES | PRI | 0 | | +| tid | | int unsigned | YES | PRI | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-content.md b/doc/database/db_post-content.md new file mode 100644 index 0000000000..65e051cbdb --- /dev/null +++ b/doc/database/db_post-content.md @@ -0,0 +1,25 @@ +Table post-content +=========== +Content 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 | | | +| title | item title | varchar(255) | YES | | | | +| content-warning | | varchar(255) | YES | | | | +| body | item body content | mediumtext | NO | | | | +| raw-body | Body without embedded media links | mediumtext | NO | | | | +| location | text location where this item originated | varchar(255) | YES | | | | +| coord | longitude/latitude pair representing location where this item originated | varchar(255) | YES | | | | +| language | Language information about this post | text | NO | | | | +| app | application which generated this item | varchar(255) | YES | | | | +| rendered-hash | | varchar(32) | YES | | | | +| rendered-html | item.body converted to html | mediumtext | NO | | | | +| object-type | ActivityStreams object type | varchar(100) | YES | | | | +| object | JSON encoded object structure unless it is an implied object (normal post) | text | NO | | | | +| target-type | ActivityStreams target type if applicable (URI) | varchar(100) | YES | | | | +| target | JSON encoded target structure if used | text | NO | | | | +| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(32) | YES | | | | +| plink | permalink or URL to a displayable copy of the message at its source | varchar(255) | YES | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-delivery-data.md b/doc/database/db_post-delivery-data.md new file mode 100644 index 0000000000..d9efbe1804 --- /dev/null +++ b/doc/database/db_post-delivery-data.md @@ -0,0 +1,19 @@ +Table post-delivery-data +=========== +Delivery data for items + +| 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 | | | +| postopts | External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery | text | NO | | | | +| inform | Additional receivers of the linked item | mediumtext | NO | | | | +| queue_count | Initial number of delivery recipients, used as item.delivery_queue_count | mediumint | YES | | 0 | | +| queue_done | Number of successful deliveries, used as item.delivery_queue_done | mediumint | YES | | 0 | | +| queue_failed | Number of unsuccessful deliveries, used as item.delivery_queue_failed | mediumint | YES | | 0 | | +| activitypub | Number of successful deliveries via ActivityPub | mediumint | YES | | 0 | | +| dfrn | Number of successful deliveries via DFRN | mediumint | YES | | 0 | | +| legacy_dfrn | Number of successful deliveries via legacy DFRN | mediumint | YES | | 0 | | +| diaspora | Number of successful deliveries via Diaspora | mediumint | YES | | 0 | | +| ostatus | Number of successful deliveries via OStatus | mediumint | YES | | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-media.md b/doc/database/db_post-media.md new file mode 100644 index 0000000000..4115301c0a --- /dev/null +++ b/doc/database/db_post-media.md @@ -0,0 +1,27 @@ +Table post-media +=========== +Attached media + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | YES | | | | +| url | Media URL | varbinary(511) | YES | | | | +| type | Media type | tinyint unsigned | YES | | 0 | | +| mimetype | | varchar(60) | NO | | | | +| height | Height of the media | smallint unsigned | NO | | | | +| width | Width of the media | smallint unsigned | NO | | | | +| size | Media size | int unsigned | NO | | | | +| preview | Preview URL | varbinary(255) | NO | | | | +| preview-height | Height of the preview picture | smallint unsigned | NO | | | | +| preview-width | Width of the preview picture | smallint unsigned | NO | | | | +| description | | text | NO | | | | +| name | Name of the media | varchar(255) | NO | | | | +| author-url | URL of the author of the media | varbinary(255) | NO | | | | +| author-name | Name of the author of the media | varchar(255) | NO | | | | +| author-image | Image of the author of the media | varbinary(255) | NO | | | | +| publisher-url | URL of the publisher of the media | varbinary(255) | NO | | | | +| publisher-name | Name of the publisher of the media | varchar(255) | NO | | | | +| publisher-image | Image of the publisher of the media | varbinary(255) | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-tag.md b/doc/database/db_post-tag.md new file mode 100644 index 0000000000..6beccad706 --- /dev/null +++ b/doc/database/db_post-tag.md @@ -0,0 +1,12 @@ +Table post-tag +=========== +post relation to tags + +| 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 | | | +| type | | tinyint unsigned | YES | PRI | 0 | | +| tid | | int unsigned | YES | PRI | 0 | | +| cid | Contact id of the mentioned public contact | int unsigned | YES | PRI | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-thread-user.md b/doc/database/db_post-thread-user.md new file mode 100644 index 0000000000..375728050d --- /dev/null +++ b/doc/database/db_post-thread-user.md @@ -0,0 +1,31 @@ +Table post-thread-user +=========== +Thread related data per user + +| 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 | | | +| owner-id | Item owner | int unsigned | YES | | 0 | | +| author-id | Item author | 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 | | | | +| network | | char(4) | YES | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | +| received | | datetime | YES | | 0001-01-01 00:00:00 | | +| changed | Date that something in the conversation changed, indicating clients should fetch the conversation again | datetime | YES | | 0001-01-01 00:00:00 | | +| commented | | datetime | YES | | 0001-01-01 00:00:00 | | +| uid | Owner id which owns this copy of the item | mediumint unsigned | YES | PRI | 0 | | +| pinned | The thread is pinned on the profile page | boolean | YES | | 0 | | +| starred | | boolean | YES | | 0 | | +| ignored | Ignore updates for this thread | boolean | YES | | 0 | | +| wall | This item was posted to the wall of uid | boolean | YES | | 0 | | +| mention | | boolean | YES | | 0 | | +| pubmail | | boolean | YES | | 0 | | +| forum_mode | | tinyint unsigned | YES | | 0 | | +| contact-id | contact.id | int unsigned | YES | | 0 | | +| unseen | post has not been seen | boolean | YES | | 1 | | +| hidden | Marker to hide the post from the user | boolean | YES | | 0 | | +| origin | item originated at this site | boolean | YES | | 0 | | +| psid | ID of the permission set of this post | int unsigned | NO | | | | +| post-user-id | Id of the post-user table | int unsigned | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-thread.md b/doc/database/db_post-thread.md new file mode 100644 index 0000000000..301a16a66f --- /dev/null +++ b/doc/database/db_post-thread.md @@ -0,0 +1,17 @@ +Table post-thread +=========== +Thread related data + +| 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 | | | +| owner-id | Item owner | int unsigned | YES | | 0 | | +| author-id | Item author | 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 | | | | +| network | | char(4) | YES | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | +| received | | datetime | YES | | 0001-01-01 00:00:00 | | +| changed | Date that something in the conversation changed, indicating clients should fetch the conversation again | datetime | YES | | 0001-01-01 00:00:00 | | +| commented | | datetime | YES | | 0001-01-01 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-user-notification.md b/doc/database/db_post-user-notification.md new file mode 100644 index 0000000000..4ceea2a683 --- /dev/null +++ b/doc/database/db_post-user-notification.md @@ -0,0 +1,11 @@ +Table post-user-notification +=========== +User post notifications + +| 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 | | | +| uid | Owner id which owns this copy of the item | mediumint unsigned | YES | PRI | | | +| notification-type | | tinyint unsigned | YES | | 0 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post-user.md b/doc/database/db_post-user.md new file mode 100644 index 0000000000..da6312b1de --- /dev/null +++ b/doc/database/db_post-user.md @@ -0,0 +1,38 @@ +Table post-user +=========== +User specific post data + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | YES | | | | +| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | NO | | | | +| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | NO | | | | +| external-id | Id of the item-uri table entry that contains the external uri | int unsigned | NO | | | | +| 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 | | | | +| post-type | Post type (personal note, image, article, ...) | tinyint unsigned | YES | | 0 | | +| post-reason | Reason why the post arrived at the user | tinyint unsigned | YES | | 0 | | +| vid | Id of the verb table entry that contains the activity verbs | smallint unsigned | NO | | | | +| 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 | | +| uid | Owner id which owns this copy of the item | mediumint unsigned | YES | | | | +| protocol | Protocol used to deliver the item for this user | tinyint unsigned | NO | | | | +| contact-id | contact.id | int unsigned | YES | | 0 | | +| event-id | Used to link to the event.id | int unsigned | NO | | | | +| unseen | post has not been seen | boolean | YES | | 1 | | +| hidden | Marker to hide the post from the user | boolean | YES | | 0 | | +| notification-type | | tinyint unsigned | YES | | 0 | | +| wall | This item was posted to the wall of uid | boolean | YES | | 0 | | +| origin | item originated at this site | boolean | YES | | 0 | | +| psid | ID of the permission set of this post | int unsigned | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_post.md b/doc/database/db_post.md new file mode 100644 index 0000000000..f8e09b05b0 --- /dev/null +++ b/doc/database/db_post.md @@ -0,0 +1,26 @@ +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 | | | +| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | NO | | | | +| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | NO | | | | +| external-id | Id of the item-uri table entry that contains the external uri | int unsigned | NO | | | | +| 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 | | | | +| 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 | | | | +| 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 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_process.md b/doc/database/db_process.md new file mode 100644 index 0000000000..8a2ad1ac88 --- /dev/null +++ b/doc/database/db_process.md @@ -0,0 +1,11 @@ +Table process +=========== +Currently running system processes + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| pid | | int unsigned | YES | PRI | | | +| command | | varbinary(32) | YES | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_profile.md b/doc/database/db_profile.md index 375e06635a..eb2297023b 100644 --- a/doc/database/db_profile.md +++ b/doc/database/db_profile.md @@ -1,48 +1,50 @@ Table profile -============= +=========== +user profiles data -| Field | Description | Type | Null | Key | Default | Extra | -|--------------|-----------------------------------------------|--------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(11) | NO | | 0 | | -| profile-name | Name of the profile | varchar(255) | NO | | | | -| is-default | Mark this profile as default profile | tinyint(1) | NO | | 0 | | -| hide-friends | Hide friend list from viewers of this profile | tinyint(1) | NO | | 0 | | -| name | | varchar(255) | NO | | | | -| pdesc | Deprecated | varchar(255) | NO | | | | -| dob | Day of birth | varchar(32) | NO | | 0001-01-01 | | -| address | | varchar(255) | NO | | | | -| locality | | varchar(255) | NO | | | | -| region | | varchar(255) | NO | | | | -| postal-code | | varchar(32) | NO | | | | -| country-name | | varchar(255) | NO | | | | -| hometown | Deprecated | varchar(255) | NO | MUL | | | -| gender | Deprecated | varchar(32) | NO | | | | -| marital | Deprecated | varchar(255) | NO | | | | -| with | Deprecated | text | NO | | NULL | | -| howlong | Deprecated | datetime | NO | | 0001-01-01 00:00:00 | | -| sexual | Deprecated | varchar(255) | NO | | | | -| politic | Deprecated | varchar(255) | NO | | | | -| religion | Deprecated | varchar(255) | NO | | | | -| pub_keywords | | text | NO | | NULL | | -| prv_keywords | | text | NO | | NULL | | -| likes | Deprecated | text | NO | | NULL | | -| dislikes | Deprecated | text | NO | | NULL | | -| about | Profile description | text | NO | | | | -| summary | Deprecated | varchar(255) | NO | | | | -| music | Deprecated | text | NO | | NULL | | -| book | Deprecated | text | NO | | NULL | | -| tv | Deprecated | text | NO | | NULL | | -| film | Deprecated | text | NO | | NULL | | -| interest | Deprecated | text | NO | | NULL | | -| romance | Deprecated | text | NO | | NULL | | -| work | Deprecated | text | NO | | NULL | | -| education | Deprecated | text | NO | | NULL | | -| contact | Deprecated | text | NO | | NULL | | -| homepage | | varchar(255) | NO | | | | -| photo | | varchar(255) | NO | | | | -| thumb | | varchar(255) | NO | | | | -| publish | publish default profile in local directory | tinyint(1) | NO | | 0 | | -| net-publish | publish profile in global directory | tinyint(1) | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner User id | mediumint unsigned | YES | | 0 | | +| profile-name | Deprecated | varchar(255) | NO | | | | +| is-default | Deprecated | boolean | NO | | | | +| hide-friends | Hide friend list from viewers of this profile | boolean | YES | | 0 | | +| name | | varchar(255) | YES | | | | +| pdesc | Deprecated | varchar(255) | NO | | | | +| dob | Day of birth | varchar(32) | YES | | 0000-00-00 | | +| address | | varchar(255) | YES | | | | +| locality | | varchar(255) | YES | | | | +| region | | varchar(255) | YES | | | | +| postal-code | | varchar(32) | YES | | | | +| country-name | | varchar(255) | YES | | | | +| hometown | Deprecated | varchar(255) | NO | | | | +| gender | Deprecated | varchar(32) | NO | | | | +| marital | Deprecated | varchar(255) | NO | | | | +| with | Deprecated | text | NO | | | | +| howlong | Deprecated | datetime | NO | | | | +| sexual | Deprecated | varchar(255) | NO | | | | +| politic | Deprecated | varchar(255) | NO | | | | +| religion | Deprecated | varchar(255) | NO | | | | +| pub_keywords | | text | NO | | | | +| prv_keywords | | text | NO | | | | +| likes | Deprecated | text | NO | | | | +| dislikes | Deprecated | text | NO | | | | +| about | Profile description | text | NO | | | | +| summary | Deprecated | varchar(255) | NO | | | | +| music | Deprecated | text | NO | | | | +| book | Deprecated | text | NO | | | | +| tv | Deprecated | text | NO | | | | +| film | Deprecated | text | NO | | | | +| interest | Deprecated | text | NO | | | | +| romance | Deprecated | text | NO | | | | +| work | Deprecated | text | NO | | | | +| education | Deprecated | text | NO | | | | +| contact | Deprecated | text | NO | | | | +| homepage | | varchar(255) | YES | | | | +| xmpp | | varchar(255) | YES | | | | +| photo | | varchar(255) | YES | | | | +| thumb | | varchar(255) | YES | | | | +| publish | publish default profile in local directory | boolean | YES | | 0 | | +| net-publish | publish profile in global directory | boolean | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_profile_check.md b/doc/database/db_profile_check.md index 411da06d30..ed8c936fcb 100644 --- a/doc/database/db_profile_check.md +++ b/doc/database/db_profile_check.md @@ -1,13 +1,14 @@ Table profile_check -=================== +=========== +DFRN remote auth use -| Field | Description | Type | Null | Key | Default | Extra | -| -------- | ------------- | ---------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id | int(10) unsigned | NO | | 0 | | -| cid | contact.id | int(10) unsigned | NO | | 0 | | -| dfrn_id | | varchar(255) | NO | | | | -| sec | | varchar(255) | NO | | 0 | | -| expire | | int(11) | NO | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| cid | contact.id | int unsigned | YES | | 0 | | +| dfrn_id | | varchar(255) | YES | | | | +| sec | | varchar(255) | YES | | | | +| expire | | int unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_profile_field.md b/doc/database/db_profile_field.md new file mode 100644 index 0000000000..9a0b9fda11 --- /dev/null +++ b/doc/database/db_profile_field.md @@ -0,0 +1,16 @@ +Table profile_field +=========== +Custom profile fields + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | Owner user id | mediumint unsigned | YES | | 0 | | +| order | Field ordering per user | mediumint unsigned | YES | | 1 | | +| psid | ID of the permission set of this profile field - 0 = public | int unsigned | NO | | | | +| label | Label of the field | varchar(255) | YES | | | | +| value | Value of the field | text | NO | | | | +| created | creation time | datetime | YES | | 0001-01-01 00:00:00 | | +| edited | last edit time | datetime | YES | | 0001-01-01 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_push_subscriber.md b/doc/database/db_push_subscriber.md index b766ccb46c..97b3f0fc06 100644 --- a/doc/database/db_push_subscriber.md +++ b/doc/database/db_push_subscriber.md @@ -1,10 +1,18 @@ Table push_subscriber -===================== +=========== +Used for OStatus: Contains feed subscribers -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|---------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| poll_id | | int(11) | NO | MUL | 0 | | -| choice | | int(11) | NO | MUL | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| callback_url | | varchar(255) | YES | | | | +| topic | | varchar(255) | YES | | | | +| nickname | | varchar(255) | YES | | | | +| push | Retrial counter | tinyint | YES | | 0 | | +| last_update | Date of last successful trial | datetime | YES | | 0001-01-01 00:00:00 | | +| next_try | Next retrial date | datetime | YES | | 0001-01-01 00:00:00 | | +| renewed | Date of last subscription renewal | datetime | YES | | 0001-01-01 00:00:00 | | +| secret | | varchar(255) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_queue.md b/doc/database/db_queue.md deleted file mode 100644 index 6b19f02f28..0000000000 --- a/doc/database/db_queue.md +++ /dev/null @@ -1,14 +0,0 @@ -Table queue -=========== - -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|-------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| cid | | int(11) | NO | MUL | 0 | | -| network | | varchar(32) | NO | MUL | | | -| created | | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| last | | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| content | | mediumtext | NO | | NULL | | -| batch | | tinyint(1) | NO | MUL | 0 | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_register.md b/doc/database/db_register.md index 974a2dc673..f2bc2c28d5 100644 --- a/doc/database/db_register.md +++ b/doc/database/db_register.md @@ -1,13 +1,15 @@ Table register -============== +=========== +registrations requiring admin approval -| Field | Description | Type | Null | Key | Default | Extra | -| -------- | ------------- | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(11) unsigned | NO | PRI | NULL | auto_increment | -| hash | | varchar(255) | NO | | | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | -| uid | user.id | int(11) unsigned | NO | | | | -| password | | varchar(255) | NO | | | | -| language | | varchar(16) | NO | | | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| hash | | varchar(255) | YES | | | | +| created | | datetime | YES | | 0001-01-01 00:00:00 | | +| uid | User id | mediumint unsigned | YES | | 0 | | +| password | | varchar(255) | YES | | | | +| language | | varchar(16) | YES | | | | +| note | | text | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_search.md b/doc/database/db_search.md index 63d0a46b40..a5f5e11f26 100644 --- a/doc/database/db_search.md +++ b/doc/database/db_search.md @@ -1,10 +1,11 @@ Table search -============ +=========== -| Field | Description | Type | Null | Key | Default | Extra | -|-------|------------------|--------------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | MUL | 0 | | -| term | | varchar(255) | NO | MUL | | | + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| uid | User id | mediumint unsigned | YES | | 0 | | +| term | | varchar(255) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_session.md b/doc/database/db_session.md index 1e87c24d03..1e3e1f3776 100644 --- a/doc/database/db_session.md +++ b/doc/database/db_session.md @@ -1,11 +1,12 @@ Table session -============= +=========== +web session storage -| Field | Description | Type | Null | Key | Default | Extra | -| ------ | ------------- | ------------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | bigint(20) unsigned | NO | PRI | NULL | auto_increment | -| sid | | varchar(255) | NO | MUL | | | -| data | | text | NO | | NULL | | -| expire | | int(10) unsigned | NO | MUL | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | bigint unsigned | YES | PRI | | auto_increment | +| sid | | varbinary(255) | YES | | | | +| data | | text | NO | | | | +| expire | | int unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_sign.md b/doc/database/db_sign.md deleted file mode 100644 index 6986613e59..0000000000 --- a/doc/database/db_sign.md +++ /dev/null @@ -1,12 +0,0 @@ -Table sign -========== - -| Field | Description | Type | Null | Key | Default | Extra | -| ------------ | ------------- | ---------------- | ---- | --- | ------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| iid | item.id | int(10) unsigned | NO | MUL | 0 | | -| signed_text | | mediumtext | NO | | NULL | | -| signature | | text | NO | | NULL | | -| signer | | varchar(255) | NO | | | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_storage.md b/doc/database/db_storage.md new file mode 100644 index 0000000000..77795196b4 --- /dev/null +++ b/doc/database/db_storage.md @@ -0,0 +1,10 @@ +Table storage +=========== +Data stored by Database storage backend + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | Auto incremented image data id | int unsigned | YES | PRI | | auto_increment | +| data | file data | longblob | YES | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_tag.md b/doc/database/db_tag.md new file mode 100644 index 0000000000..bc7cfa4f50 --- /dev/null +++ b/doc/database/db_tag.md @@ -0,0 +1,11 @@ +Table tag +=========== +tags and mentions + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | int unsigned | YES | PRI | | auto_increment | +| name | | varchar(96) | YES | | | | +| url | | varbinary(255) | YES | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_term.md b/doc/database/db_term.md deleted file mode 100644 index d18bf1c3b1..0000000000 --- a/doc/database/db_term.md +++ /dev/null @@ -1,19 +0,0 @@ -Table term -========== - -| Field | Description | Type | Null | Key | Default | Extra | -|----------| ------------- |---------------------|------|-----|---------------------|----------------| -| tid | | int(10) unsigned | NO | PRI | NULL | auto_increment | -| oid | | int(10) unsigned | NO | MUL | 0 | | -| otype | | tinyint(3) unsigned | NO | MUL | 0 | | -| type | | tinyint(3) unsigned | NO | MUL | 0 | | -| term | | varchar(255) | NO | | | | -| url | | varchar(255) | NO | | | | -| aid | | int(10) unsigned | NO | | 0 | | -| uid | | int(10) unsigned | NO | MUL | 0 | | -| guid | | varchar(255) | NO | MUL | | | -| created | | datetime | NO | | 0001-01-01 00:00:00 | | -| received | | datetime | NO | | 0001-01-01 00:00:00 | | -| global | | tinyint(1) | NO | | 0 | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_thread.md b/doc/database/db_thread.md deleted file mode 100644 index 13b70b4511..0000000000 --- a/doc/database/db_thread.md +++ /dev/null @@ -1,33 +0,0 @@ -Table thread -============ - -| Field | Description | Type | Null | Key | Default | Extra | -|-------------|------------------|------------------|------|-----|---------------------|-------| -| iid | sequential ID | int(10) unsigned | NO | PRI | 0 | | -| uid | | int(10) unsigned | NO | MUL | 0 | | -| contact-id | | int(11) unsigned | NO | | 0 | | -| gcontact-id | Global Contact | int(11) unsigned | NO | | 0 | | -| owner-id | Item owner | int(11) unsigned | NO | MUL | 0 | | -| author-id | Item author | int(11) unsigned | NO | MUL | 0 | | -| created | | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| edited | | datetime | NO | | 0001-01-01 00:00:00 | | -| commented | | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| received | | datetime | NO | | 0001-01-01 00:00:00 | | -| changed | | datetime | NO | | 0001-01-01 00:00:00 | | -| wall | | tinyint(1) | NO | MUL | 0 | | -| private | | tinyint(1) | NO | | 0 | | -| pubmail | | tinyint(1) | NO | | 0 | | -| moderated | | tinyint(1) | NO | | 0 | | -| visible | | tinyint(1) | NO | | 0 | | -| spam | | tinyint(1) | NO | | 0 | | -| starred | | tinyint(1) | NO | | 0 | | -| ignored | | tinyint(1) | NO | | 0 | | -| bookmark | | tinyint(1) | NO | | 0 | | -| unseen | | tinyint(1) | NO | | 1 | | -| deleted | | tinyint(1) | NO | | 0 | | -| origin | | tinyint(1) | NO | | 0 | | -| forum_mode | | tinyint(1) | NO | | 0 | | -| mention | | tinyint(1) | NO | | 0 | | -| network | | varchar(32) | NO | | | | - -Return to [database documentation](help/database) diff --git a/doc/database/db_tokens.md b/doc/database/db_tokens.md index 3b3778d68c..ade6543660 100644 --- a/doc/database/db_tokens.md +++ b/doc/database/db_tokens.md @@ -1,13 +1,14 @@ Table tokens -============ +=========== +OAuth usage -| Field | Description | Type | Null | Key | Default | Extra | -| ---------- | ----------- | ------------ | ---- | --- | ------- | ----- | -| id | | varchar(40) | NO | PRI | NULL | | -| secret | | text | NO | | NULL | | -| client_id | | varchar(20) | NO | | | | -| expires | | int(11) | NO | | 0 | | -| scope | | varchar(200) | NO | | | | -| uid | | int(11) | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | varchar(40) | YES | PRI | | | +| secret | | text | NO | | | | +| client_id | | varchar(20) | YES | | | | +| expires | | int | YES | | 0 | | +| scope | | varchar(200) | YES | | | | +| uid | User id | mediumint unsigned | YES | | 0 | | Return to [database documentation](help/database) diff --git a/doc/database/db_user-contact.md b/doc/database/db_user-contact.md new file mode 100644 index 0000000000..a08cf3153d --- /dev/null +++ b/doc/database/db_user-contact.md @@ -0,0 +1,13 @@ +Table user-contact +=========== +User specific public contact data + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| cid | Contact id of the linked public contact | int unsigned | YES | PRI | 0 | | +| uid | User id | mediumint unsigned | YES | PRI | 0 | | +| blocked | Contact is completely blocked for this user | boolean | NO | | | | +| ignored | Posts from this contact are ignored | boolean | NO | | | | +| collapsed | Posts from this contact are collapsed | boolean | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_user.md b/doc/database/db_user.md index 7033bcc896..03c6820ea1 100644 --- a/doc/database/db_user.md +++ b/doc/database/db_user.md @@ -1,77 +1,53 @@ Table user -========== +=========== +The local users -| Field | Description | Type | Null | Key | Default | Extra | -|--------------------------|-----------------------------------------------------------------------------------------|---------------------|------|-----|---------------------|----------------| -| uid | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| guid | A unique identifier for this user | varchar(64) | NO | | | | -| username | Name that this user is known by | varchar(255) | NO | | | | -| password | encrypted password | varchar(255) | NO | | | | -| nickname | nick- and user name | varchar(255) | NO | MUL | | | -| email | the users email address | varchar(255) | NO | | | | -| openid | | varchar(255) | NO | | | | -| timezone | PHP-legal timezone | varchar(128) | NO | | | | -| language | default language | varchar(32) | NO | | en | | -| register_date | timestamp of registration | datetime | NO | | 0001-01-01 00:00:00 | | -| login_date | timestamp of last login | datetime | NO | | 0001-01-01 00:00:00 | | -| default-location | Default for item.location | varchar(255) | NO | | | | -| allow_location | 1 allows to display the location | tinyint(1) | NO | | 0 | | -| theme | user theme preference | varchar(255) | NO | | | | -| pubkey | RSA public key 4096 bit | text | NO | | NULL | | -| prvkey | RSA private key 4096 bit | text | NO | | NULL | | -| spubkey | | text | NO | | NULL | | -| sprvkey | | text | NO | | NULL | | -| verified | user is verified through email | tinyint(1) unsigned | NO | | 0 | | -| blocked | 1 for user is blocked | tinyint(1) unsigned | NO | | 0 | | -| blockwall | Prohibit contacts to post to the profile page of the user | tinyint(1) unsigned | NO | | 0 | | -| hidewall | Hide profile details from unkown viewers | tinyint(1) unsigned | NO | | 0 | | -| blocktags | Prohibit contacts to tag the post of this user | tinyint(1) unsigned | NO | | 0 | | -| unkmail | Permit unknown people to send private mails to this user | tinyint(1) | NO | | 0 | | -| cntunkmail | | int(11) | NO | | 10 | | -| notify-flags | email notification options | int(11) unsigned | NO | | 65535 | | -| page-flags | page/profile type | int(11) unsigned | NO | | 0 | | -| prvnets | | tinyint(1) | NO | | 0 | | -| pwdreset | | varchar(255) | NO | | | | -| maxreq | | int(11) | NO | | 10 | | -| expire | | int(11) unsigned | NO | | 0 | | -| account_removed | if 1 the account is removed | tinyint(1) | NO | | 0 | | -| account_expired | | tinyint(1) | NO | | 0 | | -| account_expires_on | timestamp when account expires and will be deleted | datetime | NO | | 0001-01-01 00:00:00 | | -| expire_notification_sent | timestamp of last warning of account expiration | datetime | NO | | 0001-01-01 00:00:00 | | -| def_gid | | int(11) | NO | | 0 | | -| allow_cid | default permission for this user | mediumtext | NO | | NULL | | -| allow_gid | default permission for this user | mediumtext | NO | | NULL | | -| deny_cid | default permission for this user | mediumtext | NO | | NULL | | -| deny_gid | default permission for this user | mediumtext | NO | | NULL | | -| openidserver | | text | NO | | NULL | | - -``` -/** -* page-flags -*/ -define ( 'PAGE_NORMAL', 0 ); -define ( 'PAGE_SOAPBOX', 1 ); -define ( 'PAGE_COMMUNITY', 2 ); -define ( 'PAGE_FREELOVE', 3 ); -define ( 'PAGE_BLOG', 4 ); -define ( 'PAGE_PRVGROUP', 5 ); - -/** -* notify-flags -*/ -define ( 'NOTIFY_INTRO', 0x0001 ); -define ( 'NOTIFY_CONFIRM', 0x0002 ); -define ( 'NOTIFY_WALL', 0x0004 ); -define ( 'NOTIFY_COMMENT', 0x0008 ); -define ( 'NOTIFY_MAIL', 0x0010 ); -define ( 'NOTIFY_SUGGEST', 0x0020 ); -define ( 'NOTIFY_PROFILE', 0x0040 ); -define ( 'NOTIFY_TAGSELF', 0x0080 ); -define ( 'NOTIFY_TAGSHARE', 0x0100 ); -define ( 'NOTIFY_POKE', 0x0200 ); -define ( 'NOTIFY_SHARE', 0x0400 ); - -define ( 'NOTIFY_SYSTEM', 0x8000 ); -``` +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| uid | sequential ID | mediumint unsigned | YES | PRI | | auto_increment | +| parent-uid | The parent user that has full control about this user | mediumint unsigned | NO | | | | +| guid | A unique identifier for this user | varchar(64) | YES | | | | +| username | Name that this user is known by | varchar(255) | YES | | | | +| password | encrypted password | varchar(255) | YES | | | | +| legacy_password | Is the password hash double-hashed? | boolean | YES | | 0 | | +| nickname | nick- and user name | varchar(255) | YES | | | | +| email | the users email address | varchar(255) | YES | | | | +| openid | | varchar(255) | YES | | | | +| timezone | PHP-legal timezone | varchar(128) | YES | | | | +| language | default language | varchar(32) | YES | | en | | +| register_date | timestamp of registration | datetime | YES | | 0001-01-01 00:00:00 | | +| login_date | timestamp of last login | datetime | YES | | 0001-01-01 00:00:00 | | +| default-location | Default for item.location | varchar(255) | YES | | | | +| allow_location | 1 allows to display the location | boolean | YES | | 0 | | +| theme | user theme preference | varchar(255) | YES | | | | +| pubkey | RSA public key 4096 bit | text | NO | | | | +| prvkey | RSA private key 4096 bit | text | NO | | | | +| spubkey | | text | NO | | | | +| sprvkey | | text | NO | | | | +| verified | user is verified through email | boolean | YES | | 0 | | +| blocked | 1 for user is blocked | boolean | YES | | 0 | | +| blockwall | Prohibit contacts to post to the profile page of the user | boolean | YES | | 0 | | +| hidewall | Hide profile details from unkown viewers | boolean | YES | | 0 | | +| blocktags | Prohibit contacts to tag the post of this user | boolean | YES | | 0 | | +| unkmail | Permit unknown people to send private mails to this user | boolean | YES | | 0 | | +| cntunkmail | | int unsigned | YES | | 10 | | +| notify-flags | email notification options | smallint unsigned | YES | | 65535 | | +| page-flags | page/profile type | tinyint unsigned | YES | | 0 | | +| account-type | | tinyint unsigned | YES | | 0 | | +| prvnets | | boolean | YES | | 0 | | +| pwdreset | Password reset request token | varchar(255) | NO | | | | +| pwdreset_time | Timestamp of the last password reset request | datetime | NO | | | | +| maxreq | | int unsigned | YES | | 10 | | +| expire | | int unsigned | YES | | 0 | | +| account_removed | if 1 the account is removed | boolean | YES | | 0 | | +| account_expired | | boolean | YES | | 0 | | +| account_expires_on | timestamp when account expires and will be deleted | datetime | YES | | 0001-01-01 00:00:00 | | +| expire_notification_sent | timestamp of last warning of account expiration | datetime | YES | | 0001-01-01 00:00:00 | | +| def_gid | | int unsigned | YES | | 0 | | +| allow_cid | default permission for this user | mediumtext | NO | | | | +| allow_gid | default permission for this user | mediumtext | NO | | | | +| deny_cid | default permission for this user | mediumtext | NO | | | | +| deny_gid | default permission for this user | mediumtext | NO | | | | +| openidserver | | text | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_userd.md b/doc/database/db_userd.md index 80e3084757..99baabcc66 100644 --- a/doc/database/db_userd.md +++ b/doc/database/db_userd.md @@ -1,9 +1,10 @@ Table userd =========== +Deleted usernames -| Field | Description | Type | Null | Key | Default | Extra | -|----------|------------------|--------------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| username | | varchar(255) | NO | MUL | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | sequential ID | int unsigned | YES | PRI | | auto_increment | +| username | | varchar(255) | YES | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_verb.md b/doc/database/db_verb.md new file mode 100644 index 0000000000..7e01f1f8e6 --- /dev/null +++ b/doc/database/db_verb.md @@ -0,0 +1,10 @@ +Table verb +=========== +Activity Verbs + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | | smallint unsigned | YES | PRI | | auto_increment | +| name | | varchar(100) | YES | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_worker-ipc.md b/doc/database/db_worker-ipc.md new file mode 100644 index 0000000000..ef8c97301e --- /dev/null +++ b/doc/database/db_worker-ipc.md @@ -0,0 +1,10 @@ +Table worker-ipc +=========== +Inter process communication between the frontend and the worker + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| key | | int | YES | PRI | | | +| jobs | Flag for outstanding jobs | boolean | NO | | | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_workerqueue.md b/doc/database/db_workerqueue.md index 182358a4c4..0a14e0aecb 100644 --- a/doc/database/db_workerqueue.md +++ b/doc/database/db_workerqueue.md @@ -1,14 +1,18 @@ Table workerqueue -================= +=========== +Background tasks queue entries -| Field | Description | Type | Null | Key | Default | Extra | -|-----------|------------------|---------------------|------|-----|---------------------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| parameter | | text | NO | | NULL | | -| priority | | tinyint(3) unsigned | NO | | 0 | | -| created | | datetime | NO | MUL | 0001-01-01 00:00:00 | | -| pid | | int(11) | NO | | 0 | | -| executed | | datetime | NO | | 0001-01-01 00:00:00 | | -| done | set to 1 if done | tinyint(1) | NO | | 0 | | +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +| id | Auto incremented worker task id | int unsigned | YES | PRI | | auto_increment | +| command | Task command | varchar(100) | NO | | | | +| parameter | Task parameter | mediumtext | NO | | | | +| priority | Task priority | tinyint unsigned | YES | | 0 | | +| created | Creation date | datetime | YES | | 0001-01-01 00:00:00 | | +| pid | Process id of the worker | int unsigned | YES | | 0 | | +| executed | Execution date | datetime | YES | | 0001-01-01 00:00:00 | | +| next_try | Next retrial date | datetime | YES | | 0001-01-01 00:00:00 | | +| retrial | Retrial counter | tinyint | YES | | 0 | | +| done | Marked 1 when the task was done - will be deleted later | boolean | YES | | 0 | | Return to [database documentation](help/database) diff --git a/src/Console/DatabaseStructure.php b/src/Console/DatabaseStructure.php index c6d708eb71..b44400c01a 100644 --- a/src/Console/DatabaseStructure.php +++ b/src/Console/DatabaseStructure.php @@ -120,6 +120,7 @@ HELP; $output = ob_get_clean(); break; case "dumpsql": + DBStructure::writeStructure(); ob_start(); DBStructure::printStructure($basePath); $output = ob_get_clean(); diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 914846590b..f7a5963c7c 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -24,6 +24,7 @@ namespace Friendica\Database; use Exception; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\User; @@ -159,6 +160,41 @@ class DBStructure return DI::l10n()->t('Errors encountered performing database changes: ') . $message . EOL; } + public static function writeStructure() + { + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $tables = []; + foreach (self::definition(null) as $name => $definition) { + $fields = []; + foreach ($definition['fields'] as $key => $value) { + $field = []; + $field['name'] = $key; + $field['comment'] = $value['comment'] ?? ''; + $field['type'] = $value['type']; + $field['notnull'] = ($value['not null'] ?? false) ? 'YES' : 'NO'; + $field['primary'] = ($value['primary'] ?? false) ? 'PRI' : ''; + $field['default'] = $value['default'] ?? ''; + $field['extra'] = $value['extra'] ?? ''; + + $fields[] = $field; + } + $tables[] = ['name' => $name, 'comment' => $definition['comment']]; + $content = Renderer::replaceMacros(Renderer::getMarkupTemplate('structure.tpl'), [ + '$name' => $name, + '$comment' => $definition['comment'], + '$fields' => $fields, + ]); + $filename = DI::basePath() . '/doc/database/db_' . $name . '.md'; + file_put_contents($filename, $content); + } + $content = Renderer::replaceMacros(Renderer::getMarkupTemplate('tables.tpl'), [ + '$tables' => $tables, + ]); + $filename = DI::basePath() . '/doc/database.md'; + file_put_contents($filename, $content); + } + public static function printStructure($basePath) { $database = self::definition($basePath, false); diff --git a/view/templates/structure.tpl b/view/templates/structure.tpl new file mode 100644 index 0000000000..91ba2eb315 --- /dev/null +++ b/view/templates/structure.tpl @@ -0,0 +1,11 @@ +Table {{$name}} +=========== +{{$comment}} + +| Field | Description | Type | Null | Key | Default | Extra | +| ----- | ----------- | ---- | ---- | --- | ------- | ----- | +{{foreach $fields as $field}} +| {{$field.name}} | {{$field.comment}} | {{$field.type}} | {{$field.notnull}} | {{$field.primary}} | {{$field.default}} | {{$field.extra}} | +{{/foreach}} + +Return to [database documentation](help/database) diff --git a/view/templates/tables.tpl b/view/templates/tables.tpl new file mode 100644 index 0000000000..8fdd12a37b --- /dev/null +++ b/view/templates/tables.tpl @@ -0,0 +1,10 @@ +Database Tables +=============== + +* [Home](help) + +| Table | Description | +|-------|-------------| +{{foreach $tables as $table}} +| [{{$table.name}}](help/database/db_{{$table.name}}) | {{$table.comment}} | +{{/foreach}}