use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "user_oauth_provider")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub user_id: Uuid, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, #[sea_orm(unique_key = "provider_identity")] pub provider: String, #[sea_orm(unique_key = "provider_identity")] pub provider_user_id: String, pub provider_username: String, pub access_token_hash: Option, pub refresh_token_hash: Option, pub token_expires_at: Option, pub scopes: Vec, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, pub last_used_at: Option, } impl ActiveModelBehavior for ActiveModel {}