Formatted index list

This commit is contained in:
Michael 2021-06-14 12:15:10 +00:00
parent 3d74d0a49c
commit 7106106f11
73 changed files with 375 additions and 360 deletions

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------------- | --------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_description | uid, description(190) | | uid_description | uid, description(190) |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | --------- |
| PRIMARY | uid, code | | PRIMARY | uid, code |
Foreign Keys Foreign Keys

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ----------- |
| PRIMARY | cookie_hash | | PRIMARY | cookie_hash |
| uid | uid | | uid | uid |

View File

@ -20,7 +20,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------------- | --------------- |
| PRIMARY | id | | PRIMARY | id |
| installed_name | installed, name | | installed_name | installed, name |
| name | UNIQUE, name | | name | UNIQUE, name |

View File

@ -37,7 +37,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ----------- | ---------------- |
| PRIMARY | url | | PRIMARY | url |
| addr | addr(32) | | addr | addr(32) |
| alias | alias(190) | | alias | alias(190) |

View File

@ -23,7 +23,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------------------- |
| PRIMARY | application-id, uid | | PRIMARY | application-id, uid |
| uid_id | uid, application-id | | uid_id | uid, application-id |

View File

@ -24,7 +24,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | ----------------- |
| PRIMARY | id | | PRIMARY | id |
| client_id | UNIQUE, client_id | | client_id | UNIQUE, client_id |

View File

@ -28,7 +28,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | --------- |
| PRIMARY | id | | PRIMARY | id |
| client_id | client_id | | client_id | client_id |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | ---------- |
| PRIMARY | k | | PRIMARY | k |
| k_expires | k, expires | | k_expires | k, expires |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| expire | expire | | expire | expire |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | --------- |
| PRIMARY | client_id | | PRIMARY | client_id |
| uid | uid | | uid | uid |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | -------------- |
| PRIMARY | id | | PRIMARY | id |
| cat_k | UNIQUE, cat, k | | cat_k | UNIQUE, cat, k |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------ | ----------------- |
| PRIMARY | cid, relation-cid | | PRIMARY | cid, relation-cid |
| relation-cid | relation-cid | | relation-cid | relation-cid |

View File

@ -93,7 +93,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------------------------- | ------------------------------------ |
| PRIMARY | id | | PRIMARY | id |
| uid_name | uid, name(190) | | uid_name | uid, name(190) |
| self_uid | self, uid | | self_uid | self, uid |

View File

@ -21,7 +21,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -21,7 +21,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ---------------- | ---------------- |
| PRIMARY | item-uri | | PRIMARY | item-uri |
| conversation-uri | conversation-uri | | conversation-uri | conversation-uri |
| received | received | | received | received |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | --------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_uri | UNIQUE, uid, uri(190) | | uid_uri | UNIQUE, uid, uri(190) |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | uri-id | | PRIMARY | uri-id |
Foreign Keys Foreign Keys

View File

@ -33,7 +33,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | ---------- |
| PRIMARY | id | | PRIMARY | id |
| uid_start | uid, start | | uid_start | uid, start |
| cid | cid | | cid | cid |

View File

@ -30,7 +30,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ---------------- |
| PRIMARY | id | | PRIMARY | id |
| addr | addr(32) | | addr | addr(32) |
| url | UNIQUE, url(190) | | url | UNIQUE, url(190) |

View File

@ -22,7 +22,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| cid | cid | | cid | cid |
| uid | uid | | uid | uid |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | ----------------------- |
| PRIMARY | id | | PRIMARY | id |
| contactid | contact-id | | contactid | contact-id |
| gid_contactid | UNIQUE, gid, contact-id | | gid_contactid | UNIQUE, gid, contact-id |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | --------------- |
| PRIMARY | gserver-id, tag | | PRIMARY | gserver-id, tag |
| tag | tag | | tag | tag |

View File

@ -36,7 +36,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------ | ----------------- |
| PRIMARY | id | | PRIMARY | id |
| nurl | UNIQUE, nurl(190) | | nurl | UNIQUE, nurl(190) |
| next_contact | next_contact | | next_contact | next_contact |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------------ | ---------------------------- |
| PRIMARY | id | | PRIMARY | id |
| priority | priority | | priority | priority |
| hook_file_function | UNIQUE, hook, file, function | | hook_file_function | UNIQUE, hook, file, function |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------------ |
| PRIMARY | id | | PRIMARY | id |
| name | UNIQUE, name | | name | UNIQUE, name |

View File

@ -20,7 +20,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | url | | PRIMARY | url |

View File

@ -24,7 +24,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ---------- | ---------- |
| PRIMARY | id | | PRIMARY | id |
| contact-id | contact-id | | contact-id | contact-id |
| uid | uid | | uid | uid |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ----------- |
| PRIMARY | id | | PRIMARY | id |
| uri | UNIQUE, uri | | uri | UNIQUE, uri |
| guid | guid | | guid | guid |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------ | ------------- |
| PRIMARY | id | | PRIMARY | id |
| name_expires | name, expires | | name_expires | name, expires |

View File

@ -35,7 +35,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | -------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_seen | uid, seen | | uid_seen | uid, seen |
| convid | convid | | convid | convid |

View File

@ -26,7 +26,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ---------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_mid | UNIQUE, uid, mid | | uid_mid | UNIQUE, uid, mid |
| mid | mid | | mid | mid |

View File

@ -22,7 +22,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ----------------------------------- | ----------------------------------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_vid_type_actor-id_target-uri-id | UNIQUE, uid, vid, type, actor-id, target-uri-id | | uid_vid_type_actor-id_target-uri-id | UNIQUE, uid, vid, type, actor-id, target-uri-id |
| vid | vid | | vid | vid |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------------------- | -------------------- |
| PRIMARY | id | | PRIMARY | id |
| master-parent-uri-id | master-parent-uri-id | | master-parent-uri-id | master-parent-uri-id |
| receiver-uid | receiver-uid | | receiver-uid | receiver-uid |

View File

@ -31,7 +31,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | -------------------- |
| PRIMARY | id | | PRIMARY | id |
| seen_uid_date | seen, uid, date | | seen_uid_date | seen, uid, date |
| uid_date | uid, date | | uid_date | uid, date |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------------- |
| PRIMARY | url, maxwidth | | PRIMARY | url, maxwidth |
| created | created | | created | created |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -20,7 +20,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | -------------------------- |
| PRIMARY | url_hash, guessing, oembed | | PRIMARY | url_hash, guessing, oembed |
| created | created | | created | created |
| expires | expires | | expires | expires |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | ------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_cat_k | UNIQUE, uid, cat, k | | uid_cat_k | UNIQUE, uid, cat, k |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ----------------------------------------- | ------------------------------------------------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_allow_cid_allow_gid_deny_cid_deny_gid | uid, allow_cid(50), allow_gid(30), deny_cid(50), deny_gid(30) | | uid_allow_cid_allow_gid_deny_cid_deny_gid | uid, allow_cid(50), allow_gid(30), deny_cid(50), deny_gid(30) |

View File

@ -40,7 +40,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ----------------------------- | ------------------------------------ |
| PRIMARY | id | | PRIMARY | id |
| contactid | contact-id | | contactid | contact-id |
| uid_contactid | uid, contact-id | | uid_contactid | uid, contact-id |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ---------------------- |
| PRIMARY | uri-id, uid, type, tid | | PRIMARY | uri-id, uid, type, tid |
| uri-id | tid | | uri-id | tid |
| uid | uid | | uid | uid |

View File

@ -30,7 +30,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------------------------- | -------------------------------------- |
| PRIMARY | uri-id | | PRIMARY | uri-id |
| plink | plink(191) | | plink | plink(191) |
| resource-id | resource-id | | resource-id | resource-id |

View File

@ -24,7 +24,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | uri-id | | PRIMARY | uri-id |
Foreign Keys Foreign Keys

View File

@ -32,7 +32,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ---------- | ------------------- |
| PRIMARY | id | | PRIMARY | id |
| uri-id-url | UNIQUE, uri-id, url | | uri-id-url | UNIQUE, uri-id, url |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ---------------------- |
| PRIMARY | uri-id, type, tid, cid | | PRIMARY | uri-id, type, tid, cid |
| tid | tid | | tid | tid |
| cid | cid | | cid | cid |

View File

@ -36,7 +36,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | -------------- |
| PRIMARY | uid, uri-id | | PRIMARY | uid, uri-id |
| uri-id | uri-id | | uri-id | uri-id |
| owner-id | owner-id | | owner-id | owner-id |

View File

@ -22,7 +22,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | --------- |
| PRIMARY | uri-id | | PRIMARY | uri-id |
| owner-id | owner-id | | owner-id | owner-id |
| author-id | author-id | | author-id | author-id |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ----------- |
| PRIMARY | uid, uri-id | | PRIMARY | uid, uri-id |
| uri-id | uri-id | | uri-id | uri-id |

View File

@ -43,7 +43,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------------------- | ----------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_uri-id | UNIQUE, uid, uri-id | | uid_uri-id | UNIQUE, uid, uri-id |
| uri-id | uri-id | | uri-id | uri-id |

View File

@ -31,7 +31,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | ------------- |
| PRIMARY | uri-id | | PRIMARY | uri-id |
| parent-uri-id | parent-uri-id | | parent-uri-id | parent-uri-id |
| thr-parent-id | thr-parent-id | | thr-parent-id | thr-parent-id |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------- |
| PRIMARY | pid | | PRIMARY | pid |
| command | command | | command | command |

View File

@ -55,7 +55,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------------- | ---------------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_is-default | uid, is-default | | uid_is-default | uid, is-default |
| pub_keywords | FULLTEXT, pub_keywords | | pub_keywords | FULLTEXT, pub_keywords |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |
| cid | cid | | cid | cid |

View File

@ -21,7 +21,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |
| order | order | | order | order |

View File

@ -23,7 +23,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------- | -------- |
| PRIMARY | id | | PRIMARY | id |
| next_try | next_try | | next_try | next_try |
| uid | uid | | uid | uid |

View File

@ -20,7 +20,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| uid | uid | | uid | uid |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------- | ------------- |
| PRIMARY | id | | PRIMARY | id |
| uid_term | uid, term(64) | | uid_term | uid, term(64) |
| term | term(64) | | term | term(64) |

View File

@ -17,7 +17,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------- |
| PRIMARY | id | | PRIMARY | id |
| sid | sid(64) | | sid | sid(64) |
| expire | expire | | expire | expire |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |

View File

@ -16,7 +16,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------------- | ----------------- |
| PRIMARY | id | | PRIMARY | id |
| type_name_url | UNIQUE, name, url | | type_name_url | UNIQUE, name, url |
| url | url | | url | url |

View File

@ -19,7 +19,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | --------- | --------- |
| PRIMARY | id | | PRIMARY | id |
| client_id | client_id | | client_id | client_id |
| uid | uid | | uid | uid |

View File

@ -18,7 +18,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | -------- |
| PRIMARY | uid, cid | | PRIMARY | uid, cid |
| cid | cid | | cid | cid |

View File

@ -58,7 +58,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ---------- | ------------ |
| PRIMARY | uid | | PRIMARY | uid |
| nickname | nickname(32) | | nickname | nickname(32) |
| parent-uid | parent-uid | | parent-uid | parent-uid |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | -------- | ------------ |
| PRIMARY | id | | PRIMARY | id |
| username | username(32) | | username | username(32) |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | id | | PRIMARY | id |
| name | name | | name | name |

View File

@ -15,7 +15,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ------- | ------ |
| PRIMARY | key | | PRIMARY | key |

View File

@ -23,7 +23,7 @@ Indexes
------------ ------------
| Name | Fields | | Name | Fields |
|------|--------| | ----------------------------- | -------------------------------- |
| PRIMARY | id | | PRIMARY | id |
| command | command | | command | command |
| done_command_parameter | done, command, parameter(64) | | done_command_parameter | done, command, parameter(64) |

View File

@ -166,11 +166,28 @@ class DBStructure
$tables = []; $tables = [];
foreach (self::definition(null) as $name => $definition) { 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) { 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 = []; $foreign = [];
$fields = [[ $fields = [[
'name' => 'Field', 'name' => 'Field',

View File

@ -13,8 +13,6 @@ Fields
Indexes Indexes
------------ ------------
| Name | Fields |
|------|--------|
{{foreach $indexes as $index}} {{foreach $indexes as $index}}
| {{$index.name}} | {{$index.fields}} | | {{$index.name}} | {{$index.fields}} |
{{/foreach}} {{/foreach}}