Start DB integration

This commit is contained in:
Lol3rrr
2024-09-07 17:44:57 +02:00
parent 324eaf7d3d
commit ae6c1b590f
18 changed files with 680 additions and 53 deletions

18
backend/src/models.rs Normal file
View File

@@ -0,0 +1,18 @@
use diesel::prelude::*;
#[derive(Queryable, Selectable, Insertable, Debug)]
#[diesel(table_name = crate::schema::sessions)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Session {
pub id: Vec<i64>,
pub data: serde_json::Value,
pub expiry_date: String,
}
#[derive(Queryable, Selectable, Insertable, Debug)]
#[diesel(table_name = crate::schema::demos)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Demo {
pub steam_id: i64,
pub demo_id: i64,
}