Skip to content
Clone
a06673b
22 lines 694 B Rust
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<OffsetDateTime>,
#[sea_orm(belongs_to, from = "app_id", to = "id")]
pub app: BelongsTo<super::oauth_apps::Entity>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}