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, #[sea_orm(column_type = "Json")] pub filter: JsonValue, pub sort_by: String, pub group_by: Option, 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, #[sea_orm(belongs_to, from = "project_id", to = "id")] pub project: BelongsTo, #[sea_orm(belongs_to, from = "creator_id", to = "uid")] pub creator: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}