Skip to content
Clone
a06673b
33 lines 1.0 KB 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_views")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub project_id: Uuid,
pub creator_id: Uuid,
pub name: String,
pub description: Option<String>,
#[sea_orm(column_type = "Json")]
pub filter: JsonValue,
pub sort_by: String,
pub group_by: Option<String>,
pub layout: String,
#[sea_orm(default_value = "false")]
pub is_shared: bool,
#[sea_orm(default_value = 0)]
pub sort_order: i32,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, from = "project_id", to = "id")]
pub project: BelongsTo<super::project::Entity>,
#[sea_orm(belongs_to, from = "creator_id", to = "uid")]
pub creator: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}