use std::time::SystemTime; use diesel::{Associations, Identifiable, Insertable, Queryable, Selectable}; #[derive(Queryable, Selectable, Insertable, Identifiable, Debug, PartialEq)] #[diesel(table_name = crate::schema::users)] #[diesel(check_for_backend(diesel::pg::Pg))] pub struct User { pub id: String, pub email: String } #[derive(Queryable, Selectable, Insertable, Identifiable, Associations, Debug, PartialEq)] #[diesel(belongs_to(User))] #[diesel(table_name = crate::schema::magic_links)] #[diesel(check_for_backend(diesel::pg::Pg))] pub struct MagicLink { pub id: String, pub user_id: String, pub expires: SystemTime }