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