Skip to content
Clone
194c44c
29 lines 934 B Rust
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "space_groups")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "space_name")]
pub space_id: Uuid,
#[sea_orm(unique_key = "space_name")]
pub name: String,
pub position: i64,
pub color: String,
pub unicode_emoji: Option<String>,
pub icon_hash: Option<String>,
pub version: i32,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
pub created_by: i64,
#[sea_orm(belongs_to, from = "space_id", to = "id")]
pub space: BelongsTo<super::spaces::Entity>,
#[sea_orm(belongs_to, from = "created_by", to = "uid")]
pub creator: BelongsTo<super::super::users::user::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}