use tosin::db::models::{gather, Id, Model}; #[derive(Model, PartialEq, Debug)] pub struct Question { id: Option, #[model(max_length = 200)] question_text: String, /// date published pub_date: chrono::NaiveDateTime, } #[derive(Model, PartialEq, Debug)] pub struct Choice { id: Option, #[model(Question, on_delete=Cascade)] question: Id, #[model(max_length = 200)] choice_text: String, #[model(default = 0)] votes: usize, } gather!();