HOLY FLUFFING GOOBER IT COMPILES

This commit is contained in:
2025-09-14 14:18:39 +03:00
parent 66704b4e2e
commit 61ae1b1b53
13 changed files with 59 additions and 53 deletions

View File

@@ -7,20 +7,20 @@ use crate::db::{
};
#[derive(Debug, Default, Clone, FromRow)]
pub struct AwardRecord<'a> {
pub struct AwardRecord {
pub id: i64,
pub user_id: ForeignKey<'a, User>,
pub award_id: ForeignKey<'a, Award>,
pub author_id: ForeignKey<'a, User>,
pub user_id: ForeignKey<User>,
pub award_id: ForeignKey<Award>,
pub author_id: ForeignKey<User>,
pub created_at: i64,
}
impl<'a> TableMeta<'a> for AwardRecord<'a> {
impl TableMeta for AwardRecord {
type PrimaryKey = i64;
const TABLE: &'static str = "records_awards";
}
impl AwardRecord<'_> {
impl AwardRecord {
pub async fn insert_new(&self, pool: &CurrPool) -> Result<Self> {
let session = sqlx::query_as!(
AwardRecord,
@@ -37,7 +37,7 @@ impl AwardRecord<'_> {
.fetch_one(pool)
.await?;
self.author_id.extract(pool);
let user = self.author_id.extract(pool).await?;
Ok(session)
}