Files
gamenight/gamenight-database/src/schema.rs

118 lines
2.5 KiB
Rust

// @generated automatically by Diesel CLI.
pub mod sql_types {
#[derive(diesel::sql_types::SqlType)]
#[diesel(postgres_type(name = "role"))]
pub struct Role;
}
diesel::table! {
use diesel::sql_types::*;
use super::sql_types::Role;
client (id) {
id -> Uuid,
username -> Varchar,
email -> Varchar,
role -> Role,
}
}
diesel::table! {
game (id) {
id -> Uuid,
name -> Varchar,
}
}
diesel::table! {
gamenight (id) {
id -> Uuid,
name -> Varchar,
datetime -> Timestamptz,
owner_id -> Uuid,
location_id -> Nullable<Uuid>,
}
}
diesel::table! {
gamenight_gamelist (gamenight_id, game_id) {
gamenight_id -> Uuid,
game_id -> Uuid,
}
}
diesel::table! {
gamenight_participant (gamenight_id, user_id) {
gamenight_id -> Uuid,
user_id -> Uuid,
}
}
diesel::table! {
location (id) {
id -> Uuid,
name -> Varchar,
address -> Nullable<Varchar>,
note -> Nullable<Varchar>,
}
}
diesel::table! {
location_owner (location_id, user_id) {
location_id -> Uuid,
user_id -> Uuid,
}
}
diesel::table! {
owned_game (user_id, game_id) {
user_id -> Uuid,
game_id -> Uuid,
location_id -> Nullable<Uuid>,
}
}
diesel::table! {
pwd (user_id) {
user_id -> Uuid,
password -> Varchar,
}
}
diesel::table! {
registration_tokens (id) {
id -> Uuid,
#[max_length = 32]
token -> Bpchar,
single_use -> Bool,
expires -> Nullable<Timestamptz>,
}
}
diesel::joinable!(gamenight -> client (owner_id));
diesel::joinable!(gamenight -> location (location_id));
diesel::joinable!(gamenight_gamelist -> game (game_id));
diesel::joinable!(gamenight_gamelist -> gamenight (gamenight_id));
diesel::joinable!(gamenight_participant -> client (user_id));
diesel::joinable!(gamenight_participant -> gamenight (gamenight_id));
diesel::joinable!(location_owner -> client (user_id));
diesel::joinable!(location_owner -> location (location_id));
diesel::joinable!(owned_game -> client (user_id));
diesel::joinable!(owned_game -> game (game_id));
diesel::joinable!(owned_game -> location (location_id));
diesel::joinable!(pwd -> client (user_id));
diesel::allow_tables_to_appear_in_same_query!(
client,
game,
gamenight,
gamenight_gamelist,
gamenight_participant,
location,
location_owner,
owned_game,
pwd,
registration_tokens,
);