Restructure db schema
The "commit_links" table is now called "commit_edges". There is now a "metrics" table that run measurements have a foreign key to. This provides canonical metric metadata and will speed up the initial graph page (before any real data arrives). For now, it will be overwritten with each new run, but more nuanced config options may be added later.
This commit is contained in:
parent
1bae83d116
commit
a525e58211
18 changed files with 77 additions and 71 deletions
|
|
@ -50,7 +50,7 @@ pub async fn get_commit_by_hash(
|
|||
let parents = sqlx::query!(
|
||||
"\
|
||||
SELECT hash, message, reachable FROM commits \
|
||||
JOIN commit_links ON hash = parent \
|
||||
JOIN commit_edges ON hash = parent \
|
||||
WHERE child = ? \
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC \
|
||||
",
|
||||
|
|
@ -64,7 +64,7 @@ pub async fn get_commit_by_hash(
|
|||
let children = sqlx::query!(
|
||||
"\
|
||||
SELECT hash, message, reachable FROM commits \
|
||||
JOIN commit_links ON hash = child \
|
||||
JOIN commit_edges ON hash = child \
|
||||
WHERE parent = ? \
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC \
|
||||
",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue