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 |
|------|--------|
| --------------- | --------------------- |
| PRIMARY | id |
| uid_description | uid, description(190) |

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ 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) |

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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',

View File

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