From dfdec4d8a7d47505ff69bca6f30688a7f2d16323 Mon Sep 17 00:00:00 2001 From: Gulliver Date: Sun, 30 May 2021 23:14:50 +0200 Subject: [PATCH] added structs for the defined tables --- model/sqlite3/src/db/models.rs | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/model/sqlite3/src/db/models.rs b/model/sqlite3/src/db/models.rs index e69de29..013c136 100644 --- a/model/sqlite3/src/db/models.rs +++ b/model/sqlite3/src/db/models.rs @@ -0,0 +1,88 @@ +use super::schema::posts; + +#[derive(Serialize, Queryable)] +pub struct user { + id: i64, + nickname: String, + pronouns: String, + address_1_name: String, + address_2_additional: String, + address_4_street: String, + adress_house_number: String, + adress_city_code: String, + adress_country: String, + Ehrenaemter: String, + gravatar_email: String, + Freitext: String, +} + +#[derive(Serialize, Queryable)] +pub struct user_skill { + id: i64, + user_id: i64, + skill_id: i64, + level: i64, +} + +#[derive(Serialize, Queryable)] +pub struct user_language { + id: i64, + + user_id: i64, + language_id: i64, + level: i64, +} + +#[derive(Serialize, Queryable)] +pub struct skill { + id: i64, + name: String, +} + +#[derive(Serialize, Queryable)] +pub struct user_experience { + id: i64, + user_id: i64, + description: String, + start: Date, + end: Date, +} + +#[derive(Serialize, Queryable)] +pub struct user_search_topic { + id: i64, + user_id: i64, + topic_id: i64, +} + +#[derive(Serialize, Queryable)] +pub struct user_contact { + id: i64, + user_id: i64, + contact_type_id: i64, + content_: String, +} + +#[derive(Serialize, Queryable)] +pub struct topic { + id: i64, + name: String, +} + +#[derive(Serialize, Queryable)] +pub struct language { + id: i64, + name: String, +} + +#[derive(Serialize, Queryable)] +pub struct experience { + id: i64, + name: String, +} + +#[derive(Serialize, Queryable)] +pub struct contact_type { + id: i64, + name: String, +}