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}}