HOLY FLUFFING GOOBER IT COMPILES
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user