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
12
.sqlx/query-32f0ac59687e5455bb38060dc1d6cd181a86cd6ca7ac2f583a33212c8b7bef1a.json
generated
Normal file
12
.sqlx/query-32f0ac59687e5455bb38060dc1d6cd181a86cd6ca7ac2f583a33212c8b7bef1a.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "WITH RECURSIVE tracked (hash) AS ( SELECT hash FROM refs WHERE tracked UNION SELECT parent FROM commit_edges JOIN tracked ON hash = child ), reachable (hash) AS ( SELECT hash FROM refs UNION SELECT hash FROM tracked UNION SELECT parent FROM commit_edges JOIN reachable ON hash = child ) UPDATE commits SET reachable = CASE WHEN hash IN tracked THEN 2 WHEN hash IN reachable THEN 1 ELSE 0 END ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "32f0ac59687e5455bb38060dc1d6cd181a86cd6ca7ac2f583a33212c8b7bef1a"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue