Pad the header

This commit is contained in:
Michael 2021-06-14 05:58:51 +00:00
parent 4095e6c9be
commit fd30df7300
73 changed files with 921 additions and 898 deletions

View File

@ -3,7 +3,7 @@ Table 2fa_app_specific_password
Two-factor app-specific _password
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------------- | ---------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | Password ID for revocation | mediumint unsigned | NO | PRI | NULL | auto_increment |
| uid | User ID | mediumint unsigned | NO | | NULL | |
| description | Description of the usage of the password | varchar(255) | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table 2fa_recovery_codes
Two-factor authentication recovery codes
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------- | ------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| uid | User ID | mediumint unsigned | NO | PRI | NULL | |
| code | Recovery code string | varchar(50) | NO | PRI | NULL | |
| generated | Datetime the code was generated | datetime | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table 2fa_trusted_browser
Two-factor authentication trusted browsers
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | ----- |
| cookie_hash | Trusted cookie hash | varchar(80) | NO | PRI | NULL | |
| uid | User ID | mediumint unsigned | NO | | NULL | |
| user_agent | User agent string | text | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table addon
registered addons
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------ | --------------------------------------------- | ------------ | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| name | addon base (file)name | varchar(50) | NO | | | |
| version | currently unused | varchar(50) | NO | | | |

View File

@ -3,7 +3,7 @@ Table apcontact
ActivityPub compatible contacts - used in the ActivityPub implementation
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ---------------- | ---------------------------- | -------------- | ---- | --- | ------------------- | ----- |
| url | URL of the contact | varbinary(255) | NO | PRI | NULL | |
| uuid | | varchar(255) | YES | | NULL | |
| type | | varchar(20) | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table application-token
OAuth user token
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------------- | ------------- | ------------------ | ---- | --- | ------- | ----- |
| application-id | | int unsigned | NO | PRI | NULL | |
| uid | Owner User id | mediumint unsigned | NO | PRI | NULL | |
| code | | varchar(64) | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table application
OAuth application
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | --------------- | ------------ | ---- | --- | ------- | -------------- |
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
| client_id | | varchar(64) | NO | | NULL | |
| client_secret | | varchar(64) | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table attach
file attachments
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | ----------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| hash | hash | varchar(64) | NO | | | |

View File

@ -3,7 +3,7 @@ Table auth_codes
OAuth usage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------ | ----------- | ------------ | ---- | --- | ------- | ----- |
| id | | varchar(40) | NO | PRI | NULL | |
| client_id | | varchar(20) | NO | | | |
| redirect_uri | | varchar(200) | NO | | | |

View File

@ -3,7 +3,7 @@ Table cache
Stores temporary data
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ---------------------------- | -------------- | ---- | --- | ------------------- | ----- |
| k | cache key | varbinary(255) | NO | PRI | NULL | |
| v | cached serialized value | mediumtext | YES | | NULL | |
| expires | datetime of cache expiration | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table challenge
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----------- | ------------- | ------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| challenge | | varchar(255) | NO | | | |
| dfrn-id | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ 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 | | | |

View File

@ -3,7 +3,7 @@ Table config
main configuration storage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ----------- | ------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| cat | | varbinary(50) | NO | | | |
| k | | varbinary(50) | NO | | | |

View File

@ -3,7 +3,7 @@ Table contact-relation
Contact relations
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ---------------- | --------------------------------------------------- | ------------ | ---- | --- | ------------------- | ----- |
| cid | contact the related contact had interacted with | int unsigned | NO | PRI | 0 | |
| relation-cid | related contact who had interacted with the contact | int unsigned | NO | PRI | 0 | |
| last-interaction | Date of the last interaction | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table contact
contact table
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------------------- | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table conv
private messages
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ----------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| guid | A unique identifier for this conversation | varchar(255) | NO | | | |
| recips | sender_handle;recipient_handle | text | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table conversation
Raw data and structure information for messages
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----------------- | -------------------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | ----- |
| item-uri | Original URI of the item - unrelated to the table with the same name | 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 | | | |

View File

@ -3,7 +3,7 @@ Table delayed-post
Posts that are about to be distributed at a later time
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ---------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| uri | URI of the post that will be distributed later | varchar(255) | YES | | NULL | |
| uid | Owner User id | mediumint unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| interaction | The Diaspora interaction | mediumtext | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table event
Events
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| guid | | varchar(255) | NO | | | |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table fcontact
Diaspora compatible contacts - used in the Diaspora implementation
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| guid | unique id | varchar(255) | NO | | | |
| url | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table fsuggest
friend suggestion stuff
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ----------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| cid | | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table group
privacy groups, group info
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| visible | 1 indicates the member list is not private | boolean | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table group_member
privacy groups, member info
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ---------- | --------------------------------------------------------- | ------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| gid | groups.id of the associated group | int unsigned | NO | | 0 | |
| contact-id | contact.id of the member assigned to the associated group | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | 0 | |
| tag | Tag that the server has subscribed | varchar(100) | NO | PRI | | |

View File

@ -3,7 +3,7 @@ Table gserver
Global servers
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ---------------- | -------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| url | | varchar(255) | NO | | | |
| nurl | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table hook
addon hook registry
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ---------------------------------------------------------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| hook | name of hook | varbinary(100) | NO | | | |
| file | relative filename of hook handler | varbinary(200) | NO | | | |

View File

@ -3,7 +3,7 @@ Table host
Hostname
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------- | ---------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | tinyint unsigned | NO | PRI | NULL | auto_increment |
| name | The hostname | varchar(128) | NO | | | |

View File

@ -3,7 +3,7 @@ Table inbox-status
Status of ActivityPub inboxes
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ------------------------------------ | -------------- | ---- | --- | ------------------- | ----- |
| url | URL of the inbox | varbinary(255) | NO | PRI | NULL | |
| created | Creation date of this entry | datetime | NO | | 0001-01-01 00:00:00 | |
| success | Date of the last successful delivery | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table intro
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ---------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| fid | | int unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table item-uri
URI and GUID for items
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------------------------- | -------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| uri | URI of an item | varbinary(255) | NO | | NULL | |
| guid | A unique identifier for an item | varbinary(255) | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table locks
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ---------------------------- | ------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| name | | varchar(128) | NO | | | |
| locked | | boolean | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table mail
private messages
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | -------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| guid | A unique identifier for this private message | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table mailacct
Mail account data for fetching mails
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------ | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| server | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table manage
table of accounts that can manage each other
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| mid | User id | mediumint unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table notification
notifications
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | ------------------------------------------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | YES | | NULL | |
| vid | Id of the verb table entry that contains the activity verbs | smallint unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table notify-threads
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------------------- | --------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| notify-id | | int unsigned | NO | | 0 | |
| master-parent-item | Deprecated | int unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table notify
notifications
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | --------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| type | | smallint unsigned | NO | | 0 | |
| name | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table oembed
cache for OEmbed queries
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ------------------------------ | ------------------ | ---- | --- | ------------------- | ----- |
| url | page url | varbinary(255) | NO | PRI | NULL | |
| maxwidth | Maximum width passed to Oembed | mediumint unsigned | NO | PRI | NULL | |
| content | OEmbed data of the page | mediumtext | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table openwebauth-token
Store OpenWebAuth token to verify contacts
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | -------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id - currently unused | mediumint unsigned | NO | | 0 | |
| type | Verify type | varchar(32) | NO | | | |

View File

@ -3,7 +3,7 @@ Table parsed_url
cache for 'parse_url' queries
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | --------------------------------- | ---------- | ---- | --- | ------------------- | ----- |
| url_hash | page url hash | binary(64) | NO | PRI | NULL | |
| guessing | is the 'guessing' mode active? | boolean | NO | PRI | 0 | |
| oembed | is the data the result of oembed? | boolean | NO | PRI | 0 | |

View File

@ -3,7 +3,7 @@ Table pconfig
personal (per user) configuration storage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ----------- | ------------------ | ---- | --- | ------- | -------------- |
| id | Primary key | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| cat | Category | varchar(50) | NO | | | |

View File

@ -3,7 +3,7 @@ Table permissionset
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner id of this permission set | mediumint unsigned | NO | | 0 | |
| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table photo
photo storage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| contact-id | contact.id | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| uid | User id | mediumint unsigned | NO | PRI | 0 | |
| type | | tinyint unsigned | NO | PRI | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| title | item title | varchar(255) | NO | | | |
| content-warning | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | 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 | YES | | NULL | |
| inform | Additional receivers of the linked item | mediumtext | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table post-media
Attached media
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| url | Media URL | varbinary(511) | NO | | NULL | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| type | | tinyint unsigned | NO | PRI | 0 | |
| tid | | int unsigned | NO | PRI | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| owner-id | Item owner | int unsigned | NO | | 0 | |
| author-id | Item author | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| owner-id | Item owner | int unsigned | NO | | 0 | |
| author-id | Item author | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| uid | Owner id which owns this copy of the item | mediumint unsigned | NO | PRI | NULL | |
| notification-type | | tinyint unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table post-user
User specific post data
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----------------- | --------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | NULL | |
| parent-uri-id | Id of the item-uri table that contains the parent uri | int unsigned | YES | | NULL | |
| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table process
Currently running system processes
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ----------- | ------------- | ---- | --- | ------------------- | ----- |
| pid | | int unsigned | NO | PRI | NULL | |
| command | | varbinary(32) | NO | | | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table profile
user profiles data
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------ | --------------------------------------------- | ------------------ | ---- | --- | ---------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| profile-name | Deprecated | varchar(255) | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table profile_check
DFRN remote auth use
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| cid | contact.id | int unsigned | NO | | 0 | |

View File

@ -3,7 +3,7 @@ Table profile_field
Custom profile fields
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------- | ----------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner user id | mediumint unsigned | NO | | 0 | |
| order | Field ordering per user | mediumint unsigned | NO | | 1 | |

View File

@ -3,7 +3,7 @@ Table push_subscriber
Used for OStatus: Contains feed subscribers
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------ | --------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| callback_url | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table register
registrations requiring admin approval
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| hash | | varchar(255) | NO | | | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |

View File

@ -3,7 +3,7 @@ Table search
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | User id | mediumint unsigned | NO | | 0 | |
| term | | varchar(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table session
web session storage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------ | ------------- | --------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | bigint unsigned | NO | PRI | NULL | auto_increment |
| sid | | varbinary(255) | NO | | | |
| data | | text | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table storage
Data stored by Database storage backend
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------------------------ | ------------ | ---- | --- | ------- | -------------- |
| id | Auto incremented image data id | int unsigned | NO | PRI | NULL | auto_increment |
| data | file data | longblob | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table tag
tags and mentions
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ----------- | -------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| name | | varchar(96) | NO | | | |
| url | | varbinary(255) | NO | | | |

View File

@ -3,7 +3,7 @@ Table tokens
OAuth usage
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------- | ----------- | ------------------ | ---- | --- | ------- | ----- |
| id | | varchar(40) | NO | PRI | NULL | |
| secret | | text | YES | | NULL | |
| client_id | | varchar(20) | NO | | | |

View File

@ -3,7 +3,7 @@ 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 | NO | PRI | 0 | |
| uid | User id | mediumint unsigned | NO | PRI | 0 | |
| blocked | Contact is completely blocked for this user | boolean | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table user
The local users
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ------------------------ | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| uid | sequential ID | mediumint unsigned | NO | PRI | NULL | auto_increment |
| parent-uid | The parent user that has full control about this user | mediumint unsigned | YES | | NULL | |
| guid | A unique identifier for this user | varchar(64) | NO | | | |

View File

@ -3,7 +3,7 @@ Table userd
Deleted usernames
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| -------- | ------------- | ------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| username | | varchar(255) | NO | | NULL | |

View File

@ -3,7 +3,7 @@ Table verb
Activity Verbs
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ----------- | ----------------- | ---- | --- | ------- | -------------- |
| id | | smallint unsigned | NO | PRI | NULL | auto_increment |
| name | | varchar(100) | NO | | | |

View File

@ -3,7 +3,7 @@ Table worker-ipc
Inter process communication between the frontend and the worker
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| ----- | ------------------------- | ------- | ---- | --- | ------- | ----- |
| key | | int | NO | PRI | NULL | |
| jobs | Flag for outstanding jobs | boolean | YES | | NULL | |

View File

@ -3,7 +3,7 @@ Table workerqueue
Background tasks queue entries
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
| --------- | ------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | Auto incremented worker task id | int unsigned | NO | PRI | NULL | auto_increment |
| command | Task command | varchar(100) | YES | | NULL | |
| parameter | Task parameter | mediumtext | YES | | NULL | |

View File

@ -166,8 +166,33 @@ class DBStructure
$tables = [];
foreach (self::definition(null) as $name => $definition) {
$fields = [];
$lengths = [];
$fields = [[
'name' => 'Field',
'comment' => 'Description',
'type' => 'Type',
'null' => 'Null',
'primary' => 'Key',
'default' => 'Default',
'extra' => 'Extra',
],
[
'name' => '-',
'comment' => '-',
'type' => '-',
'null' => '-',
'primary' => '-',
'default' => '-',
'extra' => '-',
]];
$lengths = [
'name' => 5,
'comment' => 11,
'type' => 4,
'null' => 4,
'primary' => 3,
'default' => 7,
'extra' => 5,
];
foreach ($definition['fields'] as $key => $value) {
$field = [];
$field['name'] = $key;
@ -186,7 +211,7 @@ class DBStructure
array_walk_recursive($fields, function(&$value, $key) use ($lengths)
{
$value = str_pad($value, $lengths[$key]);
$value = str_pad($value, $lengths[$key], $value === '-' ? '-' : ' ');
});
$tables[] = ['name' => $name, 'comment' => $definition['comment']];

View File

@ -2,8 +2,6 @@ Table {{$name}}
===========
{{$comment}}
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ---- | ---- | --- | ------- | ----- |
{{foreach $fields as $field}}
| {{$field.name}} | {{$field.comment}} | {{$field.type}} | {{$field.null}} | {{$field.primary}} | {{$field.default}} | {{$field.extra}} |
{{/foreach}}