Files
advotracker_db/src/models/user_roles.rs
2021-05-23 14:45:01 +02:00

29 lines
675 B
Rust

// SPDX-License-Identifier: (0BSD or MIT)
/*
* advotracker - Hotline tackingtool for Advocats
*
* Copyright 2020-2021 Ralf Zerres <ralf.zerres@networkx.de>
*/
use crate::schema::user_roles;
use serde::Deserialize;
/// Structure of a user role record
#[derive(Debug, Queryable, PartialEq)]
pub struct UserRole {
/// id of the referenced user
pub id_user: i32,
/// id of the referenced role
pub id_role: i32,
}
/// Structure of a new user role record
#[derive(Deserialize, Insertable)]
#[table_name = "user_roles"]
pub struct NewUserRole {
/// id of the referenced user
pub id_user: i32,
/// id of the referenced role
pub id_role: i32,
}