forked from Roflin/gamenight
Last cleanup
This commit is contained in:
@@ -11,7 +11,7 @@ use super::DbConnection;
|
||||
#[diesel(belongs_to(Gamenight))]
|
||||
#[diesel(belongs_to(User))]
|
||||
#[diesel(table_name = gamenight_participant)]
|
||||
pub struct GamenightParticipants {
|
||||
pub struct GamenightParticipant {
|
||||
pub gamenight_id: Uuid,
|
||||
pub user_id: Uuid,
|
||||
}
|
||||
|
||||
83
gamenight-database/src/schema/schema.rs
Normal file
83
gamenight-database/src/schema/schema.rs
Normal file
@@ -0,0 +1,83 @@
|
||||
// @generated automatically by Diesel CLI.
|
||||
|
||||
pub mod sql_types {
|
||||
#[derive(diesel::sql_types::SqlType)]
|
||||
#[diesel(postgres_type(name = "role"))]
|
||||
pub struct Role;
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
gamenight (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
datetime -> Timestamptz,
|
||||
owner_id -> 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! {
|
||||
known_games (id) {
|
||||
id -> Uuid,
|
||||
name -> Varchar,
|
||||
}
|
||||
}
|
||||
|
||||
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::table! {
|
||||
use diesel::sql_types::*;
|
||||
use super::sql_types::Role;
|
||||
|
||||
users (id) {
|
||||
id -> Uuid,
|
||||
username -> Varchar,
|
||||
email -> Varchar,
|
||||
role -> Role,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::joinable!(gamenight -> users (owner_id));
|
||||
diesel::joinable!(gamenight_gamelist -> gamenight (gamenight_id));
|
||||
diesel::joinable!(gamenight_gamelist -> known_games (game_id));
|
||||
diesel::joinable!(gamenight_participant -> gamenight (gamenight_id));
|
||||
diesel::joinable!(gamenight_participant -> users (user_id));
|
||||
diesel::joinable!(pwd -> users (user_id));
|
||||
|
||||
diesel::allow_tables_to_appear_in_same_query!(
|
||||
gamenight,
|
||||
gamenight_gamelist,
|
||||
gamenight_participant,
|
||||
known_games,
|
||||
pwd,
|
||||
registration_tokens,
|
||||
users,
|
||||
);
|
||||
Reference in New Issue
Block a user