use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "chat_emoji")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, #[sea_orm(unique_key = "space_emoji_name")] pub space_id: Uuid, pub name: String, #[sea_orm(unique_key = "space_emoji_name")] pub lower_name: String, pub user_id: i64, pub bucket: String, pub s3_key: String, #[sea_orm(default_value = "false")] pub animated: bool, #[sea_orm(default_value = "false")] pub disabled: bool, pub created_at: OffsetDateTime, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}