2021-03-26 22:30:38 +00:00
|
|
|
table! {
|
2021-04-03 06:16:54 +00:00
|
|
|
use diesel::sql_types::*;
|
|
|
|
|
2021-03-26 22:30:38 +00:00
|
|
|
localuser (user_id) {
|
|
|
|
user_id -> Text,
|
|
|
|
username -> Text,
|
|
|
|
password -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
2021-04-03 06:16:54 +00:00
|
|
|
use diesel::sql_types::*;
|
|
|
|
use crate::models::users::*;
|
|
|
|
|
2021-03-26 22:30:38 +00:00
|
|
|
user (id) {
|
|
|
|
id -> Text,
|
2021-04-03 06:16:54 +00:00
|
|
|
role -> RoleMapping,
|
2021-03-26 22:30:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-05 21:21:40 +00:00
|
|
|
table! {
|
|
|
|
use diesel::sql_types::*;
|
|
|
|
|
|
|
|
user_zone (user_id, zone) {
|
|
|
|
user_id -> Text,
|
|
|
|
zone -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-26 22:30:38 +00:00
|
|
|
joinable!(localuser -> user (user_id));
|
2021-04-05 21:21:40 +00:00
|
|
|
joinable!(user_zone -> user (user_id));
|
2021-03-26 22:30:38 +00:00
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
|
|
|
localuser,
|
|
|
|
user,
|
2021-04-05 21:21:40 +00:00
|
|
|
user_zone,
|
2021-03-26 22:30:38 +00:00
|
|
|
);
|