diff --git a/docs/graph/_images/db-schema.dot b/docs/graph/_images/db-schema.dot new file mode 100644 index 0000000..d242dfb --- /dev/null +++ b/docs/graph/_images/db-schema.dot @@ -0,0 +1,109 @@ +digraph g { +graph [ +rankdir = "LR", +concentrate = true, +ratio = auto +]; +node [ +fontsize = "10", +shape = record +]; +edge [ +]; + +"content" [shape = plaintext, label = <
\N
sha1 string
sha1_git string
sha256 string
blake2s256 string
length bigint
status string
> ]; + +"skipped_content" [shape = plaintext, label = <
\N
sha1 string
sha1_git string
sha256 string
blake2s256 string
length bigint
status string
reason string
> ]; + +"directory" [shape = plaintext, label = <
\N
id string
> ]; + +"directory_entry" [shape = plaintext, label = <
\N
directory_id string
name binary
type string
target string
perms smallint
> ]; + +"origin" [shape = plaintext, label = <
\N
url string
> ]; + +"origin_visit" [shape = plaintext, label = <
\N
origin string
visit bigint
date timestamp with time zone
type string
> ]; + +"origin_visit_status" [shape = plaintext, label = <
\N
origin string
visit bigint
date timestamp with time zone
type string
snapshot string
status string
> ]; + +"release" [shape = plaintext, label = <
\N
id string
target string
date timestamp with time zone
date_offset smallint
name binary
author binary
target_type string
> ]; + +"revision" [shape = plaintext, label = <
\N
id string
date timestamp with time zone
date_offset smallint
committer_date timestamp with time zone
committer_date_offset smallint
type string
directory string
message binary
author binary
committer binary
> ]; + +"revision_history" [shape = plaintext, label = <
\N
id string
parent_id string
parent_rank integer
> ]; + + +"snapshot" [shape = plaintext, label = <
\N
id string
> ]; + +"snapshot_branch" [shape = plaintext, label = <
\N
snapshot_id string
name binary
target string
target_type string
> ]; + +subgraph "logical_grouping" { + style = rounded; + bgcolor = gray95; + color = gray; + + subgraph cluster_content { + label = <content>; + content; + skipped_content; + } + + subgraph cluster_directory { + label = <directories>; + directory; + directory_entry; + } + + subgraph cluster_revision { + label = <revisions>; + revision; + revision_history; + } + + subgraph cluster_release { + label = <releases>; + release; + } + + subgraph cluster_snapshots { + label = <snapshots>; + snapshot; + snapshot_branch; + } + + subgraph cluster_origins { + label = <origins>; + origin; + origin_visit; + origin_visit_status; + } + + { + edge [style = dashed]; + + # "rtcolN" identifies the N-th row (1-based) in a table, as a source + # "ltcolN" identifies the N-th row (1-based) in a table, as a destination + "snapshot_branch":rtcol3 -> "release":ltcol1; + "snapshot_branch":rtcol3 -> "revision":ltcol1; + # "snapshot_branch":rtcol3 -> "directory":ltcol1; + # "snapshot_branch":rtcol3 -> "content":ltcol2; + + "directory_entry":rtcol1 -> "directory":ltcol1; + + "directory_entry":rtcol4 -> "directory":ltcol1; + "directory_entry":rtcol4 -> "content":ltcol2; + "directory_entry":rtcol4 -> "skipped_content":ltcol2; + "directory_entry":rtcol4 -> "revision":ltcol1; + + "release":rtcol2 -> "revision":ltcol1; + "revision":rtcol7 -> "directory":ltcol1; + "revision_history":rtcol2 -> "revision":ltcol1; + + "origin_visit":rtcol1 -> "origin":ltcol1; + "origin_visit_status":rtcol1 -> "origin":ltcol1; + "revision_history":rtcol1 -> "revision":ltcol1; + "origin_visit_status":rtcol5 -> "snapshot":ltcol1; + "snapshot_branch":rtcol1 -> "snapshot":ltcol1; + + } +} +} diff --git a/docs/graph/_images/db-schema.svg b/docs/graph/_images/db-schema.svg index 2f8dff7..55ca012 100644 --- a/docs/graph/_images/db-schema.svg +++ b/docs/graph/_images/db-schema.svg @@ -1,522 +1,516 @@ - - - + + g - -cluster_content - -content - -cluster_directory - -directories - -cluster_revision - -revisions - -cluster_snapshots - -snapshots - -cluster_origins - -origins - -cluster_release - -releases + + +cluster_content + +content + + +cluster_directory + +directories + + +cluster_revision + +revisions + + +cluster_release + +releases + + +cluster_snapshots + +snapshots + + +cluster_origins + +origins -content - - - - content - sha1 - sha1 -   -   - - sha1_git - sha1_git -   -   - - length - bigint -   -   - - - - -directory - - - - directory - id - sha1_git -   -   - - dir_entries - bigint[] -   -   - - file_entries - bigint[] -   -   - - rev_entries - bigint[] -   -   - - - - -directory_entry_dir - - - - directory_entry_dir - id - bigserial -   -   - - target - sha1_git -   -   - - name - unix_path -   -   - - perms - file_perms -   -   - - - - -directory:rtcol2->directory_entry_dir:ltcol1 - - - - -directory_entry_file - - - - directory_entry_file - id - bigserial -   -   - - target - sha1_git -   -   - - name - unix_path -   -   - - perms - file_perms -   -   - - - - -directory:rtcol3->directory_entry_file:ltcol1 - - - - -directory_entry_rev - - - - directory_entry_rev - id - bigserial -   -   - - target - sha1_git -   -   - - name - unix_path -   -   - - perms - file_perms -   -   - - - - -directory:rtcol4->directory_entry_rev:ltcol1 - - - - -directory_entry_dir:rtcol2->directory:ltcol1 - - - - -directory_entry_file:rtcol2->content:ltcol2 - - + +content + + + + content + sha1 + string + +   + + sha1_git + string +   +   + + sha256 + string +   +   + + blake2s256 + string +   +   + + length + bigint +   +   + + status + string +   +   + + -skipped_content - - - - skipped_content - sha1 - sha1 -   -   - - sha1_git - sha1_git -   -   - - length - bigint -   -   - - - - -directory_entry_file:rtcol2->skipped_content:ltcol2 - - + +skipped_content + + + + skipped_content + sha1 + string +   +   + + sha1_git + string +   +   + + sha256 + string +   +   + + blake2s256 + string +   +   + + length + bigint +   +   + + status + string +   +   + + reason + string +   +   + + + + + +directory + + + + directory + id + string + +   + + + + + +directory_entry + + + + directory_entry + directory_id + string + +   + + name + binary +   +   + + type + string +   +   + + target + string +   +   + + perms + smallint +   +   + + + + + +directory_entry:rtcol4->content:ltcol2 + + + + + +directory_entry:rtcol4->skipped_content:ltcol2 + + + + + +directory_entry:rtcol1->directory:ltcol1 + + + + + +directory_entry:rtcol4->directory:ltcol1 + + -revision - - - - revision - id - sha1_git -   -   - - date - timestamp -   -   - - committer_date - timestamp -   -   - - directory - sha1_git -   -   - - message - bytea -   -   - - author - bigint -   -   - - committer - bigint -   -   - - - - -directory_entry_rev:rtcol2->revision:ltcol1 - - + +revision + + + + revision + id + string + +   + + date + timestamp with time zone +   +   + + date_offset + smallint +   +   + + committer_date + timestamp with time zone +   +   + + committer_date_offset + smallint +   +   + + type + string +   +   + + directory + string +   +   + + message + binary +   +   + + author + binary +   + + + committer + binary +   + + + + + + +directory_entry:rtcol4->revision:ltcol1 + + -origin - - - - origin - id - bigserial -   -   - - type - text -   -   - - url - text -   -   - - + +origin + + + + origin + url + string +   +   + + -origin_visit - - - - origin_visit - origin - bigint -   -   - - visit - bigint -   -   - - date - timestamp -   -   - - snapshot_id - bigint -   -   - - + +origin_visit + + + + origin_visit + origin + string + + + + visit + bigint + +   + + date + timestamp with time zone +   +   + + type + string +   +   + + -origin_visit:rtcol1->origin:ltcol1 - - + +origin_visit:rtcol1->origin:ltcol1 + + + + + +origin_visit_status + + + + origin_visit_status + origin + string + + + + visit + bigint + +   + + date + timestamp with time zone +   +   + + type + string +   +   + + snapshot + string +   +   + + status + string +   +   + + + + + +origin_visit_status:rtcol1->origin:ltcol1 + + -snapshot - - - - snapshot - object_id - bigserial -   -   - - id - sha1_git -   -   - - - - -origin_visit:rtcol6->snapshot:ltcol1 - - - - -person - - - - person - id - bigserial -   -   - - + +snapshot + + + + snapshot + id + string +   +   + + + + + +origin_visit_status:rtcol5->snapshot:ltcol1 + + -release - - - - release - id - sha1_git -   -   - - target - sha1_git -   -   - - date - timestamp -   -   - - name - bytea -   -   - - comment - bytea -   -   - - author - bigint -   -   - - - - -release:rtcol7->person:ltcol1 - - + +release + + + + release + id + string + +   + + target + string +   +   + + date + timestamp with time zone +   +   + + date_offset + smallint +   +   + + name + binary +   +   + + author + binary +   + + + target_type + string +   +   + + -release:rtcol2->revision:ltcol1 - - + +release:rtcol2->revision:ltcol1 + + -revision:rtcol7->directory:ltcol1 - - - - -revision:rtcol9->person:ltcol1 - - - - -revision:rtcol10->person:ltcol1 - - + +revision:rtcol7->directory:ltcol1 + + -revision_history - - - - revision_history - id - sha1_git -   -   - - parent_id - sha1_git -   -   - - parent_rank - integer -   -   - - + +revision_history + + + + revision_history + id + string + + + + parent_id + string +   +   + + parent_rank + integer + +   + + -revision_history:rtcol1->revision:ltcol1 - - + +revision_history:rtcol2->revision:ltcol1 + + -revision_history:rtcol2->revision:ltcol1 - - + +revision_history:rtcol1->revision:ltcol1 + + -snapshot_branch - - - - snapshot_branch - object_id - bigserial -   -   - - name - bytea -   -   - - target - bytea -   -   - - target_type - snapshot_target -   -   - - + +snapshot_branch + + + + snapshot_branch + snapshot_id + string + +   + + name + binary +   +   + + target + string +   +   + + target_type + string +   +   + + + + + +snapshot_branch:rtcol3->release:ltcol1 + + -snapshot_branch:rtcol3->revision:ltcol1 - - - - -snapshot_branches - - - - snapshot_branches - snapshot_id - bigint -   -   - - branch_id - bigint -   -   - - - - -snapshot_branches:rtcol1->snapshot:ltcol1 - - - - -snapshot_branches:rtcol2->snapshot_branch:ltcol1 - - + +snapshot_branch:rtcol3->revision:ltcol1 + + + + + +snapshot_branch:rtcol1->snapshot:ltcol1 + +