Two-factor app-specific _password
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------------- | ---------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | Password ID for revocation | mediumint unsigned | NO | PRI | NULL | auto_increment |
| generated | Datetime the password was generated | datetime | NO | | NULL | |
| last_used | Datetime the password was last used | datetime | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_description | uid, description(190) |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
Two-factor authentication recovery codes
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| uid | User ID | mediumint unsigned | NO | PRI | NULL | |
| generated | Datetime the code was generated | datetime | NO | | NULL | |
| used | Datetime the code was used | datetime | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uid, code |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
Two-factor authentication trusted browsers
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | ----- |
| cookie_hash | Trusted cookie hash | varchar(80) | NO | PRI | NULL | |
| created | Datetime the trusted browser was recorded | datetime | NO | | NULL | |
| last_used | Datetime the trusted browser was last used | datetime | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | cookie_hash |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
registered addons
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | --------------------------------------------- | ------------ | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| timestamp | file timestamp to check for reloads | int unsigned | NO | | 0 | |
| plugin_admin | 1 = has admin config, 0 = has no admin config | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| installed_name | installed, name |
+| name | UNIQUE, name |
+
+
Return to [database documentation](help/database)
ActivityPub compatible contacts - used in the ActivityPub implementation
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ---------------- | ---------------------------- | -------------- | ---- | --- | ------------------- | ----- |
| url | URL of the contact | varbinary(255) | NO | PRI | NULL | |
| statuses_count | Number of posts | int unsigned | YES | | 0 | |
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | url |
+| addr | addr(32) |
+| alias | alias(190) |
+| followers | followers(190) |
+| baseurl | baseurl(190) |
+| sharedinbox | sharedinbox(190) |
+| gsid | gsid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| gsid | [gserver](help/database/db_gserver) | id |
+
Return to [database documentation](help/database)
OAuth user token
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------------- | ------------- | ------------------ | ---- | --- | ------- | ----- |
| application-id | | int unsigned | NO | PRI | NULL | |
| follow | Follow scope | boolean | YES | | NULL | |
| push | Push scope | boolean | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | application-id, uid |
+| uid_id | uid, application-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| application-id | [application](help/database/db_application) | id |
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
OAuth application
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | --------------- | ------------ | ---- | --- | ------- | -------------- |
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
| follow | Follow scope | boolean | YES | | NULL | |
| push | Push scope | boolean | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| client_id | UNIQUE, client_id |
+
+
Return to [database documentation](help/database)
file attachments
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | ----------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
| backend-class | Storage backend class | tinytext | YES | | NULL | |
| backend-ref | Storage backend data reference | text | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
OAuth usage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | ----------- | ------------ | ---- | --- | ------- | ----- |
| id | | varchar(40) | NO | PRI | NULL | |
| expires | | int | NO | | 0 | |
| scope | | varchar(250) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| client_id | client_id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| client_id | [clients](help/database/db_clients) | client_id |
+
Return to [database documentation](help/database)
Stores temporary data
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ---------------------------- | -------------- | ---- | --- | ------------------- | ----- |
| k | cache key | varbinary(255) | NO | PRI | NULL | |
| expires | datetime of cache expiration | datetime | NO | | 0001-01-01 00:00:00 | |
| updated | datetime of cache insertion | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | k |
+| k_expires | k, expires |
+
+
Return to [database documentation](help/database)
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----------- | ------------- | ------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| type | | varchar(255) | NO | | | |
| last_update | | varchar(255) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| expire | expire |
+
+
Return to [database documentation](help/database)
OAuth usage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | ----------- | ------------------ | ---- | --- | ------- | ----- |
| client_id | | varchar(20) | NO | PRI | NULL | |
| icon | | text | YES | | NULL | |
| uid | User id | mediumint unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | client_id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
main configuration storage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| k | | varbinary(50) | NO | | | |
| v | | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| cat_k | UNIQUE, cat, k |
+
+
Return to [database documentation](help/database)
Contact relations
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ---------------- | --------------------------------------------------- | ------------ | ---- | --- | ------------------- | ----- |
| cid | contact the related contact had interacted with | int unsigned | NO | PRI | 0 | |
| follow-updated | Date of the last update of the contact relationship | datetime | NO | | 0001-01-01 00:00:00 | |
| follows | | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | cid, relation-cid |
+| relation-cid | relation-cid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| cid | [contact](help/database/db_contact) | id |
+| relation-cid | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
contact table
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------------------- | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| fetch_further_information | | tinyint unsigned | NO | | 0 | |
| ffi_keyword_denylist | | text | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_name | uid, name(190) |
+| self_uid | self, uid |
+| alias_uid | alias(128), uid |
+| pending_uid | pending, uid |
+| blocked_uid | blocked, uid |
+| uid_rel_network_poll | uid, rel, network, poll(64), archive |
+| uid_network_batch | uid, network, batch(64) |
+| batch_contact-type | batch(64), contact-type |
+| addr_uid | addr(128), uid |
+| nurl_uid | nurl(128), uid |
+| nick_uid | nick(128), uid |
+| attag_uid | attag(96), uid |
+| dfrn-id | dfrn-id(64) |
+| issued-id | issued-id(64) |
+| network_uid_lastupdate | network, uid, last-update |
+| uid_network_self_lastupdate | uid, network, self, last-update |
+| uid_lastitem | uid, last-item |
+| baseurl | baseurl(64) |
+| uid_contact-type | uid, contact-type |
+| uid_self_contact-type | uid, self, contact-type |
+| self_network_uid | self, network, uid |
+| gsid | gsid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| gsid | [gserver](help/database/db_gserver) | id |
+
Return to [database documentation](help/database)
private messages
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ----------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| updated | edited timestamp | datetime | NO | | 0001-01-01 00:00:00 | |
| subject | subject of initial message | text | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
Raw data and structure information for messages
+Fields
+------
+
| 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 | |
| source | Original source | mediumtext | YES | | NULL | |
| received | Receiving date | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | item-uri |
+| conversation-uri | conversation-uri |
+| received | received |
+
+
Return to [database documentation](help/database)
Posts that are about to be distributed at a later time
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ---------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | YES | | NULL | |
| delayed | delay time | datetime | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_uri | UNIQUE, uid, uri(190) |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
Signed Diaspora Interaction
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----------- | --------------------------------------------------------- | ------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| interaction | The Diaspora interaction | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
Events
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| deny_cid | Access Control - list of denied contact.id | mediumtext | YES | | NULL | |
| deny_gid | Access Control - list of denied groups | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_start | uid, start |
+| cid | cid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| cid | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
Diaspora compatible contacts - used in the Diaspora implementation
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| pubkey | | text | YES | | NULL | |
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| addr | addr(32) |
+| url | UNIQUE, url(190) |
+
+
Return to [database documentation](help/database)
friend suggestion stuff
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ----------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| note | | text | YES | | NULL | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| cid | cid |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| cid | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
privacy groups, group info
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| deleted | 1 indicates the group has been deleted | boolean | NO | | 0 | |
| name | human readable name of group | varchar(255) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
privacy groups, member info
+Fields
+------
+
| 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 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| contactid | contact-id |
+| gid_contactid | UNIQUE, gid, contact-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| gid | [group](help/database/db_group) | id |
+| contact-id | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
Tags that the server has subscribed
+Fields
+------
+
| 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 | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | gserver-id, tag |
+| tag | tag |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| gserver-id | [gserver](help/database/db_gserver) | id |
+
Return to [database documentation](help/database)
Global servers
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ---------------- | -------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| failed | Connection failed | boolean | YES | | NULL | |
| next_contact | Next connection request | datetime | YES | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| nurl | UNIQUE, nurl(190) |
+| next_contact | next_contact |
+| network | network |
+
+
Return to [database documentation](help/database)
addon hook registry
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ---------------------------------------------------------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| function | function name of hook handler | varbinary(200) | NO | | | |
| priority | not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order | smallint unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| priority | priority |
+| hook_file_function | UNIQUE, hook, file, function |
+
+
Return to [database documentation](help/database)
Hostname
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ------------- | ---------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | tinyint unsigned | NO | PRI | NULL | auto_increment |
| name | The hostname | varchar(128) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| name | UNIQUE, name |
+
+
Return to [database documentation](help/database)
Status of ActivityPub inboxes
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ------------------------------------ | -------------- | ---- | --- | ------------------- | ----- |
| url | URL of the inbox | varbinary(255) | NO | PRI | NULL | |
| archive | Is the inbox archived? | boolean | NO | | 0 | |
| shared | Is it a shared inbox? | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | url |
+
+
Return to [database documentation](help/database)
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ---------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| blocked | | boolean | NO | | 1 | |
| ignore | | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| contact-id | contact-id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| contact-id | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
URI and GUID for items
+Fields
+------
+
| 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 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uri | UNIQUE, uri |
+| guid | guid |
+
+
Return to [database documentation](help/database)
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ---------------------------- | ------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| pid | Process ID | int unsigned | NO | | 0 | |
| expires | datetime of cache expiration | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| name_expires | name, expires |
+
+
Return to [database documentation](help/database)
private messages
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | -------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | YES | | NULL | |
| created | creation time of the private message | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_seen | uid, seen |
+| convid | convid |
+| uri | uri(64) |
+| parent-uri | parent-uri(64) |
+| contactid | contact-id(32) |
+| author-id | author-id |
+| uri-id | uri-id |
+| parent-uri-id | parent-uri-id |
+| thr-parent-id | thr-parent-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| author-id | [contact](help/database/db_contact) | id |
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+| thr-parent-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
Mail account data for fetching mails
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| pubmail | | boolean | NO | | 0 | |
| last_check | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
table of accounts that can manage each other
+Fields
+------
+
| 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 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_mid | UNIQUE, uid, mid |
+| mid | mid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| mid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
notifications
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | ------------------------------------------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| created | | datetime | YES | | NULL | |
| seen | | boolean | YES | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_vid_type_actor-id_target-uri-id | UNIQUE, uid, vid, type, actor-id, target-uri-id |
+| vid | vid |
+| actor-id | actor-id |
+| target-uri-id | target-uri-id |
+| parent-uri-id | parent-uri-id |
+| seen_uid | seen, uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| vid | [verb](help/database/db_verb) | id |
+| actor-id | [contact](help/database/db_contact) | id |
+| target-uri-id | [item-uri](help/database/db_item-uri) | id |
+| parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------------------- | --------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| parent-item | | int unsigned | NO | | 0 | |
| receiver-uid | User id | mediumint unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| master-parent-uri-id | master-parent-uri-id |
+| receiver-uid | receiver-uid |
+| notify-id | notify-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| notify-id | [notify](help/database/db_notify) | id |
+| master-parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+| receiver-uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
notifications
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | --------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| name_cache | Cached bbcode parsing of name | tinytext | YES | | NULL | |
| msg_cache | Cached bbcode parsing of msg | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| seen_uid_date | seen, uid, date |
+| uid_date | uid, date |
+| uid_type_link | uid, type, link(190) |
+| uri-id | uri-id |
+| parent-uri-id | parent-uri-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
cache for OEmbed queries
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ------------------------------ | ------------------ | ---- | --- | ------------------- | ----- |
| url | page url | varbinary(255) | NO | PRI | NULL | |
| content | OEmbed data of the page | mediumtext | YES | | NULL | |
| created | datetime of creation | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | url, maxwidth |
+| created | created |
+
+
Return to [database documentation](help/database)
Store OpenWebAuth token to verify contacts
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | -------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| meta | | varchar(255) | NO | | | |
| created | datetime of creation | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
cache for 'parse_url' queries
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | --------------------------------- | ---------- | ---- | --- | ------------------- | ----- |
| url_hash | page url hash | binary(64) | NO | PRI | NULL | |
| created | datetime of creation | datetime | NO | | 0001-01-01 00:00:00 | |
| expires | datetime of expiration | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | url_hash, guessing, oembed |
+| created | created |
+| expires | expires |
+
+
Return to [database documentation](help/database)
personal (per user) configuration storage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ------------------ | ---- | --- | ------- | -------------- |
| id | Primary key | int unsigned | NO | PRI | NULL | auto_increment |
| k | Key | varchar(100) | NO | | | |
| v | Value | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_cat_k | UNIQUE, uid, cat, k |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| deny_cid | Access Control - list of denied contact.id | mediumtext | YES | | NULL | |
| deny_gid | Access Control - list of denied groups | mediumtext | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_allow_cid_allow_gid_deny_cid_deny_gid | uid, allow_cid(50), allow_gid(30), deny_cid(50), deny_gid(30) |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
photo storage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | ------------------------------------------------------ | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| backend-ref | Storage backend data reference | text | YES | | NULL | |
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| contactid | contact-id |
+| uid_contactid | uid, contact-id |
+| uid_profile | uid, profile |
+| uid_album_scale_created | uid, album(32), scale, created |
+| uid_album_resource-id_created | uid, album(32), resource-id, created |
+| resource-id | resource-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| contact-id | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
post relation to categories
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------ | --------------------------------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| type | | tinyint unsigned | NO | PRI | 0 | |
| tid | | int unsigned | NO | PRI | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id, uid, type, tid |
+| uri-id | tid |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| uid | [user](help/database/db_user) | uid |
+| tid | [tag](help/database/db_tag) | id |
+
Return to [database documentation](help/database)
Content for all posts
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| 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) | NO | | | |
| plink | permalink or URL to a displayable copy of the message at its source | varchar(255) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id |
+| plink | plink(191) |
+| resource-id | resource-id |
+| title-content-warning-body | FULLTEXT, title, content-warning, body |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
Delivery data for items
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| diaspora | Number of successful deliveries via Diaspora | mediumint | NO | | 0 | |
| ostatus | Number of successful deliveries via OStatus | mediumint | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
Attached media
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
| publisher-image | Image of the publisher of the media | varbinary(255) | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uri-id-url | UNIQUE, uri-id, url |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+
Return to [database documentation](help/database)
post relation to tags
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------ | --------------------------------------------------------- | ---------------- | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| tid | | int unsigned | NO | PRI | 0 | |
| cid | Contact id of the mentioned public contact | int unsigned | NO | PRI | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id, type, tid, cid |
+| tid | tid |
+| cid | cid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| tid | [tag](help/database/db_tag) | id |
+| cid | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
Thread related data per user
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | ------------------------------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| psid | ID of the permission set of this post | int unsigned | YES | | NULL | |
| post-user-id | Id of the post-user table | int unsigned | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uid, uri-id |
+| uri-id | uri-id |
+| owner-id | owner-id |
+| author-id | author-id |
+| causer-id | causer-id |
+| uid | uid |
+| contact-id | contact-id |
+| psid | psid |
+| post-user-id | post-user-id |
+| commented | commented |
+| uid_received | uid, received |
+| uid_pinned | uid, pinned |
+| uid_commented | uid, commented |
+| uid_starred | uid, starred |
+| uid_mention | uid, mention |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| owner-id | [contact](help/database/db_contact) | id |
+| author-id | [contact](help/database/db_contact) | id |
+| causer-id | [contact](help/database/db_contact) | id |
+| uid | [user](help/database/db_user) | uid |
+| contact-id | [contact](help/database/db_contact) | id |
+| psid | [permissionset](help/database/db_permissionset) | id |
+| post-user-id | [post-user](help/database/db_post-user) | id |
+
Return to [database documentation](help/database)
Thread related data
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------------------------------------------------------------------------------- | ------------ | ---- | --- | ------------------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| changed | Date that something in the conversation changed, indicating clients should fetch the conversation again | datetime | NO | | 0001-01-01 00:00:00 | |
| commented | | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id |
+| owner-id | owner-id |
+| author-id | author-id |
+| causer-id | causer-id |
+| received | received |
+| commented | commented |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| owner-id | [contact](help/database/db_contact) | id |
+| author-id | [contact](help/database/db_contact) | id |
+| causer-id | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
User post notifications
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----------------- | --------------------------------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| uid | Owner id which owns this copy of the item | mediumint unsigned | NO | PRI | NULL | |
| notification-type | | tinyint unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uid, uri-id |
+| uri-id | uri-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
User specific post data
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----------------- | --------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| origin | item originated at this site | boolean | NO | | 0 | |
| psid | ID of the permission set of this post | int unsigned | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_uri-id | UNIQUE, uid, uri-id |
+| uri-id | uri-id |
+| parent-uri-id | parent-uri-id |
+| thr-parent-id | thr-parent-id |
+| external-id | external-id |
+| owner-id | owner-id |
+| author-id | author-id |
+| causer-id | causer-id |
+| vid | vid |
+| contact-id | contact-id |
+| event-id | event-id |
+| psid | psid |
+| author-id_uid | author-id, uid |
+| author-id_received | author-id, received |
+| parent-uri-id_uid | parent-uri-id, uid |
+| uid_contactid | uid, contact-id |
+| uid_unseen_contactid | uid, unseen, contact-id |
+| uid_unseen | uid, unseen |
+| uid_hidden_uri-id | uid, hidden, uri-id |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+| thr-parent-id | [item-uri](help/database/db_item-uri) | id |
+| external-id | [item-uri](help/database/db_item-uri) | id |
+| owner-id | [contact](help/database/db_contact) | id |
+| author-id | [contact](help/database/db_contact) | id |
+| causer-id | [contact](help/database/db_contact) | id |
+| vid | [verb](help/database/db_verb) | id |
+| uid | [user](help/database/db_user) | uid |
+| contact-id | [contact](help/database/db_contact) | id |
+| event-id | [event](help/database/db_event) | id |
+| psid | [permissionset](help/database/db_permissionset) | id |
+
Return to [database documentation](help/database)
Structure for all posts
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------- | --------------------------------------------------------------------------------- | ----------------- | ---- | --- | ------------------- | ----- |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
| visible | | boolean | NO | | 0 | |
| deleted | item has been marked for deletion | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uri-id |
+| parent-uri-id | parent-uri-id |
+| thr-parent-id | thr-parent-id |
+| external-id | external-id |
+| owner-id | owner-id |
+| author-id | author-id |
+| causer-id | causer-id |
+| vid | vid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uri-id | [item-uri](help/database/db_item-uri) | id |
+| parent-uri-id | [item-uri](help/database/db_item-uri) | id |
+| thr-parent-id | [item-uri](help/database/db_item-uri) | id |
+| external-id | [item-uri](help/database/db_item-uri) | id |
+| owner-id | [contact](help/database/db_contact) | id |
+| author-id | [contact](help/database/db_contact) | id |
+| causer-id | [contact](help/database/db_contact) | id |
+| vid | [verb](help/database/db_verb) | id |
+
Return to [database documentation](help/database)
Currently running system processes
+Fields
+------
+
| 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 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | pid |
+| command | command |
+
+
Return to [database documentation](help/database)
user profiles data
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | --------------------------------------------- | ------------------ | ---- | --- | ---------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| publish | publish default profile in local directory | boolean | NO | | 0 | |
| net-publish | publish profile in global directory | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_is-default | uid, is-default |
+| pub_keywords | FULLTEXT, pub_keywords |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
DFRN remote auth use
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ------------- | ------------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| sec | | varchar(255) | NO | | | |
| expire | | int unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+| cid | cid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| cid | [contact](help/database/db_contact) | id |
+
Return to [database documentation](help/database)
Custom profile fields
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | ----------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| created | creation time | datetime | NO | | 0001-01-01 00:00:00 | |
| edited | last edit time | datetime | NO | | 0001-01-01 00:00:00 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+| order | order |
+| psid | psid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+| psid | [permissionset](help/database/db_permissionset) | id |
+
Return to [database documentation](help/database)
Used for OStatus: Contains feed subscribers
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | --------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| renewed | Date of last subscription renewal | datetime | NO | | 0001-01-01 00:00:00 | |
| secret | | varchar(255) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| next_try | next_try |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
registrations requiring admin approval
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| language | | varchar(16) | NO | | | |
| note | | text | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
+Fields
+------
+
| 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 | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| uid_term | uid, term(64) |
+| term | term(64) |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
web session storage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------ | ------------- | --------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | bigint unsigned | NO | PRI | NULL | auto_increment |
| data | | text | YES | | NULL | |
| expire | | int unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| sid | sid(64) |
+| expire | expire |
+
+
Return to [database documentation](help/database)
Data stored by Database storage backend
+Fields
+------
+
| 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 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+
+
Return to [database documentation](help/database)
tags and mentions
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | -------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| name | | varchar(96) | NO | | | |
| url | | varbinary(255) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| type_name_url | UNIQUE, name, url |
+| url | url |
+
+
Return to [database documentation](help/database)
OAuth usage
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ----------- | ------------------ | ---- | --- | ------- | ----- |
| id | | varchar(40) | NO | PRI | NULL | |
| scope | | varchar(200) | NO | | | |
| uid | User id | mediumint unsigned | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| client_id | client_id |
+| uid | uid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| client_id | [clients](help/database/db_clients) | client_id |
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
User specific public contact data
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| cid | Contact id of the linked public contact | int unsigned | NO | PRI | 0 | |
| ignored | Posts from this contact are ignored | boolean | YES | | NULL | |
| collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uid, cid |
+| cid | cid |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| cid | [contact](help/database/db_contact) | id |
+| uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
The local users
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ------------------------ | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| uid | sequential ID | mediumint unsigned | NO | PRI | NULL | auto_increment |
| deny_gid | default permission for this user | mediumtext | YES | | NULL | |
| openidserver | | text | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | uid |
+| nickname | nickname(32) |
+| parent-uid | parent-uid |
+| guid | guid |
+| email | email(64) |
+
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+| parent-uid | [user](help/database/db_user) | uid |
+
Return to [database documentation](help/database)
Deleted usernames
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | ------------- | ------------ | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| username | | varchar(255) | NO | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| username | username(32) |
+
+
Return to [database documentation](help/database)
Activity Verbs
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ----------------- | ---- | --- | ------- | -------------- |
| id | | smallint unsigned | NO | PRI | NULL | auto_increment |
| name | | varchar(100) | NO | | | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| name | name |
+
+
Return to [database documentation](help/database)
Inter process communication between the frontend and the worker
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ------------------------- | ------- | ---- | --- | ------- | ----- |
| key | | int | NO | PRI | NULL | |
| jobs | Flag for outstanding jobs | boolean | YES | | NULL | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | key |
+
+
Return to [database documentation](help/database)
Background tasks queue entries
+Fields
+------
+
| Field | Description | Type | Null | Key | Default | Extra |
| --------- | ------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | Auto incremented worker task id | int unsigned | NO | PRI | NULL | auto_increment |
| retrial | Retrial counter | tinyint | NO | | 0 | |
| done | Marked 1 when the task was done - will be deleted later | boolean | NO | | 0 | |
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+| PRIMARY | id |
+| command | command |
+| done_command_parameter | done, command, parameter(64) |
+| done_executed | done, executed |
+| done_priority_retrial_created | done, priority, retrial, created |
+| done_priority_next_try | done, priority, next_try |
+| done_pid_next_try | done, pid, next_try |
+| done_pid_retrial | done, pid, retrial |
+| done_pid_priority_created | done, pid, priority, created |
+
+
Return to [database documentation](help/database)
$tables = [];
foreach (self::definition(null) as $name => $definition) {
+ $indexes = [];
+ foreach ($definition['indexes'] as $key => $value) {
+ $indexes[] = ['name' => $key, 'fields' => implode(', ', $value)];
+ }
+
+ $foreign = [];
$fields = [[
'name' => 'Field',
'comment' => 'Description',
'primary' => 'Key',
'default' => 'Default',
'extra' => 'Extra',
- ],
+ ],
[
'name' => '-',
'comment' => '-',
$field['primary'] = ($value['primary'] ?? false) ? 'PRI' : '';
$field['default'] = $value['default'] ?? 'NULL';
$field['extra'] = $value['extra'] ?? '';
-
+
foreach ($field as $fieldname => $fieldvalue) {
$lengths[$fieldname] = max($lengths[$fieldname] ?? 0, strlen($fieldvalue));
}
$fields[] = $field;
+
+ if (!empty($value['foreign'])) {
+ $foreign[] = [
+ 'field' => $key,
+ 'targettable' => array_keys($value['foreign'])[0],
+ 'targetfield' => array_values($value['foreign'])[0]
+ ];
+ }
}
array_walk_recursive($fields, function(&$value, $key) use ($lengths)
{
$value = str_pad($value, $lengths[$key], $value === '-' ? '-' : ' ');
});
-
+
$tables[] = ['name' => $name, 'comment' => $definition['comment']];
$content = Renderer::replaceMacros(Renderer::getMarkupTemplate('structure.tpl'), [
'$name' => $name,
'$comment' => $definition['comment'],
'$fields' => $fields,
+ '$indexes' => $indexes,
+ '$foreign' => $foreign,
]);
$filename = DI::basePath() . '/doc/database/db_' . $name . '.md';
file_put_contents($filename, $content);
}
asort($tables);
$content = Renderer::replaceMacros(Renderer::getMarkupTemplate('tables.tpl'), [
- '$tables' => $tables,
+ '$tables' => $tables,
]);
$filename = DI::basePath() . '/doc/database.md';
- file_put_contents($filename, $content);
+ file_put_contents($filename, $content);
}
public static function printStructure($basePath)
if ($verbose) {
echo "Zero contact added\n";
}
- }
+ }
} elseif (self::existsTable('contact') && $verbose) {
echo "Zero contact already added\n";
} elseif ($verbose) {
if (self::existsTable('permissionset')) {
if (!DBA::exists('permissionset', ['id' => 0])) {
- DBA::insert('permissionset', ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']);
+ DBA::insert('permissionset', ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']);
$lastid = DBA::lastInsertId();
if ($lastid != 0) {
DBA::update('permissionset', ['id' => 0], ['id' => $lastid]);
} elseif ($verbose) {
echo "permissionset: Table not found\n";
}
-
+
if (!self::existsForeignKeyForField('tokens', 'client_id')) {
$tokens = DBA::p("SELECT `tokens`.`id` FROM `tokens`
LEFT JOIN `clients` ON `clients`.`client_id` = `tokens`.`client_id`
{{$comment}}
+Fields
+------
+
{{foreach $fields as $field}}
| {{$field.name}} | {{$field.comment}} | {{$field.type}} | {{$field.null}} | {{$field.primary}} | {{$field.default}} | {{$field.extra}} |
{{/foreach}}
+Indexes
+------------
+
+| Name | Fields |
+|------|---------|
+{{foreach $indexes as $index}}
+| {{$index.name}} | {{$index.fields}} |
+{{/foreach}}
+
+{{if $foreign}}
+Foreign Keys
+------------
+
+| Field | Target Table | Target Field |
+|-------|--------------|--------------|
+{{foreach $foreign as $key}}
+| {{$key.field}} | [{{$key.targettable}}](help/database/db_{{$key.targettable}}) | {{$key.targetfield}} |
+{{/foreach}}
+{{/if}}
+
Return to [database documentation](help/database)