use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "oauth_grant")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub app_id: Uuid, pub user_id: Uuid, pub scope: String, pub created_at: OffsetDateTime, pub expires_at: Option, #[sea_orm(belongs_to, from = "app_id", to = "id")] pub app: BelongsTo, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}