Files
treasure-chest/backend/entity/access_log.rs
2025-11-19 23:09:59 +01:00

36 lines
900 B
Rust

//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "access_log")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false, column_type = "Binary(16)")]
pub id: Vec<u8>,
pub ip: String,
#[sea_orm(column_type = "Binary(16)")]
pub file_id: Vec<u8>,
pub date_time: DateTime,
pub successful: i8,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::file::Entity",
from = "Column::FileId",
to = "super::file::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
)]
File,
}
impl Related<super::file::Entity> for Entity {
fn to() -> RelationDef {
Relation::File.def()
}
}
impl ActiveModelBehavior for ActiveModel {}