training and training_data
This commit is contained in:
parent
8868421671
commit
b22ce1392d
12
init.sql
12
init.sql
@ -1,12 +1,18 @@
|
|||||||
create table if not exists training(
|
create table if not exists training(
|
||||||
id integer primary key,
|
id uuid primary key default gen_random_uuid(),
|
||||||
medium varchar(255) not null,
|
medium varchar(255) not null,
|
||||||
uuid uuid not null,
|
comment text not null,
|
||||||
|
data jsonb not null default '{}'
|
||||||
|
);
|
||||||
|
|
||||||
|
create table if not exists training_data(
|
||||||
|
training_id uuid not null,
|
||||||
t timestamp with time zone not null,
|
t timestamp with time zone not null,
|
||||||
lat float not null,
|
lat float not null,
|
||||||
lon float not null,
|
lon float not null,
|
||||||
speed float not null,
|
speed float not null,
|
||||||
altitude float not null,
|
altitude float not null,
|
||||||
distance float not null,
|
distance float not null,
|
||||||
kcal int not null
|
kcal int not null,
|
||||||
|
constraint fk_training_id foreign key(training_id) references training(id) on delete cascade
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user