123 lines
2.7 KiB
Rust
123 lines
2.7 KiB
Rust
table! {
|
|
use diesel::sql_types::*;
|
|
use diesel_geometry::sql_types::*;
|
|
addresses (id) {
|
|
id -> Uuid,
|
|
title -> Nullable<Text>,
|
|
street -> Text,
|
|
number -> Text,
|
|
zipcode -> Text,
|
|
city -> Text,
|
|
geo_location -> Nullable<Point>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
addresses_entities (address_id, entitiy_id) {
|
|
address_id -> Uuid,
|
|
entitiy_id -> Uuid,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
buildings (entity_id) {
|
|
entity_id -> Uuid,
|
|
name -> Text,
|
|
description -> Nullable<Text>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
communication_targets (id) {
|
|
id -> Uuid,
|
|
entity -> Text,
|
|
entity_id -> Uuid,
|
|
#[sql_name = "type"]
|
|
type_ -> Uuid,
|
|
value -> Text,
|
|
description -> Nullable<Text>,
|
|
visibility -> Bool,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
communication_types (id) {
|
|
id -> Uuid,
|
|
name -> Text,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
entities (entity_id) {
|
|
entity_id -> Uuid,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
members (entity_id) {
|
|
entity_id -> Uuid,
|
|
users_id -> Nullable<Uuid>,
|
|
firstname -> Text,
|
|
lastname -> Text,
|
|
date_of_birth -> Nullable<Date>,
|
|
sex -> Nullable<Int2>,
|
|
salutation -> Nullable<Text>,
|
|
place_of_birth -> Nullable<Text>,
|
|
academic_titles -> Nullable<Text>,
|
|
personnel_number -> Nullable<Int4>,
|
|
ui_language -> Nullable<Text>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
users (id) {
|
|
id -> Uuid,
|
|
password -> Nullable<Text>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
vehicle_categories (id) {
|
|
id -> Uuid,
|
|
name -> Text,
|
|
description -> Nullable<Text>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
vehicles (entity_id) {
|
|
entity_id -> Uuid,
|
|
identifier -> Text,
|
|
numberplate -> Nullable<Text>,
|
|
description -> Nullable<Text>,
|
|
vehicle_category -> Nullable<Uuid>,
|
|
next_inspection -> Nullable<Date>,
|
|
is_operational -> Bool,
|
|
admissible_total_weight -> Nullable<Float4>,
|
|
required_license -> Nullable<Uuid>,
|
|
}
|
|
}
|
|
|
|
joinable!(addresses_entities -> addresses (address_id));
|
|
joinable!(addresses_entities -> entities (entitiy_id));
|
|
joinable!(buildings -> entities (entity_id));
|
|
joinable!(communication_targets -> communication_types (type_));
|
|
joinable!(communication_targets -> entities (id));
|
|
joinable!(members -> entities (entity_id));
|
|
joinable!(members -> users (users_id));
|
|
joinable!(vehicles -> entities (entity_id));
|
|
joinable!(vehicles -> vehicle_categories (entity_id));
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
|
addresses,
|
|
addresses_entities,
|
|
buildings,
|
|
communication_targets,
|
|
communication_types,
|
|
entities,
|
|
members,
|
|
users,
|
|
vehicle_categories,
|
|
vehicles,
|
|
);
|