summaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2020-02-05 22:26:37 -0500
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2020-02-05 22:26:37 -0500
commitcbe2ff86f1a6873b88e314011ee64b6c25f3359c (patch)
tree03f20093fd59edccb9dcafd1dbb7d1d65fd96c02 /src/models.rs
parent97b82520aacacbe600c8918b26b5b29b8d47d4d1 (diff)
Extract basics info from strava and display it
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs15
1 files changed, 3 insertions, 12 deletions
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<String>,
+ pub entry_id: Option<i64>,
}
#[derive(Insertable, Debug, Serialize, Deserialize, Clone)]
@@ -169,13 +170,3 @@ pub struct Entry {
pub timestamp: Option<DateTime<Utc>>,
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,
-}