use chrono::NaiveDateTime; use libretunes_macro::db_type; use serde::{Deserialize, Serialize}; /// Model for a history entry #[db_type(crate::schema::song_history)] #[derive(Serialize, Deserialize)] pub struct HistoryEntry { /// A unique id for the history entry #[omit_new] pub id: i32, /// The id of the user who listened to the song pub user_id: i32, /// The date the song was listened to pub date: NaiveDateTime, /// The id of the song that was listened to pub song_id: i32, }