From cbe2ff86f1a6873b88e314011ee64b6c25f3359c Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 5 Feb 2020 22:26:37 -0500 Subject: Extract basics info from strava and display it --- src/models.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/models.rs') diff --git a/src/models.rs b/src/models.rs index 15eafd7..83153fd 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,6 +1,5 @@ use crate::schema::config; use crate::schema::entries; -use crate::schema::entry_data; use crate::schema::raw_data; use crate::schema::strava_tokens; use crate::schema::tasks; @@ -143,13 +142,15 @@ pub struct RawDataKey { pub username: String, } -#[derive(Insertable, Queryable, Debug, Serialize, Deserialize, Clone)] +#[derive(Insertable, Queryable, Identifiable, Debug, Serialize, Deserialize, Clone)] #[table_name = "raw_data"] pub struct RawData { pub data_type: DataType, pub id: i64, pub username: String, pub payload: Value, + pub entry_type: Option, + pub entry_id: Option, } #[derive(Insertable, Debug, Serialize, Deserialize, Clone)] @@ -169,13 +170,3 @@ pub struct Entry { pub timestamp: Option>, pub payload: Value, } - -#[derive(Queryable, Insertable, Debug, Serialize, Deserialize, Clone)] -#[table_name = "entry_data"] -pub struct EntryData { - pub username: String, - pub entry_type: String, - pub entry_id: i64, - pub data_type: DataType, - pub data_id: i64, -} -- cgit v1.2.3