Fixing database script and adding information...
This commit is contained in:
@@ -25,7 +25,7 @@ create table training (
|
||||
constraint fk_account foreign key (account) references account(id)
|
||||
);
|
||||
create view dailylift as select
|
||||
date_trunc('day', time) as time, account, exercise, sum(runs * reps * kilos) as lift
|
||||
date(time) as time, account, exercise, sum(runs * reps * kilos) as lift
|
||||
from training group by 1, 2, 3;
|
||||
|
||||
|
||||
|
||||
16
readme.md
16
readme.md
@@ -62,4 +62,18 @@ When travelling you might opt for specifying a specific location on the command
|
||||
TZ=Australia/Sydney train squat 3 10 60
|
||||
```
|
||||
|
||||
Data in the database can be visualized with, for example, Grafana, more info to follow.
|
||||
Grafana Visaulisation
|
||||
=====================
|
||||
|
||||
In `grafana/training-dashboard.json` a small dashboard is presented, a Postgres data source
|
||||
must be defined, and the data base user must have access to select from tables in the training database.
|
||||
|
||||
```
|
||||
grant select on account to grafana_query;
|
||||
grant select on training to grafan_query;
|
||||
grant select on exercise to grafan_query;
|
||||
grant select on dailylist to grafan_query;
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user