feat(db): add project_views entity
zhenyi committed
Added lib/db/project/project_views.rs lib/db/project/project_views.rs +33 −0 View lib/db/project/project_views.rs
@@ -0,0 +1,33 @@
1use sea_orm::entity::prelude::*;
2use sea_orm::JsonValue;
3use time::OffsetDateTime;
4use uuid::Uuid;
5
6#[sea_orm::model]
7#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
8#[sea_orm(table_name = "project_views")]
9pub struct Model {
10 #[sea_orm(primary_key, auto_increment = false)]
11 pub id: Uuid,
12 pub project_id: Uuid,
13 pub creator_id: Uuid,
14 pub name: String,
15 pub description: Option<String>,
16 #[sea_orm(column_type = "Json")]
17 pub filter: JsonValue,
18 pub sort_by: String,
19 pub group_by: Option<String>,
20 pub layout: String,
21 #[sea_orm(default_value = "false")]
22 pub is_shared: bool,
23 #[sea_orm(default_value = 0)]
24 pub sort_order: i32,
25 pub created_at: OffsetDateTime,
26 pub updated_at: Option<OffsetDateTime>,
27 #[sea_orm(belongs_to, from = "project_id", to = "id")]
28 pub project: BelongsTo<super::project::Entity>,
29 #[sea_orm(belongs_to, from = "creator_id", to = "uid")]
30 pub creator: BelongsTo<super::super::user::users::Entity>,
31}
32
33impl ActiveModelBehavior for ActiveModel {}