Skip to content
Clone
a06673b
26 lines 831 B Rust
use sea_orm::entity::prelude::*;
use sea_orm::JsonValue;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "project_activities")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub project_id: Uuid,
pub actor_id: Uuid,
pub verb: String,
pub target_kind: String,
pub target_id: Option<Uuid>,
#[sea_orm(column_type = "Json")]
pub payload: Option<JsonValue>,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "project_id", to = "id")]
pub project: BelongsTo<super::project::Entity>,
#[sea_orm(belongs_to, from = "actor_id", to = "uid")]
pub actor: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}