Created
January 17, 2017 01:13
-
-
Save sbeckeriv/2d2328a51e5346b7cff3462d41e9f116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Serialize,Associations, Identifiable, Deserialize, Queryable, Debug, Clone)] | |
#[table_name = "places"] | |
#[has_many(inspections)] | |
pub struct Place { | |
pub id: i32, | |
pub name: String, | |
pub program_identifier: String, | |
pub description: Option<String>, | |
pub phone: Option<String>, | |
pub address: String, | |
pub longitude: f64, | |
pub latitude: f64, | |
pub most_recent_score: Option<i32>, | |
} | |
#[derive(Serialize, Identifiable, Associations, Deserialize, Queryable, Debug, Clone)] | |
#[belongs_to(Place)] | |
#[table_name = "inspections"] | |
pub struct Inspection { | |
pub id: i32, | |
pub place_id: i32, | |
pub title: String, | |
pub published: bool, | |
pub closed: bool, | |
pub inspected_at: NaiveDateTime, | |
pub inspection_type: String, | |
pub inspection_score: i32, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment