//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Serialize, Deserialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "uploads")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub user_id: i64,
pub file_name_original: String,
pub file_name_generated: String,
pub file_size_bytes: i64,
pub content_type: Option<String>,
pub file_hash: Option<String>,
pub item_name: Option<String>,
#[sea_orm(column_type = "Text", nullable)]
pub item_description: Option<String>,
#[sea_orm(column_type = "Text")]
pub item_path: String,
pub storage_backend: String,
pub processing_status: String,
#[sea_orm(column_type = "Text", nullable)]
pub processing_error: Option<String>,
pub date_uploaded: DateTimeWithTimeZone,
pub date_updated: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::ai_descriptions::Entity")]
AiDescriptions,
#[sea_orm(has_many = "super::ocr_results::Entity")]
OcrResults,
#[sea_orm(has_many = "super::upload_tags::Entity")]
UploadTags,
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::UserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
)]
Users,
}
impl Related<super::ai_descriptions::Entity> for Entity {
fn to() -> RelationDef {
Relation::AiDescriptions.def()
}
}
impl Related<super::ocr_results::Entity> for Entity {
fn to() -> RelationDef {
Relation::OcrResults.def()
}
}
impl Related<super::upload_tags::Entity> for Entity {
fn to() -> RelationDef {
Relation::UploadTags.def()
}
}
impl Related<super::users::Entity> for Entity {
fn to() -> RelationDef {
Relation::Users.def()
}
}
impl ActiveModelBehavior for ActiveModel {}
⭐
Log in to mark this repository.
2.0 KiB · text
History
1ce9641