From 7106106f11ca1212351e785c6bd4c1f8e343d82c Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 14 Jun 2021 12:15:10 +0000 Subject: [PATCH] Formatted index list --- doc/database/db_2fa_app_specific_password.md | 6 +-- doc/database/db_2fa_recovery_codes.md | 4 +- doc/database/db_2fa_trusted_browser.md | 6 +-- doc/database/db_addon.md | 8 ++-- doc/database/db_apcontact.md | 16 +++---- doc/database/db_application-token.md | 6 +-- doc/database/db_application.md | 6 +-- doc/database/db_attach.md | 8 ++-- doc/database/db_auth_codes.md | 6 +-- doc/database/db_cache.md | 6 +-- doc/database/db_challenge.md | 8 ++-- doc/database/db_clients.md | 6 +-- doc/database/db_config.md | 8 ++-- doc/database/db_contact-relation.md | 8 ++-- doc/database/db_contact.md | 50 ++++++++++---------- doc/database/db_conv.md | 8 ++-- doc/database/db_conversation.md | 8 ++-- doc/database/db_delayed-post.md | 6 +-- doc/database/db_diaspora-interaction.md | 4 +- doc/database/db_event.md | 8 ++-- doc/database/db_fcontact.md | 10 ++-- doc/database/db_fsuggest.md | 10 ++-- doc/database/db_group.md | 8 ++-- doc/database/db_group_member.md | 8 ++-- doc/database/db_gserver-tag.md | 6 +-- doc/database/db_gserver.md | 12 ++--- doc/database/db_hook.md | 8 ++-- doc/database/db_host.md | 8 ++-- doc/database/db_inbox-status.md | 6 +-- doc/database/db_intro.md | 8 ++-- doc/database/db_item-uri.md | 10 ++-- doc/database/db_locks.md | 6 +-- doc/database/db_mail.md | 24 +++++----- doc/database/db_mailacct.md | 8 ++-- doc/database/db_manage.md | 8 ++-- doc/database/db_notification.md | 16 +++---- doc/database/db_notify-threads.md | 10 ++-- doc/database/db_notify.md | 14 +++--- doc/database/db_oembed.md | 6 +-- doc/database/db_openwebauth-token.md | 8 ++-- doc/database/db_parsed_url.md | 8 ++-- doc/database/db_pconfig.md | 6 +-- doc/database/db_permissionset.md | 6 +-- doc/database/db_photo.md | 16 +++---- doc/database/db_post-category.md | 8 ++-- doc/database/db_post-content.md | 10 ++-- doc/database/db_post-delivery-data.md | 4 +- doc/database/db_post-media.md | 6 +-- doc/database/db_post-tag.md | 8 ++-- doc/database/db_post-thread-user.md | 32 ++++++------- doc/database/db_post-thread.md | 10 ++-- doc/database/db_post-user-notification.md | 6 +-- doc/database/db_post-user.md | 42 ++++++++-------- doc/database/db_post.md | 16 +++---- doc/database/db_process.md | 6 +-- doc/database/db_profile.md | 10 ++-- doc/database/db_profile_check.md | 10 ++-- doc/database/db_profile_field.md | 12 ++--- doc/database/db_push_subscriber.md | 8 ++-- doc/database/db_register.md | 8 ++-- doc/database/db_search.md | 8 ++-- doc/database/db_session.md | 10 ++-- doc/database/db_storage.md | 6 +-- doc/database/db_tag.md | 8 ++-- doc/database/db_tokens.md | 8 ++-- doc/database/db_user-contact.md | 6 +-- doc/database/db_user.md | 14 +++--- doc/database/db_userd.md | 6 +-- doc/database/db_verb.md | 8 ++-- doc/database/db_worker-ipc.md | 6 +-- doc/database/db_workerqueue.md | 20 ++++---- src/Database/DBStructure.php | 21 +++++++- view/templates/structure.tpl | 2 - 73 files changed, 375 insertions(+), 360 deletions(-) diff --git a/doc/database/db_2fa_app_specific_password.md b/doc/database/db_2fa_app_specific_password.md index 9d9c7ca452..66dd77c95c 100644 --- a/doc/database/db_2fa_app_specific_password.md +++ b/doc/database/db_2fa_app_specific_password.md @@ -18,9 +18,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------------- | --------------------- | +| PRIMARY | id | | uid_description | uid, description(190) | Foreign Keys diff --git a/doc/database/db_2fa_recovery_codes.md b/doc/database/db_2fa_recovery_codes.md index e7c1940d85..69c34e6547 100644 --- a/doc/database/db_2fa_recovery_codes.md +++ b/doc/database/db_2fa_recovery_codes.md @@ -16,8 +16,8 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | --------- | | PRIMARY | uid, code | Foreign Keys diff --git a/doc/database/db_2fa_trusted_browser.md b/doc/database/db_2fa_trusted_browser.md index 9e12dabc7d..d12d9e1fc0 100644 --- a/doc/database/db_2fa_trusted_browser.md +++ b/doc/database/db_2fa_trusted_browser.md @@ -17,10 +17,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ----------- | | PRIMARY | cookie_hash | -| uid | uid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_addon.md b/doc/database/db_addon.md index 21fae66f34..7233b80095 100644 --- a/doc/database/db_addon.md +++ b/doc/database/db_addon.md @@ -19,11 +19,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| -------------- | --------------- | +| PRIMARY | id | | installed_name | installed, name | -| name | UNIQUE, name | +| name | UNIQUE, name | Return to [database documentation](help/database) diff --git a/doc/database/db_apcontact.md b/doc/database/db_apcontact.md index cb2f8327a8..5f5d21e4eb 100644 --- a/doc/database/db_apcontact.md +++ b/doc/database/db_apcontact.md @@ -36,15 +36,15 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | url | -| addr | addr(32) | -| alias | alias(190) | -| followers | followers(190) | -| baseurl | baseurl(190) | +| Name | Fields | +| ----------- | ---------------- | +| PRIMARY | url | +| addr | addr(32) | +| alias | alias(190) | +| followers | followers(190) | +| baseurl | baseurl(190) | | sharedinbox | sharedinbox(190) | -| gsid | gsid | +| gsid | gsid | Foreign Keys ------------ diff --git a/doc/database/db_application-token.md b/doc/database/db_application-token.md index 15f85f06ea..9899a5e8b3 100644 --- a/doc/database/db_application-token.md +++ b/doc/database/db_application-token.md @@ -22,10 +22,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ------------------- | | PRIMARY | application-id, uid | -| uid_id | uid, application-id | +| uid_id | uid, application-id | Foreign Keys ------------ diff --git a/doc/database/db_application.md b/doc/database/db_application.md index 2099b33743..0a91e703ad 100644 --- a/doc/database/db_application.md +++ b/doc/database/db_application.md @@ -23,9 +23,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------- | ----------------- | +| PRIMARY | id | | client_id | UNIQUE, client_id | diff --git a/doc/database/db_attach.md b/doc/database/db_attach.md index baef7c89dd..9eb0f36e94 100644 --- a/doc/database/db_attach.md +++ b/doc/database/db_attach.md @@ -27,10 +27,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_auth_codes.md b/doc/database/db_auth_codes.md index df53a5b280..a1d28e0965 100644 --- a/doc/database/db_auth_codes.md +++ b/doc/database/db_auth_codes.md @@ -17,9 +17,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------- | --------- | +| PRIMARY | id | | client_id | client_id | Foreign Keys diff --git a/doc/database/db_cache.md b/doc/database/db_cache.md index 770b4ab446..27a11daa66 100644 --- a/doc/database/db_cache.md +++ b/doc/database/db_cache.md @@ -16,9 +16,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | k | +| Name | Fields | +| --------- | ---------- | +| PRIMARY | k | | k_expires | k, expires | diff --git a/doc/database/db_challenge.md b/doc/database/db_challenge.md index a9f17bc631..1618389094 100644 --- a/doc/database/db_challenge.md +++ b/doc/database/db_challenge.md @@ -18,10 +18,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| expire | expire | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| expire | expire | Return to [database documentation](help/database) diff --git a/doc/database/db_clients.md b/doc/database/db_clients.md index 29f9fe52f5..a97e796edd 100644 --- a/doc/database/db_clients.md +++ b/doc/database/db_clients.md @@ -18,10 +18,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | --------- | | PRIMARY | client_id | -| uid | uid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_config.md b/doc/database/db_config.md index 32396dc743..7d7618794a 100644 --- a/doc/database/db_config.md +++ b/doc/database/db_config.md @@ -16,10 +16,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| cat_k | UNIQUE, cat, k | +| Name | Fields | +| ------- | -------------- | +| PRIMARY | id | +| cat_k | UNIQUE, cat, k | Return to [database documentation](help/database) diff --git a/doc/database/db_contact-relation.md b/doc/database/db_contact-relation.md index d9f74a40a4..8628b1ef66 100644 --- a/doc/database/db_contact-relation.md +++ b/doc/database/db_contact-relation.md @@ -17,10 +17,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | cid, relation-cid | -| relation-cid | relation-cid | +| Name | Fields | +| ------------ | ----------------- | +| PRIMARY | cid, relation-cid | +| relation-cid | relation-cid | Foreign Keys ------------ diff --git a/doc/database/db_contact.md b/doc/database/db_contact.md index 0cca0ed113..0e04c1ece8 100644 --- a/doc/database/db_contact.md +++ b/doc/database/db_contact.md @@ -92,31 +92,31 @@ Fields 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 | +| 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 ------------ diff --git a/doc/database/db_conv.md b/doc/database/db_conv.md index f53918291e..c1d50b5de5 100644 --- a/doc/database/db_conv.md +++ b/doc/database/db_conv.md @@ -20,10 +20,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_conversation.md b/doc/database/db_conversation.md index 308d5ee2bd..504b0dd4ae 100644 --- a/doc/database/db_conversation.md +++ b/doc/database/db_conversation.md @@ -20,11 +20,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | item-uri | +| Name | Fields | +| ---------------- | ---------------- | +| PRIMARY | item-uri | | conversation-uri | conversation-uri | -| received | received | +| received | received | Return to [database documentation](help/database) diff --git a/doc/database/db_delayed-post.md b/doc/database/db_delayed-post.md index d9faab2890..fe3251f70a 100644 --- a/doc/database/db_delayed-post.md +++ b/doc/database/db_delayed-post.md @@ -16,9 +16,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ------- | --------------------- | +| PRIMARY | id | | uid_uri | UNIQUE, uid, uri(190) | Foreign Keys diff --git a/doc/database/db_diaspora-interaction.md b/doc/database/db_diaspora-interaction.md index f56a72abd4..4ac4325909 100644 --- a/doc/database/db_diaspora-interaction.md +++ b/doc/database/db_diaspora-interaction.md @@ -14,8 +14,8 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ------ | | PRIMARY | uri-id | Foreign Keys diff --git a/doc/database/db_event.md b/doc/database/db_event.md index b222dc9159..d8b009639f 100644 --- a/doc/database/db_event.md +++ b/doc/database/db_event.md @@ -32,11 +32,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------- | ---------- | +| PRIMARY | id | | uid_start | uid, start | -| cid | cid | +| cid | cid | Foreign Keys ------------ diff --git a/doc/database/db_fcontact.md b/doc/database/db_fcontact.md index e3cf61fa5e..43a073f619 100644 --- a/doc/database/db_fcontact.md +++ b/doc/database/db_fcontact.md @@ -29,11 +29,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| addr | addr(32) | -| url | UNIQUE, url(190) | +| Name | Fields | +| ------- | ---------------- | +| PRIMARY | id | +| addr | addr(32) | +| url | UNIQUE, url(190) | Return to [database documentation](help/database) diff --git a/doc/database/db_fsuggest.md b/doc/database/db_fsuggest.md index 37d63c7c60..6ccf732971 100644 --- a/doc/database/db_fsuggest.md +++ b/doc/database/db_fsuggest.md @@ -21,11 +21,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| cid | cid | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| cid | cid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_group.md b/doc/database/db_group.md index 23150bdcbe..1892de3e40 100644 --- a/doc/database/db_group.md +++ b/doc/database/db_group.md @@ -17,10 +17,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_group_member.md b/doc/database/db_group_member.md index 2dd9fb41d6..a544f3b0ec 100644 --- a/doc/database/db_group_member.md +++ b/doc/database/db_group_member.md @@ -15,10 +15,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| contactid | contact-id | +| Name | Fields | +| ------------- | ----------------------- | +| PRIMARY | id | +| contactid | contact-id | | gid_contactid | UNIQUE, gid, contact-id | Foreign Keys diff --git a/doc/database/db_gserver-tag.md b/doc/database/db_gserver-tag.md index bce171f11f..82b0ccc881 100644 --- a/doc/database/db_gserver-tag.md +++ b/doc/database/db_gserver-tag.md @@ -14,10 +14,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | --------------- | | PRIMARY | gserver-id, tag | -| tag | tag | +| tag | tag | Foreign Keys ------------ diff --git a/doc/database/db_gserver.md b/doc/database/db_gserver.md index 66339427ee..905602b3b8 100644 --- a/doc/database/db_gserver.md +++ b/doc/database/db_gserver.md @@ -35,12 +35,12 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| nurl | UNIQUE, nurl(190) | -| next_contact | next_contact | -| network | network | +| Name | Fields | +| ------------ | ----------------- | +| PRIMARY | id | +| nurl | UNIQUE, nurl(190) | +| next_contact | next_contact | +| network | network | Return to [database documentation](help/database) diff --git a/doc/database/db_hook.md b/doc/database/db_hook.md index 622695a26f..0ad0981f0c 100644 --- a/doc/database/db_hook.md +++ b/doc/database/db_hook.md @@ -17,10 +17,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| priority | priority | +| Name | Fields | +| ------------------ | ---------------------------- | +| PRIMARY | id | +| priority | priority | | hook_file_function | UNIQUE, hook, file, function | diff --git a/doc/database/db_host.md b/doc/database/db_host.md index bccea5f870..4b2d4d1e5d 100644 --- a/doc/database/db_host.md +++ b/doc/database/db_host.md @@ -14,10 +14,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| name | UNIQUE, name | +| Name | Fields | +| ------- | ------------ | +| PRIMARY | id | +| name | UNIQUE, name | Return to [database documentation](help/database) diff --git a/doc/database/db_inbox-status.md b/doc/database/db_inbox-status.md index 7f6a5d5996..3b82cf46a0 100644 --- a/doc/database/db_inbox-status.md +++ b/doc/database/db_inbox-status.md @@ -19,9 +19,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | url | +| Name | Fields | +| ------- | ------ | +| PRIMARY | url | Return to [database documentation](help/database) diff --git a/doc/database/db_intro.md b/doc/database/db_intro.md index 5ea923fcef..426d8579dd 100644 --- a/doc/database/db_intro.md +++ b/doc/database/db_intro.md @@ -23,11 +23,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ---------- | ---------- | +| PRIMARY | id | | contact-id | contact-id | -| uid | uid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_item-uri.md b/doc/database/db_item-uri.md index c49ef3813f..c6d1c4c376 100644 --- a/doc/database/db_item-uri.md +++ b/doc/database/db_item-uri.md @@ -15,11 +15,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uri | UNIQUE, uri | -| guid | guid | +| Name | Fields | +| ------- | ----------- | +| PRIMARY | id | +| uri | UNIQUE, uri | +| guid | guid | Return to [database documentation](help/database) diff --git a/doc/database/db_locks.md b/doc/database/db_locks.md index 821db5fee7..dc5371184d 100644 --- a/doc/database/db_locks.md +++ b/doc/database/db_locks.md @@ -17,9 +17,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ------------ | ------------- | +| PRIMARY | id | | name_expires | name, expires | diff --git a/doc/database/db_mail.md b/doc/database/db_mail.md index 0558cff69a..460c03bf6a 100644 --- a/doc/database/db_mail.md +++ b/doc/database/db_mail.md @@ -34,18 +34,18 @@ Fields 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 | +| 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 ------------ diff --git a/doc/database/db_mailacct.md b/doc/database/db_mailacct.md index dba0fd9581..59f34250ce 100644 --- a/doc/database/db_mailacct.md +++ b/doc/database/db_mailacct.md @@ -25,10 +25,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_manage.md b/doc/database/db_manage.md index ccfa7170df..8a2228a5ef 100644 --- a/doc/database/db_manage.md +++ b/doc/database/db_manage.md @@ -15,11 +15,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ------- | ---------------- | +| PRIMARY | id | | uid_mid | UNIQUE, uid, mid | -| mid | mid | +| mid | mid | Foreign Keys ------------ diff --git a/doc/database/db_notification.md b/doc/database/db_notification.md index b5c0d7b1e3..ff059c344f 100644 --- a/doc/database/db_notification.md +++ b/doc/database/db_notification.md @@ -21,15 +21,15 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| 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 | +| vid | vid | +| actor-id | actor-id | +| target-uri-id | target-uri-id | +| parent-uri-id | parent-uri-id | +| seen_uid | seen, uid | Foreign Keys ------------ diff --git a/doc/database/db_notify-threads.md b/doc/database/db_notify-threads.md index 5a0157d844..82ed225f7d 100644 --- a/doc/database/db_notify-threads.md +++ b/doc/database/db_notify-threads.md @@ -18,12 +18,12 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| -------------------- | -------------------- | +| PRIMARY | id | | master-parent-uri-id | master-parent-uri-id | -| receiver-uid | receiver-uid | -| notify-id | notify-id | +| receiver-uid | receiver-uid | +| notify-id | notify-id | Foreign Keys ------------ diff --git a/doc/database/db_notify.md b/doc/database/db_notify.md index f1eb358816..250734e56c 100644 --- a/doc/database/db_notify.md +++ b/doc/database/db_notify.md @@ -30,14 +30,14 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| seen_uid_date | seen, uid, date | -| uid_date | uid, date | +| 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 | +| uri-id | uri-id | +| parent-uri-id | parent-uri-id | Foreign Keys ------------ diff --git a/doc/database/db_oembed.md b/doc/database/db_oembed.md index f3a6a02319..8304a32f4b 100644 --- a/doc/database/db_oembed.md +++ b/doc/database/db_oembed.md @@ -16,10 +16,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ------------- | | PRIMARY | url, maxwidth | -| created | created | +| created | created | Return to [database documentation](help/database) diff --git a/doc/database/db_openwebauth-token.md b/doc/database/db_openwebauth-token.md index 05313df621..c330623d92 100644 --- a/doc/database/db_openwebauth-token.md +++ b/doc/database/db_openwebauth-token.md @@ -18,10 +18,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_parsed_url.md b/doc/database/db_parsed_url.md index 1bb4083578..67ea5caebf 100644 --- a/doc/database/db_parsed_url.md +++ b/doc/database/db_parsed_url.md @@ -19,11 +19,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | -------------------------- | | PRIMARY | url_hash, guessing, oembed | -| created | created | -| expires | expires | +| created | created | +| expires | expires | Return to [database documentation](help/database) diff --git a/doc/database/db_pconfig.md b/doc/database/db_pconfig.md index f1e031f2a0..cf9b0d7810 100644 --- a/doc/database/db_pconfig.md +++ b/doc/database/db_pconfig.md @@ -17,9 +17,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------- | ------------------- | +| PRIMARY | id | | uid_cat_k | UNIQUE, uid, cat, k | Foreign Keys diff --git a/doc/database/db_permissionset.md b/doc/database/db_permissionset.md index a9e2374292..107cedea18 100644 --- a/doc/database/db_permissionset.md +++ b/doc/database/db_permissionset.md @@ -18,9 +18,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| 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 diff --git a/doc/database/db_photo.md b/doc/database/db_photo.md index 964530d7ec..aad26bdbeb 100644 --- a/doc/database/db_photo.md +++ b/doc/database/db_photo.md @@ -39,15 +39,15 @@ Fields 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 | +| 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 | +| resource-id | resource-id | Foreign Keys ------------ diff --git a/doc/database/db_post-category.md b/doc/database/db_post-category.md index 2d758905f3..b825a8f4b1 100644 --- a/doc/database/db_post-category.md +++ b/doc/database/db_post-category.md @@ -16,11 +16,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ---------------------- | | PRIMARY | uri-id, uid, type, tid | -| uri-id | tid | -| uid | uid | +| uri-id | tid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_post-content.md b/doc/database/db_post-content.md index 2e055d820b..0addf43a31 100644 --- a/doc/database/db_post-content.md +++ b/doc/database/db_post-content.md @@ -29,11 +29,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | uri-id | -| plink | plink(191) | -| resource-id | resource-id | +| Name | Fields | +| -------------------------- | -------------------------------------- | +| PRIMARY | uri-id | +| plink | plink(191) | +| resource-id | resource-id | | title-content-warning-body | FULLTEXT, title, content-warning, body | Foreign Keys diff --git a/doc/database/db_post-delivery-data.md b/doc/database/db_post-delivery-data.md index f7273b5ef9..ad4ca6af32 100644 --- a/doc/database/db_post-delivery-data.md +++ b/doc/database/db_post-delivery-data.md @@ -23,8 +23,8 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ------ | | PRIMARY | uri-id | Foreign Keys diff --git a/doc/database/db_post-media.md b/doc/database/db_post-media.md index a6c151d035..e17a04e5fb 100644 --- a/doc/database/db_post-media.md +++ b/doc/database/db_post-media.md @@ -31,9 +31,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ---------- | ------------------- | +| PRIMARY | id | | uri-id-url | UNIQUE, uri-id, url | Foreign Keys diff --git a/doc/database/db_post-tag.md b/doc/database/db_post-tag.md index 5d4caad221..7811f32e07 100644 --- a/doc/database/db_post-tag.md +++ b/doc/database/db_post-tag.md @@ -16,11 +16,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ---------------------- | | PRIMARY | uri-id, type, tid, cid | -| tid | tid | -| cid | cid | +| tid | tid | +| cid | cid | Foreign Keys ------------ diff --git a/doc/database/db_post-thread-user.md b/doc/database/db_post-thread-user.md index 9b6accc23d..3efb5a77af 100644 --- a/doc/database/db_post-thread-user.md +++ b/doc/database/db_post-thread-user.md @@ -35,23 +35,23 @@ Fields 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 | +| 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 | +| uid_starred | uid, starred | +| uid_mention | uid, mention | Foreign Keys ------------ diff --git a/doc/database/db_post-thread.md b/doc/database/db_post-thread.md index c13be54ba4..96fd0d4275 100644 --- a/doc/database/db_post-thread.md +++ b/doc/database/db_post-thread.md @@ -21,13 +21,13 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | uri-id | -| owner-id | owner-id | +| Name | Fields | +| --------- | --------- | +| PRIMARY | uri-id | +| owner-id | owner-id | | author-id | author-id | | causer-id | causer-id | -| received | received | +| received | received | | commented | commented | Foreign Keys diff --git a/doc/database/db_post-user-notification.md b/doc/database/db_post-user-notification.md index db024b621d..36edd4a289 100644 --- a/doc/database/db_post-user-notification.md +++ b/doc/database/db_post-user-notification.md @@ -15,10 +15,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | ----------- | | PRIMARY | uid, uri-id | -| uri-id | uri-id | +| uri-id | uri-id | Foreign Keys ------------ diff --git a/doc/database/db_post-user.md b/doc/database/db_post-user.md index a3b30c9b14..5fbc3e985a 100644 --- a/doc/database/db_post-user.md +++ b/doc/database/db_post-user.md @@ -42,28 +42,28 @@ Fields 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 | +| 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 | +| uid_unseen | uid, unseen | +| uid_hidden_uri-id | uid, hidden, uri-id | Foreign Keys ------------ diff --git a/doc/database/db_post.md b/doc/database/db_post.md index 8d74100523..303269b1c6 100644 --- a/doc/database/db_post.md +++ b/doc/database/db_post.md @@ -30,16 +30,16 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | uri-id | +| 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 | +| external-id | external-id | +| owner-id | owner-id | +| author-id | author-id | +| causer-id | causer-id | +| vid | vid | Foreign Keys ------------ diff --git a/doc/database/db_process.md b/doc/database/db_process.md index fb76d998ef..062e6ff22c 100644 --- a/doc/database/db_process.md +++ b/doc/database/db_process.md @@ -15,9 +15,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | pid | +| Name | Fields | +| ------- | ------- | +| PRIMARY | pid | | command | command | diff --git a/doc/database/db_profile.md b/doc/database/db_profile.md index d0bbcb6d2e..4ea3b56003 100644 --- a/doc/database/db_profile.md +++ b/doc/database/db_profile.md @@ -54,11 +54,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid_is-default | uid, is-default | -| pub_keywords | FULLTEXT, pub_keywords | +| Name | Fields | +| -------------- | ---------------------- | +| PRIMARY | id | +| uid_is-default | uid, is-default | +| pub_keywords | FULLTEXT, pub_keywords | Foreign Keys ------------ diff --git a/doc/database/db_profile_check.md b/doc/database/db_profile_check.md index 96931618ca..4049bd6048 100644 --- a/doc/database/db_profile_check.md +++ b/doc/database/db_profile_check.md @@ -18,11 +18,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | -| cid | cid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | +| cid | cid | Foreign Keys ------------ diff --git a/doc/database/db_profile_field.md b/doc/database/db_profile_field.md index e2fbad3031..56e8e3d0b6 100644 --- a/doc/database/db_profile_field.md +++ b/doc/database/db_profile_field.md @@ -20,12 +20,12 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | -| order | order | -| psid | psid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | +| order | order | +| psid | psid | Foreign Keys ------------ diff --git a/doc/database/db_push_subscriber.md b/doc/database/db_push_subscriber.md index ffcf56f888..4ba50a4d1d 100644 --- a/doc/database/db_push_subscriber.md +++ b/doc/database/db_push_subscriber.md @@ -22,11 +22,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| -------- | -------- | +| PRIMARY | id | | next_try | next_try | -| uid | uid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_register.md b/doc/database/db_register.md index 2367b9d9fb..8ace3c199b 100644 --- a/doc/database/db_register.md +++ b/doc/database/db_register.md @@ -19,10 +19,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| uid | uid | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_search.md b/doc/database/db_search.md index 42c179a046..157d09ecb8 100644 --- a/doc/database/db_search.md +++ b/doc/database/db_search.md @@ -15,11 +15,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| -------- | ------------- | +| PRIMARY | id | | uid_term | uid, term(64) | -| term | term(64) | +| term | term(64) | Foreign Keys ------------ diff --git a/doc/database/db_session.md b/doc/database/db_session.md index 775088c0aa..794e49c6a7 100644 --- a/doc/database/db_session.md +++ b/doc/database/db_session.md @@ -16,11 +16,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| sid | sid(64) | -| expire | expire | +| Name | Fields | +| ------- | ------- | +| PRIMARY | id | +| sid | sid(64) | +| expire | expire | Return to [database documentation](help/database) diff --git a/doc/database/db_storage.md b/doc/database/db_storage.md index 9c8495967f..55911e28a6 100644 --- a/doc/database/db_storage.md +++ b/doc/database/db_storage.md @@ -14,9 +14,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | Return to [database documentation](help/database) diff --git a/doc/database/db_tag.md b/doc/database/db_tag.md index a7c47e9fc1..8c742917a7 100644 --- a/doc/database/db_tag.md +++ b/doc/database/db_tag.md @@ -15,11 +15,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| ------------- | ----------------- | +| PRIMARY | id | | type_name_url | UNIQUE, name, url | -| url | url | +| url | url | Return to [database documentation](help/database) diff --git a/doc/database/db_tokens.md b/doc/database/db_tokens.md index 3620f5fb5e..7cf9bba4cc 100644 --- a/doc/database/db_tokens.md +++ b/doc/database/db_tokens.md @@ -18,11 +18,11 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| --------- | --------- | +| PRIMARY | id | | client_id | client_id | -| uid | uid | +| uid | uid | Foreign Keys ------------ diff --git a/doc/database/db_user-contact.md b/doc/database/db_user-contact.md index 69adc0c6b1..35d140cfff 100644 --- a/doc/database/db_user-contact.md +++ b/doc/database/db_user-contact.md @@ -17,10 +17,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| +| Name | Fields | +| ------- | -------- | | PRIMARY | uid, cid | -| cid | cid | +| cid | cid | Foreign Keys ------------ diff --git a/doc/database/db_user.md b/doc/database/db_user.md index a2f9d931de..611fb76b05 100644 --- a/doc/database/db_user.md +++ b/doc/database/db_user.md @@ -57,13 +57,13 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | uid | -| nickname | nickname(32) | -| parent-uid | parent-uid | -| guid | guid | -| email | email(64) | +| Name | Fields | +| ---------- | ------------ | +| PRIMARY | uid | +| nickname | nickname(32) | +| parent-uid | parent-uid | +| guid | guid | +| email | email(64) | Foreign Keys ------------ diff --git a/doc/database/db_userd.md b/doc/database/db_userd.md index 7fce9ce9ab..17a81b408a 100644 --- a/doc/database/db_userd.md +++ b/doc/database/db_userd.md @@ -14,9 +14,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | +| Name | Fields | +| -------- | ------------ | +| PRIMARY | id | | username | username(32) | diff --git a/doc/database/db_verb.md b/doc/database/db_verb.md index 887f5fc4e8..43507053b2 100644 --- a/doc/database/db_verb.md +++ b/doc/database/db_verb.md @@ -14,10 +14,10 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| name | name | +| Name | Fields | +| ------- | ------ | +| PRIMARY | id | +| name | name | Return to [database documentation](help/database) diff --git a/doc/database/db_worker-ipc.md b/doc/database/db_worker-ipc.md index be9a07d0f7..1635981d70 100644 --- a/doc/database/db_worker-ipc.md +++ b/doc/database/db_worker-ipc.md @@ -14,9 +14,9 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | key | +| Name | Fields | +| ------- | ------ | +| PRIMARY | key | Return to [database documentation](help/database) diff --git a/doc/database/db_workerqueue.md b/doc/database/db_workerqueue.md index 81596192c6..a479ecbcaa 100644 --- a/doc/database/db_workerqueue.md +++ b/doc/database/db_workerqueue.md @@ -22,17 +22,17 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| -| PRIMARY | id | -| command | command | -| done_command_parameter | done, command, parameter(64) | -| done_executed | done, executed | +| 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 | +| 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) diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 864f2ded3f..9af6100a0a 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -166,11 +166,28 @@ class DBStructure $tables = []; foreach (self::definition(null) as $name => $definition) { - $indexes = []; + $indexes = [[ + 'name' => 'Name', + 'fields' => 'Fields', + ], + [ + 'name' => '-', + 'fields' => '-', + ]]; + + $lengths = ['name' => 4, 'fields' => 6]; foreach ($definition['indexes'] as $key => $value) { - $indexes[] = ['name' => $key, 'fields' => implode(', ', $value)]; + $fieldlist = implode(', ', $value); + $indexes[] = ['name' => $key, 'fields' => $fieldlist]; + $lengths['name'] = max($lengths['name'], strlen($key)); + $lengths['fields'] = max($lengths['fields'], strlen($fieldlist)); } + array_walk_recursive($indexes, function(&$value, $key) use ($lengths) + { + $value = str_pad($value, $lengths[$key], $value === '-' ? '-' : ' '); + }); + $foreign = []; $fields = [[ 'name' => 'Field', diff --git a/view/templates/structure.tpl b/view/templates/structure.tpl index 77ee1e85ad..954712f12a 100644 --- a/view/templates/structure.tpl +++ b/view/templates/structure.tpl @@ -13,8 +13,6 @@ Fields Indexes ------------ -| Name | Fields | -|------|--------| {{foreach $indexes as $index}} | {{$index.name}} | {{$index.fields}} | {{/foreach}}