diff options
Diffstat (limited to 'src/models.rs')
-rw-r--r-- | src/models.rs | 15 |
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, -} |