Added belongs_to to most of diesel structs for easier querying.

This commit is contained in:
2026-01-06 22:00:52 +01:00
parent 5c928b30f3
commit ea9f05b048
8 changed files with 50 additions and 30 deletions

View File

@@ -0,0 +1,13 @@
use diesel::{Insertable, Queryable};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::schema::gamenight_gamelist;
#[derive(Serialize, Deserialize, Debug, Insertable, Queryable)]
#[diesel(belongs_to(Gamenight, foreign_key=FK_gamenight_id))]
#[diesel(belongs_to(Game, foreign_key=FK_game_id))]
#[diesel(table_name = gamenight_gamelist)]
pub struct GamenightGamelist {
pub gamenight_id: Uuid,
pub game_id: Uuid,
}