summaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
index 50e1877..c88f938 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -1,3 +1,4 @@
+use crate::schema::entries;
use crate::schema::raw_data;
use crate::schema::config;
use crate::schema::strava_tokens;
@@ -149,3 +150,21 @@ pub struct RawData {
pub username: String,
pub payload: Value,
}
+
+#[derive(Insertable, Debug, Serialize, Deserialize, Clone)]
+#[table_name = "entries"]
+pub struct NewEntry<'a> {
+ pub username: &'a str,
+ pub entry_type: &'a str,
+ pub timestamp: Option<DateTime<Utc>>,
+ pub payload: Value,
+}
+
+#[derive(Queryable, Debug, Serialize, Deserialize, Clone)]
+pub struct Entry {
+ pub username: String,
+ pub entry_type: String,
+ pub id: i64,
+ pub timestamp: Option<DateTime<Utc>>,
+ pub payload: Value,
+}